Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | goals listlengths 0 224 | goals_before listlengths 0 221 |
|---|---|---|---|---|---|---|---|
import Mathlib.Algebra.MvPolynomial.Basic
import Mathlib.Data.Finset.PiAntidiagonal
import Mathlib.LinearAlgebra.StdBasis
import Mathlib.Tactic.Linarith
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
def MvPowerSeries (Ο : Type*) (R : Type*) :=
(Ο ββ β) β R
#align mv_power_series MvPowerSeries
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
instance [Inhabited R] : Inhabited (MvPowerSeries Ο R) :=
β¨fun _ => defaultβ©
instance [Zero R] : Zero (MvPowerSeries Ο R) :=
Pi.instZero
instance [AddMonoid R] : AddMonoid (MvPowerSeries Ο R) :=
Pi.addMonoid
instance [AddGroup R] : AddGroup (MvPowerSeries Ο R) :=
Pi.addGroup
instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Ο R) :=
Pi.addCommMonoid
instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Ο R) :=
Pi.addCommGroup
instance [Nontrivial R] : Nontrivial (MvPowerSeries Ο R) :=
Function.nontrivial
instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Ο A) :=
Pi.module _ _ _
instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S]
[IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Ο A) :=
Pi.isScalarTower
section Semiring
variable (R) [Semiring R]
def monomial (n : Ο ββ β) : R ββ[R] MvPowerSeries Ο R :=
letI := Classical.decEq Ο
LinearMap.stdBasis R (fun _ β¦ R) n
#align mv_power_series.monomial MvPowerSeries.monomial
def coeff (n : Ο ββ β) : MvPowerSeries Ο R ββ[R] R :=
LinearMap.proj n
#align mv_power_series.coeff MvPowerSeries.coeff
variable {R}
@[ext]
theorem ext {Ο Ο} (h : β n : Ο ββ β, coeff R n Ο = coeff R n Ο) : Ο = Ο :=
funext h
#align mv_power_series.ext MvPowerSeries.ext
theorem ext_iff {Ο Ο : MvPowerSeries Ο R} : Ο = Ο β β n : Ο ββ β, coeff R n Ο = coeff R n Ο :=
Function.funext_iff
#align mv_power_series.ext_iff MvPowerSeries.ext_iff
theorem monomial_def [DecidableEq Ο] (n : Ο ββ β) :
(monomial R n) = LinearMap.stdBasis R (fun _ β¦ R) n := by
rw [monomial]
-- unify the `Decidable` arguments
convert rfl
#align mv_power_series.monomial_def MvPowerSeries.monomial_def
| Mathlib/RingTheory/MvPowerSeries/Basic.lean | 134 | 140 | theorem coeff_monomial [DecidableEq Ο] (m n : Ο ββ β) (a : R) :
coeff R m (monomial R n a) = if m = n then a else 0 := by |
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [coeff, monomial_def, LinearMap.proj_apply (i := m)]
dsimp only
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply]
| [
" monomial R n = LinearMap.stdBasis R (fun x => R) n",
" LinearMap.stdBasis R (fun x => R) n = LinearMap.stdBasis R (fun x => R) n",
" (coeff R m) ((monomial R n) a) = if m = n then a else 0",
" (LinearMap.stdBasis R (fun x => R) n) a m = if m = n then a else 0"
] | [
" monomial R n = LinearMap.stdBasis R (fun x => R) n",
" LinearMap.stdBasis R (fun x => R) n = LinearMap.stdBasis R (fun x => R) n",
" (coeff R m) ((monomial R n) a) = if m = n then a else 0"
] |
import Mathlib.Tactic.Ring.Basic
import Mathlib.Tactic.TryThis
import Mathlib.Tactic.Conv
import Mathlib.Util.Qq
set_option autoImplicit true
-- In this file we would like to be able to use multi-character auto-implicits.
set_option relaxedAutoImplicit true
namespace Mathlib.Tactic
open Lean hiding Rat
open Qq Meta
namespace RingNF
open Ring
inductive RingMode where
| SOP
| raw
deriving Inhabited, BEq, Repr
structure Config where
red := TransparencyMode.reducible
recursive := true
mode := RingMode.SOP
deriving Inhabited, BEq, Repr
declare_config_elab elabConfig Config
structure Context where
ctx : Simp.Context
simp : Simp.Result β SimpM Simp.Result
abbrev M := ReaderT Context AtomM
def rewrite (parent : Expr) (root := true) : M Simp.Result :=
fun nctx rctx s β¦ do
let pre : Simp.Simproc := fun e =>
try
guard <| root || parent != e -- recursion guard
let e β withReducible <| whnf e
guard e.isApp -- all interesting ring expressions are applications
let β¨u, Ξ±, eβ© β inferTypeQ' e
let sΞ± β synthInstanceQ (q(CommSemiring $Ξ±) : Q(Type u))
let c β mkCache sΞ±
let β¨a, _, paβ© β match β isAtomOrDerivable sΞ± c e rctx s with
| none => eval sΞ± c e rctx s -- `none` indicates that `eval` will find something algebraic.
| some none => failure -- No point rewriting atoms
| some (some r) => pure r -- Nothing algebraic for `eval` to use, but `norm_num` simplifies.
let r β nctx.simp { expr := a, proof? := pa }
if β withReducible <| isDefEq r.expr e then return .done { expr := r.expr }
pure (.done r)
catch _ => pure <| .continue
let post := Simp.postDefault #[]
(Β·.1) <$> Simp.main parent nctx.ctx (methods := { pre, post })
variable [CommSemiring R]
theorem add_assoc_rev (a b c : R) : a + (b + c) = a + b + c := (add_assoc ..).symm
theorem mul_assoc_rev (a b c : R) : a * (b * c) = a * b * c := (mul_assoc ..).symm
| Mathlib/Tactic/Ring/RingNF.lean | 118 | 118 | theorem mul_neg {R} [Ring R] (a b : R) : a * -b = -(a * b) := by | simp
| [
" a * -b = -(a * b)"
] | [
" a * -b = -(a * b)"
] |
import Mathlib.Probability.ProbabilityMassFunction.Constructions
import Mathlib.Tactic.FinCases
namespace PMF
open ENNReal
noncomputable
def binomial (p : ββ₯0β) (h : p β€ 1) (n : β) : PMF (Fin (n + 1)) :=
.ofFintype (fun i => p^(i : β) * (1-p)^((Fin.last n - i) : β) * (n.choose i : β)) (by
convert (add_pow p (1-p) n).symm
Β· rw [Finset.sum_fin_eq_sum_range]
apply Finset.sum_congr rfl
intro i hi
rw [Finset.mem_range] at hi
rw [dif_pos hi, Fin.last]
Β· simp [h])
theorem binomial_apply (p : ββ₯0β) (h : p β€ 1) (n : β) (i : Fin (n + 1)) :
binomial p h n i = p^(i : β) * (1-p)^((Fin.last n - i) : β) * (n.choose i : β) := rfl
@[simp]
theorem binomial_apply_zero (p : ββ₯0β) (h : p β€ 1) (n : β) :
binomial p h n 0 = (1-p)^n := by
simp [binomial_apply]
@[simp]
theorem binomial_apply_last (p : ββ₯0β) (h : p β€ 1) (n : β) :
binomial p h n (.last n) = p^n := by
simp [binomial_apply]
theorem binomial_apply_self (p : ββ₯0β) (h : p β€ 1) (n : β) :
binomial p h n n = p^n := by simp
| Mathlib/Probability/ProbabilityMassFunction/Binomial.lean | 53 | 55 | theorem binomial_one_eq_bernoulli (p : ββ₯0β) (h : p β€ 1) :
binomial p h 1 = (bernoulli p h).map (cond Β· 1 0) := by |
ext i; fin_cases i <;> simp [tsum_bool, binomial_apply]
| [
" β a : Fin (n + 1), (fun i => p ^ βi * (1 - p) ^ (β(Fin.last n) - βi) * β(n.choose βi)) a = 1",
" β a : Fin (n + 1), (fun i => p ^ βi * (1 - p) ^ (β(Fin.last n) - βi) * β(n.choose βi)) a =\n β m β Finset.range (n + 1), p ^ m * (1 - p) ^ (n - m) * β(n.choose m)",
" (β i β Finset.range (n + 1),\n if h : ... | [
" β a : Fin (n + 1), (fun i => p ^ βi * (1 - p) ^ (β(Fin.last n) - βi) * β(n.choose βi)) a = 1",
" β a : Fin (n + 1), (fun i => p ^ βi * (1 - p) ^ (β(Fin.last n) - βi) * β(n.choose βi)) a =\n β m β Finset.range (n + 1), p ^ m * (1 - p) ^ (n - m) * β(n.choose m)",
" (β i β Finset.range (n + 1),\n if h : ... |
import Mathlib.SetTheory.Ordinal.Arithmetic
import Mathlib.Tactic.TFAE
import Mathlib.Topology.Order.Monotone
#align_import set_theory.ordinal.topology from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da"
noncomputable section
universe u v
open Cardinal Order Topology
namespace Ordinal
variable {s : Set Ordinal.{u}} {a : Ordinal.{u}}
instance : TopologicalSpace Ordinal.{u} := Preorder.topology Ordinal.{u}
instance : OrderTopology Ordinal.{u} := β¨rflβ©
theorem isOpen_singleton_iff : IsOpen ({a} : Set Ordinal) β Β¬IsLimit a := by
refine β¨fun h β¨hβ, hsuccβ© => ?_, fun ha => ?_β©
Β· obtain β¨b, c, hbc, hbc'β© :=
(mem_nhds_iff_exists_Ioo_subset' β¨0, Ordinal.pos_iff_ne_zero.2 hββ© β¨_, lt_succ aβ©).1
(h.mem_nhds rfl)
have hba := hsucc b hbc.1
exact hba.ne (hbc' β¨lt_succ b, hba.trans hbc.2β©)
Β· rcases zero_or_succ_or_limit a with (rfl | β¨b, rflβ© | ha')
Β· rw [β bot_eq_zero, β Set.Iic_bot, β Iio_succ]
exact isOpen_Iio
Β· rw [β Set.Icc_self, Icc_succ_left, β Ioo_succ_right]
exact isOpen_Ioo
Β· exact (ha ha').elim
#align ordinal.is_open_singleton_iff Ordinal.isOpen_singleton_iff
-- Porting note (#11215): TODO: generalize to a `SuccOrder`
theorem nhds_right' (a : Ordinal) : π[>] a = β₯ := (covBy_succ a).nhdsWithin_Ioi
-- todo: generalize to a `SuccOrder`
| Mathlib/SetTheory/Ordinal/Topology.lean | 60 | 61 | theorem nhds_left'_eq_nhds_ne (a : Ordinal) : π[<] a = π[β ] a := by |
rw [β nhds_left'_sup_nhds_right', nhds_right', sup_bot_eq]
| [
" IsOpen {a} β Β¬a.IsLimit",
" False",
" IsOpen {a}",
" IsOpen {0}",
" IsOpen (Set.Iio (succ β₯))",
" IsOpen {succ b}",
" IsOpen (Set.Ioo b (succ (succ b)))",
" π[<] a = π[β ] a"
] | [
" IsOpen {a} β Β¬a.IsLimit",
" False",
" IsOpen {a}",
" IsOpen {0}",
" IsOpen (Set.Iio (succ β₯))",
" IsOpen {succ b}",
" IsOpen (Set.Ioo b (succ (succ b)))",
" π[<] a = π[β ] a"
] |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.canonicalEmbedding
open NumberField
def _root_.NumberField.canonicalEmbedding : K β+* ((K β+* β) β β) := Pi.ringHom fun Ο => Ο
theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
Function.Injective (NumberField.canonicalEmbedding K) := RingHom.injective _
variable {K}
@[simp]
theorem apply_at (Ο : K β+* β) (x : K) : (NumberField.canonicalEmbedding K x) Ο = Ο x := rfl
open scoped ComplexConjugate
theorem conj_apply {x : ((K β+* β) β β)} (Ο : K β+* β)
(hx : x β Submodule.span β (Set.range (canonicalEmbedding K))) :
conj (x Ο) = x (ComplexEmbedding.conjugate Ο) := by
refine Submodule.span_induction hx ?_ ?_ (fun _ _ hx hy => ?_) (fun a _ hx => ?_)
Β· rintro _ β¨x, rflβ©
rw [apply_at, apply_at, ComplexEmbedding.conjugate_coe_eq]
Β· rw [Pi.zero_apply, Pi.zero_apply, map_zero]
Β· rw [Pi.add_apply, Pi.add_apply, map_add, hx, hy]
Β· rw [Pi.smul_apply, Complex.real_smul, map_mul, Complex.conj_ofReal]
exact congrArg ((a : β) * Β·) hx
theorem nnnorm_eq [NumberField K] (x : K) :
βcanonicalEmbedding K xββ = Finset.univ.sup (fun Ο : K β+* β => βΟ xββ) := by
simp_rw [Pi.nnnorm_def, apply_at]
theorem norm_le_iff [NumberField K] (x : K) (r : β) :
βcanonicalEmbedding K xβ β€ r β β Ο : K β+* β, βΟ xβ β€ r := by
obtain hr | hr := lt_or_le r 0
Β· obtain β¨Οβ© := (inferInstance : Nonempty (K β+* β))
refine iff_of_false ?_ ?_
Β· exact (hr.trans_le (norm_nonneg _)).not_le
Β· exact fun h => hr.not_le (le_trans (norm_nonneg _) (h Ο))
Β· lift r to NNReal using hr
simp_rw [β coe_nnnorm, nnnorm_eq, NNReal.coe_le_coe, Finset.sup_le_iff, Finset.mem_univ,
forall_true_left]
variable (K)
def integerLattice : Subring ((K β+* β) β β) :=
(RingHom.range (algebraMap (π K) K)).map (canonicalEmbedding K)
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 93 | 105 | theorem integerLattice.inter_ball_finite [NumberField K] (r : β) :
((integerLattice K : Set ((K β+* β) β β)) β© Metric.closedBall 0 r).Finite := by |
obtain hr | _ := lt_or_le r 0
Β· simp [Metric.closedBall_eq_empty.2 hr]
Β· have heq : β x, canonicalEmbedding K x β Metric.closedBall 0 r β
β Ο : K β+* β, βΟ xβ β€ r := by
intro x; rw [β norm_le_iff, mem_closedBall_zero_iff]
convert (Embeddings.finite_of_norm_le K β r).image (canonicalEmbedding K)
ext; constructor
Β· rintro β¨β¨_, β¨x, rflβ©, rflβ©, hxβ©
exact β¨x, β¨SetLike.coe_mem x, fun Ο => (heq _).mp hx Οβ©, rflβ©
Β· rintro β¨x, β¨hx1, hx2β©, rflβ©
exact β¨β¨x, β¨β¨x, hx1β©, rflβ©, rflβ©, (heq x).mpr hx2β©
| [
" (starRingEnd β) (x Ο) = x (ComplexEmbedding.conjugate Ο)",
" β x β Set.range β(canonicalEmbedding K), (starRingEnd β) (x Ο) = x (ComplexEmbedding.conjugate Ο)",
" (starRingEnd β) ((canonicalEmbedding K) x Ο) = (canonicalEmbedding K) x (ComplexEmbedding.conjugate Ο)",
" (starRingEnd β) (0 Ο) = 0 (ComplexEmbe... | [
" (starRingEnd β) (x Ο) = x (ComplexEmbedding.conjugate Ο)",
" β x β Set.range β(canonicalEmbedding K), (starRingEnd β) (x Ο) = x (ComplexEmbedding.conjugate Ο)",
" (starRingEnd β) ((canonicalEmbedding K) x Ο) = (canonicalEmbedding K) x (ComplexEmbedding.conjugate Ο)",
" (starRingEnd β) (0 Ο) = 0 (ComplexEmbe... |
import Mathlib.Data.Vector.Basic
#align_import data.vector.mem from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
namespace Vector
variable {Ξ± Ξ² : Type*} {n : β} (a a' : Ξ±)
@[simp]
theorem get_mem (i : Fin n) (v : Vector Ξ± n) : v.get i β v.toList := by
rw [get_eq_get]
exact List.get_mem _ _ _
#align vector.nth_mem Vector.get_mem
theorem mem_iff_get (v : Vector Ξ± n) : a β v.toList β β i, v.get i = a := by
simp only [List.mem_iff_get, Fin.exists_iff, Vector.get_eq_get]
exact
β¨fun β¨i, hi, hβ© => β¨i, by rwa [toList_length] at hi, hβ©, fun β¨i, hi, hβ© =>
β¨i, by rwa [toList_length], hβ©β©
#align vector.mem_iff_nth Vector.mem_iff_get
theorem not_mem_nil : a β (Vector.nil : Vector Ξ± 0).toList := by
unfold Vector.nil
dsimp
simp
#align vector.not_mem_nil Vector.not_mem_nil
theorem not_mem_zero (v : Vector Ξ± 0) : a β v.toList :=
(Vector.eq_nil v).symm βΈ not_mem_nil a
#align vector.not_mem_zero Vector.not_mem_zero
theorem mem_cons_iff (v : Vector Ξ± n) : a' β (a ::α΅₯ v).toList β a' = a β¨ a' β v.toList := by
rw [Vector.toList_cons, List.mem_cons]
#align vector.mem_cons_iff Vector.mem_cons_iff
theorem mem_succ_iff (v : Vector Ξ± (n + 1)) : a β v.toList β a = v.head β¨ a β v.tail.toList := by
obtain β¨a', v', hβ© := exists_eq_cons v
simp_rw [h, Vector.mem_cons_iff, Vector.head_cons, Vector.tail_cons]
#align vector.mem_succ_iff Vector.mem_succ_iff
theorem mem_cons_self (v : Vector Ξ± n) : a β (a ::α΅₯ v).toList :=
(Vector.mem_iff_get a (a ::α΅₯ v)).2 β¨0, Vector.get_cons_zero a vβ©
#align vector.mem_cons_self Vector.mem_cons_self
@[simp]
theorem head_mem (v : Vector Ξ± (n + 1)) : v.head β v.toList :=
(Vector.mem_iff_get v.head v).2 β¨0, Vector.get_zero vβ©
#align vector.head_mem Vector.head_mem
theorem mem_cons_of_mem (v : Vector Ξ± n) (ha' : a' β v.toList) : a' β (a ::α΅₯ v).toList :=
(Vector.mem_cons_iff a a' v).2 (Or.inr ha')
#align vector.mem_cons_of_mem Vector.mem_cons_of_mem
| Mathlib/Data/Vector/Mem.lean | 70 | 73 | theorem mem_of_mem_tail (v : Vector Ξ± n) (ha : a β v.tail.toList) : a β v.toList := by |
induction' n with n _
Β· exact False.elim (Vector.not_mem_zero a v.tail ha)
Β· exact (mem_succ_iff a v).2 (Or.inr ha)
| [
" v.get i β v.toList",
" v.toList.get (Fin.cast β― i) β v.toList",
" a β v.toList β β i, v.get i = a",
" (β i, β (h : i < v.toList.length), v.toList.get β¨i, hβ© = a) β β i, β (h : i < n), v.toList.get (Fin.cast β― β¨i, hβ©) = a",
" i < n",
" i < v.toList.length",
" a β nil.toList",
" a β toList β¨[], β―β©",
... | [
" v.get i β v.toList",
" v.toList.get (Fin.cast β― i) β v.toList",
" a β v.toList β β i, v.get i = a",
" (β i, β (h : i < v.toList.length), v.toList.get β¨i, hβ© = a) β β i, β (h : i < n), v.toList.get (Fin.cast β― β¨i, hβ©) = a",
" i < n",
" i < v.toList.length",
" a β nil.toList",
" a β toList β¨[], β―β©",
... |
import Mathlib.Control.Bitraversable.Basic
#align_import control.bitraversable.lemmas from "leanprover-community/mathlib"@"58581d0fe523063f5651df0619be2bf65012a94a"
universe u
variable {t : Type u β Type u β Type u} [Bitraversable t]
variable {Ξ² : Type u}
namespace Bitraversable
open Functor LawfulApplicative
variable {F G : Type u β Type u} [Applicative F] [Applicative G]
abbrev tfst {Ξ± Ξ±'} (f : Ξ± β F Ξ±') : t Ξ± Ξ² β F (t Ξ±' Ξ²) :=
bitraverse f pure
#align bitraversable.tfst Bitraversable.tfst
abbrev tsnd {Ξ± Ξ±'} (f : Ξ± β F Ξ±') : t Ξ² Ξ± β F (t Ξ² Ξ±') :=
bitraverse pure f
#align bitraversable.tsnd Bitraversable.tsnd
variable [LawfulBitraversable t] [LawfulApplicative F] [LawfulApplicative G]
@[higher_order tfst_id]
theorem id_tfst : β {Ξ± Ξ²} (x : t Ξ± Ξ²), tfst (F := Id) pure x = pure x :=
id_bitraverse
#align bitraversable.id_tfst Bitraversable.id_tfst
@[higher_order tsnd_id]
theorem id_tsnd : β {Ξ± Ξ²} (x : t Ξ± Ξ²), tsnd (F := Id) pure x = pure x :=
id_bitraverse
#align bitraversable.id_tsnd Bitraversable.id_tsnd
@[higher_order tfst_comp_tfst]
theorem comp_tfst {Ξ±β Ξ±β Ξ±β Ξ²} (f : Ξ±β β F Ξ±β) (f' : Ξ±β β G Ξ±β) (x : t Ξ±β Ξ²) :
Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk β map f' β f) x := by
rw [β comp_bitraverse]
simp only [Function.comp, tfst, map_pure, Pure.pure]
#align bitraversable.comp_tfst Bitraversable.comp_tfst
@[higher_order tfst_comp_tsnd]
theorem tfst_tsnd {Ξ±β Ξ±β Ξ²β Ξ²β} (f : Ξ±β β F Ξ±β) (f' : Ξ²β β G Ξ²β) (x : t Ξ±β Ξ²β) :
Comp.mk (tfst f <$> tsnd f' x)
= bitraverse (Comp.mk β pure β f) (Comp.mk β map pure β f') x := by
rw [β comp_bitraverse]
simp only [Function.comp, map_pure]
#align bitraversable.tfst_tsnd Bitraversable.tfst_tsnd
@[higher_order tsnd_comp_tfst]
| Mathlib/Control/Bitraversable/Lemmas.lean | 87 | 91 | theorem tsnd_tfst {Ξ±β Ξ±β Ξ²β Ξ²β} (f : Ξ±β β F Ξ±β) (f' : Ξ²β β G Ξ²β) (x : t Ξ±β Ξ²β) :
Comp.mk (tsnd f' <$> tfst f x)
= bitraverse (Comp.mk β map pure β f) (Comp.mk β pure β f') x := by |
rw [β comp_bitraverse]
simp only [Function.comp, map_pure]
| [
" Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk β map f' β f) x",
" bitraverse (Comp.mk β map f' β f) (Comp.mk β map pure β pure) x = tfst (Comp.mk β map f' β f) x",
" Comp.mk (tfst f <$> tsnd f' x) = bitraverse (Comp.mk β pure β f) (Comp.mk β map pure β f') x",
" bitraverse (Comp.mk β map f β pure) (Comp.mk... | [
" Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk β map f' β f) x",
" bitraverse (Comp.mk β map f' β f) (Comp.mk β map pure β pure) x = tfst (Comp.mk β map f' β f) x",
" Comp.mk (tfst f <$> tsnd f' x) = bitraverse (Comp.mk β pure β f) (Comp.mk β map pure β f') x",
" bitraverse (Comp.mk β map f β pure) (Comp.mk... |
import Mathlib.Algebra.Homology.Homotopy
import Mathlib.Algebra.Homology.Linear
import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy
import Mathlib.CategoryTheory.Quotient.Linear
import Mathlib.CategoryTheory.Quotient.Preadditive
#align_import algebra.homology.homotopy_category from "leanprover-community/mathlib"@"13ff898b0eee75d3cc75d1c06a491720eaaf911d"
universe v u
open scoped Classical
noncomputable section
open CategoryTheory CategoryTheory.Limits HomologicalComplex
variable {R : Type*} [Semiring R]
{ΞΉ : Type*} (V : Type u) [Category.{v} V] [Preadditive V] (c : ComplexShape ΞΉ)
def homotopic : HomRel (HomologicalComplex V c) := fun _ _ f g => Nonempty (Homotopy f g)
#align homotopic homotopic
instance homotopy_congruence : Congruence (homotopic V c) where
equivalence :=
{ refl := fun C => β¨Homotopy.refl Cβ©
symm := fun β¨wβ© => β¨w.symmβ©
trans := fun β¨wββ© β¨wββ© => β¨wβ.trans wββ© }
compLeft := fun _ _ _ β¨iβ© => β¨i.compLeft _β©
compRight := fun _ β¨iβ© => β¨i.compRight _β©
#align homotopy_congruence homotopy_congruence
def HomotopyCategory :=
CategoryTheory.Quotient (homotopic V c)
#align homotopy_category HomotopyCategory
instance : Category (HomotopyCategory V c) := by
dsimp only [HomotopyCategory]
infer_instance
-- TODO the homotopy_category is preadditive
namespace HomotopyCategory
instance : Preadditive (HomotopyCategory V c) := Quotient.preadditive _ (by
rintro _ _ _ _ _ _ β¨hβ© β¨h'β©
exact β¨Homotopy.add h h'β©)
def quotient : HomologicalComplex V c β₯€ HomotopyCategory V c :=
CategoryTheory.Quotient.functor _
#align homotopy_category.quotient HomotopyCategory.quotient
instance : (quotient V c).Full := Quotient.full_functor _
instance : (quotient V c).EssSurj := Quotient.essSurj_functor _
instance : (quotient V c).Additive where
instance : Preadditive (CategoryTheory.Quotient (homotopic V c)) :=
(inferInstance : Preadditive (HomotopyCategory V c))
instance : Functor.Additive (Quotient.functor (homotopic V c)) where
instance [Linear R V] : Linear R (HomotopyCategory V c) :=
Quotient.linear R (homotopic V c) (fun _ _ _ _ _ h => β¨h.some.smul _β©)
instance [Linear R V] : Functor.Linear R (HomotopyCategory.quotient V c) :=
Quotient.linear_functor _ _ _
open ZeroObject
instance [HasZeroObject V] : Inhabited (HomotopyCategory V c) :=
β¨(quotient V c).obj 0β©
instance [HasZeroObject V] : HasZeroObject (HomotopyCategory V c) :=
β¨(quotient V c).obj 0, by
rw [IsZero.iff_id_eq_zero, β (quotient V c).map_id, id_zero, Functor.map_zero]β©
instance {D : Type*} [Category D] : ((whiskeringLeft _ _ D).obj (quotient V c)).Full :=
Quotient.full_whiskeringLeft_functor _ _
instance {D : Type*} [Category D] : ((whiskeringLeft _ _ D).obj (quotient V c)).Faithful :=
Quotient.faithful_whiskeringLeft_functor _ _
variable {V c}
-- Porting note: removed @[simp] attribute because it hinders the automatic application of the
-- more useful `quotient_map_out`
theorem quotient_obj_as (C : HomologicalComplex V c) : ((quotient V c).obj C).as = C :=
rfl
#align homotopy_category.quotient_obj_as HomotopyCategory.quotient_obj_as
@[simp]
theorem quotient_map_out {C D : HomotopyCategory V c} (f : C βΆ D) : (quotient V c).map f.out = f :=
Quot.out_eq _
#align homotopy_category.quotient_map_out HomotopyCategory.quotient_map_out
-- Porting note: added to ease the port
theorem quot_mk_eq_quotient_map {C D : HomologicalComplex V c} (f : C βΆ D) :
Quot.mk _ f = (quotient V c).map f := rfl
theorem eq_of_homotopy {C D : HomologicalComplex V c} (f g : C βΆ D) (h : Homotopy f g) :
(quotient V c).map f = (quotient V c).map g :=
CategoryTheory.Quotient.sound _ β¨hβ©
#align homotopy_category.eq_of_homotopy HomotopyCategory.eq_of_homotopy
def homotopyOfEq {C D : HomologicalComplex V c} (f g : C βΆ D)
(w : (quotient V c).map f = (quotient V c).map g) : Homotopy f g :=
((Quotient.functor_map_eq_iff _ _ _).mp w).some
#align homotopy_category.homotopy_of_eq HomotopyCategory.homotopyOfEq
def homotopyOutMap {C D : HomologicalComplex V c} (f : C βΆ D) :
Homotopy ((quotient V c).map f).out f := by
apply homotopyOfEq
simp
#align homotopy_category.homotopy_out_map HomotopyCategory.homotopyOutMap
@[simp 1100]
| Mathlib/Algebra/Homology/HomotopyCategory.lean | 138 | 139 | theorem quotient_map_out_comp_out {C D E : HomotopyCategory V c} (f : C βΆ D) (g : D βΆ E) :
(quotient V c).map (Quot.out f β« Quot.out g) = f β« g := by | simp
| [
" Category.{?u.1707, max (max u v) u_2} (HomotopyCategory V c)",
" Category.{?u.1707, max (max u v) u_2} (CategoryTheory.Quotient (homotopic V c))",
" β β¦X Y : HomologicalComplex V cβ¦ (fβ fβ gβ gβ : X βΆ Y),\n homotopic V c fβ fβ β homotopic V c gβ gβ β homotopic V c (fβ + gβ) (fβ + gβ)",
" homotopic V c (f... | [
" Category.{?u.1707, max (max u v) u_2} (HomotopyCategory V c)",
" Category.{?u.1707, max (max u v) u_2} (CategoryTheory.Quotient (homotopic V c))",
" β β¦X Y : HomologicalComplex V cβ¦ (fβ fβ gβ gβ : X βΆ Y),\n homotopic V c fβ fβ β homotopic V c gβ gβ β homotopic V c (fβ + gβ) (fβ + gβ)",
" homotopic V c (f... |
import Mathlib.Data.Fin.Tuple.Basic
import Mathlib.Data.List.Join
#align_import data.list.of_fn from "leanprover-community/mathlib"@"bf27744463e9620ca4e4ebe951fe83530ae6949b"
universe u
variable {Ξ± : Type u}
open Nat
namespace List
#noalign list.length_of_fn_aux
@[simp]
theorem length_ofFn_go {n} (f : Fin n β Ξ±) (i j h) : length (ofFn.go f i j h) = i := by
induction i generalizing j <;> simp_all [ofFn.go]
@[simp]
| Mathlib/Data/List/OfFn.lean | 44 | 45 | theorem length_ofFn {n} (f : Fin n β Ξ±) : length (ofFn f) = n := by |
simp [ofFn, length_ofFn_go]
| [
" (ofFn.go f i j h).length = i",
" (ofFn.go f 0 j h).length = 0",
" (ofFn.go f (nβ + 1) j h).length = nβ + 1",
" (ofFn f).length = n"
] | [
" (ofFn.go f i j h).length = i",
" (ofFn.go f 0 j h).length = 0",
" (ofFn.go f (nβ + 1) j h).length = nβ + 1",
" (ofFn f).length = n"
] |
import Mathlib.Order.Cover
import Mathlib.Order.Interval.Finset.Defs
#align_import data.finset.locally_finite from "leanprover-community/mathlib"@"442a83d738cb208d3600056c489be16900ba701d"
assert_not_exists MonoidWithZero
assert_not_exists Finset.sum
open Function OrderDual
open FinsetInterval
variable {ΞΉ Ξ± : Type*}
namespace Finset
section Preorder
variable [Preorder Ξ±]
section LocallyFiniteOrder
variable [LocallyFiniteOrder Ξ±] {a aβ aβ b bβ bβ c x : Ξ±}
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Icc : (Icc a b).Nonempty β a β€ b := by
rw [β coe_nonempty, coe_Icc, Set.nonempty_Icc]
#align finset.nonempty_Icc Finset.nonempty_Icc
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Ico : (Ico a b).Nonempty β a < b := by
rw [β coe_nonempty, coe_Ico, Set.nonempty_Ico]
#align finset.nonempty_Ico Finset.nonempty_Ico
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Ioc : (Ioc a b).Nonempty β a < b := by
rw [β coe_nonempty, coe_Ioc, Set.nonempty_Ioc]
#align finset.nonempty_Ioc Finset.nonempty_Ioc
-- TODO: This is nonsense. A locally finite order is never densely ordered
@[simp]
theorem nonempty_Ioo [DenselyOrdered Ξ±] : (Ioo a b).Nonempty β a < b := by
rw [β coe_nonempty, coe_Ioo, Set.nonempty_Ioo]
#align finset.nonempty_Ioo Finset.nonempty_Ioo
@[simp]
theorem Icc_eq_empty_iff : Icc a b = β
β Β¬a β€ b := by
rw [β coe_eq_empty, coe_Icc, Set.Icc_eq_empty_iff]
#align finset.Icc_eq_empty_iff Finset.Icc_eq_empty_iff
@[simp]
theorem Ico_eq_empty_iff : Ico a b = β
β Β¬a < b := by
rw [β coe_eq_empty, coe_Ico, Set.Ico_eq_empty_iff]
#align finset.Ico_eq_empty_iff Finset.Ico_eq_empty_iff
@[simp]
theorem Ioc_eq_empty_iff : Ioc a b = β
β Β¬a < b := by
rw [β coe_eq_empty, coe_Ioc, Set.Ioc_eq_empty_iff]
#align finset.Ioc_eq_empty_iff Finset.Ioc_eq_empty_iff
-- TODO: This is nonsense. A locally finite order is never densely ordered
@[simp]
| Mathlib/Order/Interval/Finset/Basic.lean | 94 | 95 | theorem Ioo_eq_empty_iff [DenselyOrdered Ξ±] : Ioo a b = β
β Β¬a < b := by |
rw [β coe_eq_empty, coe_Ioo, Set.Ioo_eq_empty_iff]
| [
" (Icc a b).Nonempty β a β€ b",
" (Ico a b).Nonempty β a < b",
" (Ioc a b).Nonempty β a < b",
" (Ioo a b).Nonempty β a < b",
" Icc a b = β
β Β¬a β€ b",
" Ico a b = β
β Β¬a < b",
" Ioc a b = β
β Β¬a < b",
" Ioo a b = β
β Β¬a < b"
] | [
" (Icc a b).Nonempty β a β€ b",
" (Ico a b).Nonempty β a < b",
" (Ioc a b).Nonempty β a < b",
" (Ioo a b).Nonempty β a < b",
" Icc a b = β
β Β¬a β€ b",
" Ico a b = β
β Β¬a < b",
" Ioc a b = β
β Β¬a < b",
" Ioo a b = β
β Β¬a < b"
] |
import Mathlib.Data.Vector.Basic
import Mathlib.Data.Vector.Snoc
set_option autoImplicit true
namespace Vector
section Fold
section Comm
variable (xs ys : Vector Ξ± n)
| Mathlib/Data/Vector/MapLemmas.lean | 369 | 371 | theorem mapβ_comm (f : Ξ± β Ξ± β Ξ²) (comm : β aβ aβ, f aβ aβ = f aβ aβ) :
mapβ f xs ys = mapβ f ys xs := by |
induction xs, ys using Vector.inductionOnβ <;> simp_all
| [
" mapβ f xs ys = mapβ f ys xs",
" mapβ f nil nil = mapβ f nil nil",
" mapβ f (aβΒΉ ::α΅₯ xβ) (bβ ::α΅₯ yβ) = mapβ f (bβ ::α΅₯ yβ) (aβΒΉ ::α΅₯ xβ)"
] | [
" mapβ f xs ys = mapβ f ys xs"
] |
import Mathlib.Data.Set.Lattice
#align_import data.set.intervals.disjoint from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
universe u v w
variable {ΞΉ : Sort u} {Ξ± : Type v} {Ξ² : Type w}
open Set
open OrderDual (toDual)
namespace Set
section Preorder
variable [Preorder Ξ±] {a b c : Ξ±}
@[simp]
theorem Iic_disjoint_Ioi (h : a β€ b) : Disjoint (Iic a) (Ioi b) :=
disjoint_left.mpr fun _ ha hb => (h.trans_lt hb).not_le ha
#align set.Iic_disjoint_Ioi Set.Iic_disjoint_Ioi
@[simp]
theorem Iio_disjoint_Ici (h : a β€ b) : Disjoint (Iio a) (Ici b) :=
disjoint_left.mpr fun _ ha hb => (h.trans_lt' ha).not_le hb
@[simp]
theorem Iic_disjoint_Ioc (h : a β€ b) : Disjoint (Iic a) (Ioc b c) :=
(Iic_disjoint_Ioi h).mono le_rfl Ioc_subset_Ioi_self
#align set.Iic_disjoint_Ioc Set.Iic_disjoint_Ioc
@[simp]
theorem Ioc_disjoint_Ioc_same : Disjoint (Ioc a b) (Ioc b c) :=
(Iic_disjoint_Ioc le_rfl).mono Ioc_subset_Iic_self le_rfl
#align set.Ioc_disjoint_Ioc_same Set.Ioc_disjoint_Ioc_same
@[simp]
theorem Ico_disjoint_Ico_same : Disjoint (Ico a b) (Ico b c) :=
disjoint_left.mpr fun _ hab hbc => hab.2.not_le hbc.1
#align set.Ico_disjoint_Ico_same Set.Ico_disjoint_Ico_same
@[simp]
theorem Ici_disjoint_Iic : Disjoint (Ici a) (Iic b) β Β¬a β€ b := by
rw [Set.disjoint_iff_inter_eq_empty, Ici_inter_Iic, Icc_eq_empty_iff]
#align set.Ici_disjoint_Iic Set.Ici_disjoint_Iic
@[simp]
theorem Iic_disjoint_Ici : Disjoint (Iic a) (Ici b) β Β¬b β€ a :=
disjoint_comm.trans Ici_disjoint_Iic
#align set.Iic_disjoint_Ici Set.Iic_disjoint_Ici
@[simp]
theorem Ioc_disjoint_Ioi (h : b β€ c) : Disjoint (Ioc a b) (Ioi c) :=
disjoint_left.mpr (fun _ hx hy β¦ (hx.2.trans h).not_lt hy)
theorem Ioc_disjoint_Ioi_same : Disjoint (Ioc a b) (Ioi b) :=
Ioc_disjoint_Ioi le_rfl
@[simp]
theorem iUnion_Iic : β a : Ξ±, Iic a = univ :=
iUnion_eq_univ_iff.2 fun x => β¨x, right_mem_Iicβ©
#align set.Union_Iic Set.iUnion_Iic
@[simp]
theorem iUnion_Ici : β a : Ξ±, Ici a = univ :=
iUnion_eq_univ_iff.2 fun x => β¨x, left_mem_Iciβ©
#align set.Union_Ici Set.iUnion_Ici
@[simp]
theorem iUnion_Icc_right (a : Ξ±) : β b, Icc a b = Ici a := by
simp only [β Ici_inter_Iic, β inter_iUnion, iUnion_Iic, inter_univ]
#align set.Union_Icc_right Set.iUnion_Icc_right
@[simp]
| Mathlib/Order/Interval/Set/Disjoint.lean | 92 | 93 | theorem iUnion_Ioc_right (a : Ξ±) : β b, Ioc a b = Ioi a := by |
simp only [β Ioi_inter_Iic, β inter_iUnion, iUnion_Iic, inter_univ]
| [
" Disjoint (Ici a) (Iic b) β Β¬a β€ b",
" β b, Icc a b = Ici a",
" β b, Ioc a b = Ioi a"
] | [
" Disjoint (Ici a) (Iic b) β Β¬a β€ b",
" β b, Icc a b = Ici a",
" β b, Ioc a b = Ioi a"
] |
import Mathlib.Topology.Order
#align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d"
open Set Filter Function
open TopologicalSpace Topology Filter
variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β Y} {g : Y β Z}
section Inducing
variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]
theorem inducing_induced (f : X β Y) : @Inducing X Y (TopologicalSpace.induced f βΉ_βΊ) _ f :=
@Inducing.mk _ _ (TopologicalSpace.induced f βΉ_βΊ) _ _ rfl
theorem inducing_id : Inducing (@id X) :=
β¨induced_id.symmβ©
#align inducing_id inducing_id
protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) :
Inducing (g β f) :=
β¨by rw [hf.induced, hg.induced, induced_compose]β©
#align inducing.comp Inducing.comp
| Mathlib/Topology/Maps.lean | 69 | 72 | theorem Inducing.of_comp_iff (hg : Inducing g) :
Inducing (g β f) β Inducing f := by |
refine β¨fun h β¦ ?_, hg.compβ©
rw [inducing_iff, hg.induced, induced_compose, h.induced]
| [
" instβΒ² = TopologicalSpace.induced (g β f) instβ",
" Inducing (g β f) β Inducing f",
" Inducing f"
] | [
" instβΒ² = TopologicalSpace.induced (g β f) instβ",
" Inducing (g β f) β Inducing f"
] |
import Mathlib.Analysis.InnerProductSpace.Dual
import Mathlib.Analysis.InnerProductSpace.Orientation
import Mathlib.Data.Complex.Orientation
import Mathlib.Tactic.LinearCombination
#align_import analysis.inner_product_space.two_dim from "leanprover-community/mathlib"@"cd8fafa2fac98e1a67097e8a91ad9901cfde48af"
noncomputable section
open scoped RealInnerProductSpace ComplexConjugate
open FiniteDimensional
lemma FiniteDimensional.of_fact_finrank_eq_two {K V : Type*} [DivisionRing K]
[AddCommGroup V] [Module K V] [Fact (finrank K V = 2)] : FiniteDimensional K V :=
.of_fact_finrank_eq_succ 1
attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two
@[deprecated (since := "2024-02-02")]
alias FiniteDimensional.finiteDimensional_of_fact_finrank_eq_two :=
FiniteDimensional.of_fact_finrank_eq_two
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] [Fact (finrank β E = 2)]
(o : Orientation β E (Fin 2))
namespace Orientation
irreducible_def areaForm : E ββ[β] E ββ[β] β := by
let z : E [β^Fin 0]ββ[β] β ββ[β] β :=
AlternatingMap.constLinearEquivOfIsEmpty.symm
let y : E [β^Fin 1]ββ[β] β ββ[β] E ββ[β] β :=
LinearMap.llcomp β E (E [β^Fin 0]ββ[β] β) β z ββ AlternatingMap.curryLeftLinearMap
exact y ββ AlternatingMap.curryLeftLinearMap (R' := β) o.volumeForm
#align orientation.area_form Orientation.areaForm
local notation "Ο" => o.areaForm
theorem areaForm_to_volumeForm (x y : E) : Ο x y = o.volumeForm ![x, y] := by simp [areaForm]
#align orientation.area_form_to_volume_form Orientation.areaForm_to_volumeForm
@[simp]
theorem areaForm_apply_self (x : E) : Ο x x = 0 := by
rw [areaForm_to_volumeForm]
refine o.volumeForm.map_eq_zero_of_eq ![x, x] ?_ (?_ : (0 : Fin 2) β 1)
Β· simp
Β· norm_num
#align orientation.area_form_apply_self Orientation.areaForm_apply_self
| Mathlib/Analysis/InnerProductSpace/TwoDim.lean | 116 | 121 | theorem areaForm_swap (x y : E) : Ο x y = -Ο y x := by |
simp only [areaForm_to_volumeForm]
convert o.volumeForm.map_swap ![y, x] (_ : (0 : Fin 2) β 1)
Β· ext i
fin_cases i <;> rfl
Β· norm_num
| [
" E ββ[β] E ββ[β] β",
" (o.areaForm x) y = o.volumeForm ![x, y]",
" (o.areaForm x) x = 0",
" o.volumeForm ![x, x] = 0",
" ![x, x] 0 = ![x, x] 1",
" 0 β 1",
" (o.areaForm x) y = -(o.areaForm y) x",
" o.volumeForm ![x, y] = -o.volumeForm ![y, x]",
" ![x, y] = ![y, x] β β(Equiv.swap 0 1)",
" ![x, y] ... | [
" E ββ[β] E ββ[β] β",
" (o.areaForm x) y = o.volumeForm ![x, y]",
" (o.areaForm x) x = 0",
" o.volumeForm ![x, x] = 0",
" ![x, x] 0 = ![x, x] 1",
" 0 β 1",
" (o.areaForm x) y = -(o.areaForm y) x"
] |
import Mathlib.Analysis.SpecialFunctions.JapaneseBracket
import Mathlib.Analysis.SpecialFunctions.Integrals
import Mathlib.MeasureTheory.Group.Integral
import Mathlib.MeasureTheory.Integral.IntegralEqImproper
import Mathlib.MeasureTheory.Measure.Lebesgue.Integral
#align_import analysis.special_functions.improper_integrals from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
open Real Set Filter MeasureTheory intervalIntegral
open scoped Topology
theorem integrableOn_exp_Iic (c : β) : IntegrableOn exp (Iic c) := by
refine
integrableOn_Iic_of_intervalIntegral_norm_bounded (exp c) c
(fun y => intervalIntegrable_exp.1) tendsto_id
(eventually_of_mem (Iic_mem_atBot 0) fun y _ => ?_)
simp_rw [norm_of_nonneg (exp_pos _).le, integral_exp, sub_le_self_iff]
exact (exp_pos _).le
#align integrable_on_exp_Iic integrableOn_exp_Iic
theorem integral_exp_Iic (c : β) : β« x : β in Iic c, exp x = exp c := by
refine
tendsto_nhds_unique
(intervalIntegral_tendsto_integral_Iic _ (integrableOn_exp_Iic _) tendsto_id) ?_
simp_rw [integral_exp, show π (exp c) = π (exp c - 0) by rw [sub_zero]]
exact tendsto_exp_atBot.const_sub _
#align integral_exp_Iic integral_exp_Iic
theorem integral_exp_Iic_zero : β« x : β in Iic 0, exp x = 1 :=
exp_zero βΈ integral_exp_Iic 0
#align integral_exp_Iic_zero integral_exp_Iic_zero
theorem integral_exp_neg_Ioi (c : β) : (β« x : β in Ioi c, exp (-x)) = exp (-c) := by
simpa only [integral_comp_neg_Ioi] using integral_exp_Iic (-c)
#align integral_exp_neg_Ioi integral_exp_neg_Ioi
theorem integral_exp_neg_Ioi_zero : (β« x : β in Ioi 0, exp (-x)) = 1 := by
simpa only [neg_zero, exp_zero] using integral_exp_neg_Ioi 0
#align integral_exp_neg_Ioi_zero integral_exp_neg_Ioi_zero
| Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean | 62 | 73 | theorem integrableOn_Ioi_rpow_of_lt {a : β} (ha : a < -1) {c : β} (hc : 0 < c) :
IntegrableOn (fun t : β => t ^ a) (Ioi c) := by |
have hd : β x β Ici c, HasDerivAt (fun t => t ^ (a + 1) / (a + 1)) (x ^ a) x := by
intro x hx
-- Porting note: helped `convert` with explicit arguments
convert (hasDerivAt_rpow_const (p := a + 1) (Or.inl (hc.trans_le hx).ne')).div_const _ using 1
field_simp [show a + 1 β 0 from ne_of_lt (by linarith), mul_comm]
have ht : Tendsto (fun t => t ^ (a + 1) / (a + 1)) atTop (π (0 / (a + 1))) := by
apply Tendsto.div_const
simpa only [neg_neg] using tendsto_rpow_neg_atTop (by linarith : 0 < -(a + 1))
exact
integrableOn_Ioi_deriv_of_nonneg' hd (fun t ht => rpow_nonneg (hc.trans ht).le a) ht
| [
" IntegrableOn rexp (Iic c) volume",
" β« (x : β) in id y..c, βrexp xβ β€ rexp c",
" 0 β€ rexp (id y)",
" β« (x : β) in Iic c, rexp x = rexp c",
" Tendsto (fun i => β« (x : β) in id i..c, rexp x) atBot (π (rexp c))",
" π (rexp c) = π (rexp c - 0)",
" Tendsto (fun i => rexp c - rexp (id i)) atBot (π (rexp... | [
" IntegrableOn rexp (Iic c) volume",
" β« (x : β) in id y..c, βrexp xβ β€ rexp c",
" 0 β€ rexp (id y)",
" β« (x : β) in Iic c, rexp x = rexp c",
" Tendsto (fun i => β« (x : β) in id i..c, rexp x) atBot (π (rexp c))",
" π (rexp c) = π (rexp c - 0)",
" Tendsto (fun i => rexp c - rexp (id i)) atBot (π (rexp... |
import Mathlib.Analysis.NormedSpace.Star.Spectrum
import Mathlib.Analysis.Normed.Group.Quotient
import Mathlib.Analysis.NormedSpace.Algebra
import Mathlib.Topology.ContinuousFunction.Units
import Mathlib.Topology.ContinuousFunction.Compact
import Mathlib.Topology.Algebra.Algebra
import Mathlib.Topology.ContinuousFunction.Ideals
import Mathlib.Topology.ContinuousFunction.StoneWeierstrass
#align_import analysis.normed_space.star.gelfand_duality from "leanprover-community/mathlib"@"e65771194f9e923a70dfb49b6ca7be6e400d8b6f"
open WeakDual
open scoped NNReal
section ComplexBanachAlgebra
open Ideal
variable {A : Type*} [NormedCommRing A] [NormedAlgebra β A] [CompleteSpace A] (I : Ideal A)
[Ideal.IsMaximal I]
noncomputable def Ideal.toCharacterSpace : characterSpace β A :=
CharacterSpace.equivAlgHom.symm <|
((NormedRing.algEquivComplexOfComplete
(letI := Quotient.field I; isUnit_iff_ne_zero (Gβ := A β§Έ I))).symm : A β§Έ I ββ[β] β).comp <|
Quotient.mkβ β I
#align ideal.to_character_space Ideal.toCharacterSpace
theorem Ideal.toCharacterSpace_apply_eq_zero_of_mem {a : A} (ha : a β I) :
I.toCharacterSpace a = 0 := by
unfold Ideal.toCharacterSpace
simp only [CharacterSpace.equivAlgHom_symm_coe, AlgHom.coe_comp, AlgHom.coe_coe,
Quotient.mkβ_eq_mk, Function.comp_apply, NormedRing.algEquivComplexOfComplete_symm_apply]
simp_rw [Quotient.eq_zero_iff_mem.mpr ha, spectrum.zero_eq]
exact Set.eq_of_mem_singleton (Set.singleton_nonempty (0 : β)).some_mem
#align ideal.to_character_space_apply_eq_zero_of_mem Ideal.toCharacterSpace_apply_eq_zero_of_mem
| Mathlib/Analysis/NormedSpace/Star/GelfandDuality.lean | 99 | 105 | theorem WeakDual.CharacterSpace.exists_apply_eq_zero {a : A} (ha : Β¬IsUnit a) :
β f : characterSpace β A, f a = 0 := by |
obtain β¨M, hM, haMβ© := (span {a}).exists_le_maximal (span_singleton_ne_top ha)
exact
β¨M.toCharacterSpace,
M.toCharacterSpace_apply_eq_zero_of_mem
(haM (mem_span_singleton.mpr β¨1, (mul_one a).symmβ©))β©
| [
" I.toCharacterSpace a = 0",
" (CharacterSpace.equivAlgHom.symm ((β(NormedRing.algEquivComplexOfComplete β―).symm).comp (Quotient.mkβ β I))) a = 0",
" β―.some = 0",
" β f, f a = 0"
] | [
" I.toCharacterSpace a = 0",
" (CharacterSpace.equivAlgHom.symm ((β(NormedRing.algEquivComplexOfComplete β―).symm).comp (Quotient.mkβ β I))) a = 0",
" β―.some = 0",
" β f, f a = 0"
] |
import Mathlib.Data.Matroid.Restrict
variable {Ξ± : Type*} {M : Matroid Ξ±} {E B I X R J : Set Ξ±}
namespace Matroid
open Set
section EmptyOn
def emptyOn (Ξ± : Type*) : Matroid Ξ± where
E := β
Base := (Β· = β
)
Indep := (Β· = β
)
indep_iff' := by simp [subset_empty_iff]
exists_base := β¨β
, rflβ©
base_exchange := by rintro _ _ rfl; simp
maximality := by rintro _ _ _ rfl -; exact β¨β
, by simp [mem_maximals_iff]β©
subset_ground := by simp
@[simp] theorem emptyOn_ground : (emptyOn Ξ±).E = β
:= rfl
@[simp] theorem emptyOn_base_iff : (emptyOn Ξ±).Base B β B = β
:= Iff.rfl
@[simp] theorem emptyOn_indep_iff : (emptyOn Ξ±).Indep I β I = β
:= Iff.rfl
theorem ground_eq_empty_iff : (M.E = β
) β M = emptyOn Ξ± := by
simp only [emptyOn, eq_iff_indep_iff_indep_forall, iff_self_and]
exact fun h β¦ by simp [h, subset_empty_iff]
@[simp] theorem emptyOn_dual_eq : (emptyOn Ξ±)βΆ = emptyOn Ξ± := by
rw [β ground_eq_empty_iff]; rfl
@[simp] theorem restrict_empty (M : Matroid Ξ±) : M βΎ (β
: Set Ξ±) = emptyOn Ξ± := by
simp [β ground_eq_empty_iff]
theorem eq_emptyOn_or_nonempty (M : Matroid Ξ±) : M = emptyOn Ξ± β¨ Matroid.Nonempty M := by
rw [β ground_eq_empty_iff]
exact M.E.eq_empty_or_nonempty.elim Or.inl (fun h β¦ Or.inr β¨hβ©)
| Mathlib/Data/Matroid/Constructions.lean | 71 | 73 | theorem eq_emptyOn [IsEmpty Ξ±] (M : Matroid Ξ±) : M = emptyOn Ξ± := by |
rw [β ground_eq_empty_iff]
exact M.E.eq_empty_of_isEmpty
| [
" β β¦I : Set Ξ±β¦, (fun x => x = β
) I β β B, (fun x => x = β
) B β§ I β B",
" ExchangeProperty fun x => x = β
",
" (fun x => x = β
) Yβ β β a β β
\\ Yβ, β b β Yβ \\ β
, (fun x => x = β
) (insert b (β
\\ {a}))",
" β X β β
, ExistsMaximalSubsetProperty (fun x => x = β
) X",
" (maximals (fun x x_1 => x β x_1) {Y | (fun ... | [
" β β¦I : Set Ξ±β¦, (fun x => x = β
) I β β B, (fun x => x = β
) B β§ I β B",
" ExchangeProperty fun x => x = β
",
" (fun x => x = β
) Yβ β β a β β
\\ Yβ, β b β Yβ \\ β
, (fun x => x = β
) (insert b (β
\\ {a}))",
" β X β β
, ExistsMaximalSubsetProperty (fun x => x = β
) X",
" (maximals (fun x x_1 => x β x_1) {Y | (fun ... |
import Mathlib.CategoryTheory.Limits.Shapes.WideEqualizers
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
#align_import category_theory.limits.constructions.weakly_initial from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a"
universe v u
namespace CategoryTheory
open Limits
variable {C : Type u} [Category.{v} C]
theorem has_weakly_initial_of_weakly_initial_set_and_hasProducts [HasProducts.{v} C] {ΞΉ : Type v}
{B : ΞΉ β C} (hB : β A : C, β i, Nonempty (B i βΆ A)) : β T : C, β X, Nonempty (T βΆ X) :=
β¨βαΆ B, fun X => β¨Pi.Ο _ _ β« (hB X).choose_spec.someβ©β©
#align category_theory.has_weakly_initial_of_weakly_initial_set_and_has_products CategoryTheory.has_weakly_initial_of_weakly_initial_set_and_hasProducts
| Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean | 46 | 64 | theorem hasInitial_of_weakly_initial_and_hasWideEqualizers [HasWideEqualizers.{v} C] {T : C}
(hT : β X, Nonempty (T βΆ X)) : HasInitial C := by |
let endos := T βΆ T
let i := wideEqualizer.ΞΉ (id : endos β endos)
haveI : Nonempty endos := β¨π _β©
have : β X : C, Unique (wideEqualizer (id : endos β endos) βΆ X) := by
intro X
refine β¨β¨i β« Classical.choice (hT X)β©, fun a => ?_β©
let E := equalizer a (i β« Classical.choice (hT _))
let e : E βΆ wideEqualizer id := equalizer.ΞΉ _ _
let h : T βΆ E := Classical.choice (hT E)
have : ((i β« h) β« e) β« i = i β« π _ := by
rw [Category.assoc, Category.assoc]
apply wideEqualizer.condition (id : endos β endos) (h β« e β« i)
rw [Category.comp_id, cancel_mono_id i] at this
haveI : IsSplitEpi e := IsSplitEpi.mk' β¨i β« h, thisβ©
rw [β cancel_epi e]
apply equalizer.condition
exact hasInitial_of_unique (wideEqualizer (id : endos β endos))
| [
" HasInitial C",
" (X : C) β Unique (wideEqualizer id βΆ X)",
" Unique (wideEqualizer id βΆ X)",
" a = default",
" ((i β« h) β« e) β« i = i β« π T",
" i β« h β« e β« i = i β« π T",
" e β« a = e β« default"
] | [
" HasInitial C"
] |
import Mathlib.Data.Set.Defs
import Mathlib.Order.Heyting.Basic
import Mathlib.Order.RelClasses
import Mathlib.Order.Hom.Basic
import Mathlib.Lean.Thunk
set_option autoImplicit true
class EstimatorData (a : Thunk Ξ±) (Ξ΅ : Type*) where
bound : Ξ΅ β Ξ±
improve : Ξ΅ β Option Ξ΅
class Estimator [Preorder Ξ±] (a : Thunk Ξ±) (Ξ΅ : Type*) extends EstimatorData a Ξ΅ where
bound_le e : bound e β€ a.get
improve_spec e : match improve e with
| none => bound e = a.get
| some e' => bound e < bound e'
open EstimatorData Set
section improveUntil
variable [Preorder Ξ±]
attribute [local instance] WellFoundedGT.toWellFoundedRelation in
def Estimator.improveUntilAux
(a : Thunk Ξ±) (p : Ξ± β Bool) [Estimator a Ξ΅]
[WellFoundedGT (range (bound a : Ξ΅ β Ξ±))]
(e : Ξ΅) (r : Bool) : Except (Option Ξ΅) Ξ΅ :=
if p (bound a e) then
return e
else
match improve a e, improve_spec e with
| none, _ => .error <| if r then none else e
| some e', _ =>
improveUntilAux a p e' true
termination_by (β¨_, mem_range_self eβ© : range (bound a))
def Estimator.improveUntil (a : Thunk Ξ±) (p : Ξ± β Bool)
[Estimator a Ξ΅] [WellFoundedGT (range (bound a : Ξ΅ β Ξ±))] (e : Ξ΅) :
Except (Option Ξ΅) Ξ΅ :=
Estimator.improveUntilAux a p e false
attribute [local instance] WellFoundedGT.toWellFoundedRelation in
| Mathlib/Order/Estimator.lean | 126 | 142 | theorem Estimator.improveUntilAux_spec (a : Thunk Ξ±) (p : Ξ± β Bool)
[Estimator a Ξ΅] [WellFoundedGT (range (bound a : Ξ΅ β Ξ±))] (e : Ξ΅) (r : Bool) :
match Estimator.improveUntilAux a p e r with
| .error _ => Β¬ p a.get
| .ok e' => p (bound a e') := by |
rw [Estimator.improveUntilAux]
by_cases h : p (bound a e)
Β· simp only [h]; exact h
Β· simp only [h]
match improve a e, improve_spec e with
| none, eq =>
simp only [Bool.not_eq_true]
rw [eq] at h
exact Bool.bool_eq_false h
| some e', _ =>
exact Estimator.improveUntilAux_spec a p e' true
termination_by (β¨_, mem_range_self eβ© : range (bound a))
| [
" match improveUntilAux a p e r with\n | Except.error a_1 => Β¬p a.get = true\n | Except.ok e' => p (bound a e') = true",
" match\n if p (bound a e) = true then pure e\n else\n match improve a e, β― with\n | none, x => Except.error (if r = true then none else some e)\n | some e', x => improve... | [
" match improveUntilAux a p e r with\n | Except.error a_1 => Β¬p a.get = true\n | Except.ok e' => p (bound a e') = true"
] |
import Mathlib.Data.Nat.Prime
#align_import data.int.nat_prime from "leanprover-community/mathlib"@"422e70f7ce183d2900c586a8cda8381e788a0c62"
open Nat
namespace Int
theorem not_prime_of_int_mul {a b : β€} {c : β} (ha : a.natAbs β 1) (hb : b.natAbs β 1)
(hc : a * b = (c : β€)) : Β¬Nat.Prime c :=
not_prime_mul' (natAbs_mul_natAbs_eq hc) ha hb
#align int.not_prime_of_int_mul Int.not_prime_of_int_mul
| Mathlib/Data/Int/NatPrime.lean | 24 | 33 | theorem succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul {p : β} (p_prime : Nat.Prime p) {m n : β€}
{k l : β} (hpm : β(p ^ k) β£ m) (hpn : β(p ^ l) β£ n) (hpmn : β(p ^ (k + l + 1)) β£ m * n) :
β(p ^ (k + 1)) β£ m β¨ β(p ^ (l + 1)) β£ n :=
have hpm' : p ^ k β£ m.natAbs := Int.natCast_dvd_natCast.1 <| Int.dvd_natAbs.2 hpm
have hpn' : p ^ l β£ n.natAbs := Int.natCast_dvd_natCast.1 <| Int.dvd_natAbs.2 hpn
have hpmn' : p ^ (k + l + 1) β£ m.natAbs * n.natAbs := by |
rw [β Int.natAbs_mul]; apply Int.natCast_dvd_natCast.1 <| Int.dvd_natAbs.2 hpmn
let hsd := Nat.succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul p_prime hpm' hpn' hpmn'
hsd.elim (fun hsd1 => Or.inl (by apply Int.dvd_natAbs.1; apply Int.natCast_dvd_natCast.2 hsd1))
fun hsd2 => Or.inr (by apply Int.dvd_natAbs.1; apply Int.natCast_dvd_natCast.2 hsd2)
| [
" p ^ (k + l + 1) β£ m.natAbs * n.natAbs",
" p ^ (k + l + 1) β£ (m * n).natAbs",
" β(p ^ (k + 1)) β£ m",
" β(p ^ (k + 1)) β£ βm.natAbs",
" β(p ^ (l + 1)) β£ n",
" β(p ^ (l + 1)) β£ βn.natAbs"
] | [
" p ^ (k + l + 1) β£ m.natAbs * n.natAbs"
] |
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Order.Filter.IndicatorFunction
open MeasureTheory
section DominatedConvergenceTheorem
open Set Filter TopologicalSpace ENNReal
open scoped Topology
namespace MeasureTheory
variable {Ξ± E G: Type*}
[NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E]
[NormedAddCommGroup G] [NormedSpace β G]
{f g : Ξ± β E} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±}
theorem tendsto_integral_of_dominated_convergence {F : β β Ξ± β G} {f : Ξ± β G} (bound : Ξ± β β)
(F_measurable : β n, AEStronglyMeasurable (F n) ΞΌ) (bound_integrable : Integrable bound ΞΌ)
(h_bound : β n, βα΅ a βΞΌ, βF n aβ β€ bound a)
(h_lim : βα΅ a βΞΌ, Tendsto (fun n => F n a) atTop (π (f a))) :
Tendsto (fun n => β« a, F n a βΞΌ) atTop (π <| β« a, f a βΞΌ) := by
by_cases hG : CompleteSpace G
Β· simp only [integral, hG, L1.integral]
exact tendsto_setToFun_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul ΞΌ)
bound F_measurable bound_integrable h_bound h_lim
Β· simp [integral, hG]
#align measure_theory.tendsto_integral_of_dominated_convergence MeasureTheory.tendsto_integral_of_dominated_convergence
| Mathlib/MeasureTheory/Integral/DominatedConvergence.lean | 66 | 75 | theorem tendsto_integral_filter_of_dominated_convergence {ΞΉ} {l : Filter ΞΉ} [l.IsCountablyGenerated]
{F : ΞΉ β Ξ± β G} {f : Ξ± β G} (bound : Ξ± β β) (hF_meas : βαΆ n in l, AEStronglyMeasurable (F n) ΞΌ)
(h_bound : βαΆ n in l, βα΅ a βΞΌ, βF n aβ β€ bound a) (bound_integrable : Integrable bound ΞΌ)
(h_lim : βα΅ a βΞΌ, Tendsto (fun n => F n a) l (π (f a))) :
Tendsto (fun n => β« a, F n a βΞΌ) l (π <| β« a, f a βΞΌ) := by |
by_cases hG : CompleteSpace G
Β· simp only [integral, hG, L1.integral]
exact tendsto_setToFun_filter_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul ΞΌ)
bound hF_meas h_bound bound_integrable h_lim
Β· simp [integral, hG, tendsto_const_nhds]
| [
" Tendsto (fun n => β« (a : Ξ±), F n a βΞΌ) atTop (π (β« (a : Ξ±), f a βΞΌ))",
" Tendsto\n (fun n =>\n if h : True then\n if hf : Integrable (fun a => F n a) ΞΌ then L1.integralCLM (Integrable.toL1 (fun a => F n a) hf) else 0\n else 0)\n atTop\n (π\n (if h : True then\n if hf : In... | [
" Tendsto (fun n => β« (a : Ξ±), F n a βΞΌ) atTop (π (β« (a : Ξ±), f a βΞΌ))",
" Tendsto\n (fun n =>\n if h : True then\n if hf : Integrable (fun a => F n a) ΞΌ then L1.integralCLM (Integrable.toL1 (fun a => F n a) hf) else 0\n else 0)\n atTop\n (π\n (if h : True then\n if hf : In... |
import Mathlib.Algebra.EuclideanDomain.Basic
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Algebra.GCDMonoid.Nat
#align_import ring_theory.int.basic from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802"
namespace Int
theorem gcd_eq_one_iff_coprime {a b : β€} : Int.gcd a b = 1 β IsCoprime a b := by
constructor
Β· intro hg
obtain β¨ua, -, haβ© := exists_unit_of_abs a
obtain β¨ub, -, hbβ© := exists_unit_of_abs b
use Nat.gcdA (Int.natAbs a) (Int.natAbs b) * ua, Nat.gcdB (Int.natAbs a) (Int.natAbs b) * ub
rw [mul_assoc, β ha, mul_assoc, β hb, mul_comm, mul_comm _ (Int.natAbs b : β€), β
Nat.gcd_eq_gcd_ab, β gcd_eq_natAbs, hg, Int.ofNat_one]
Β· rintro β¨r, s, hβ©
by_contra hg
obtain β¨p, β¨hp, ha, hbβ©β© := Nat.Prime.not_coprime_iff_dvd.mp hg
apply Nat.Prime.not_dvd_one hp
rw [β natCast_dvd_natCast, Int.ofNat_one, β h]
exact dvd_add ((natCast_dvd.mpr ha).mul_left _) ((natCast_dvd.mpr hb).mul_left _)
#align int.gcd_eq_one_iff_coprime Int.gcd_eq_one_iff_coprime
theorem coprime_iff_nat_coprime {a b : β€} : IsCoprime a b β Nat.Coprime a.natAbs b.natAbs := by
rw [β gcd_eq_one_iff_coprime, Nat.coprime_iff_gcd_eq_one, gcd_eq_natAbs]
#align int.coprime_iff_nat_coprime Int.coprime_iff_nat_coprime
| Mathlib/RingTheory/Int/Basic.lean | 54 | 56 | theorem gcd_ne_one_iff_gcd_mul_right_ne_one {a : β€} {m n : β} :
a.gcd (m * n) β 1 β a.gcd m β 1 β¨ a.gcd n β 1 := by |
simp only [gcd_eq_one_iff_coprime, β not_and_or, not_iff_not, IsCoprime.mul_right_iff]
| [
" a.gcd b = 1 β IsCoprime a b",
" a.gcd b = 1 β IsCoprime a b",
" IsCoprime a b",
" a.natAbs.gcdA b.natAbs * ua * a + a.natAbs.gcdB b.natAbs * ub * b = 1",
" IsCoprime a b β a.gcd b = 1",
" a.gcd b = 1",
" False",
" p β£ 1",
" βp β£ r * a + s * b",
" IsCoprime a b β a.natAbs.Coprime b.natAbs",
" a... | [
" a.gcd b = 1 β IsCoprime a b",
" a.gcd b = 1 β IsCoprime a b",
" IsCoprime a b",
" a.natAbs.gcdA b.natAbs * ua * a + a.natAbs.gcdB b.natAbs * ub * b = 1",
" IsCoprime a b β a.gcd b = 1",
" a.gcd b = 1",
" False",
" p β£ 1",
" βp β£ r * a + s * b",
" IsCoprime a b β a.natAbs.Coprime b.natAbs",
" a... |
import Mathlib.Order.Filter.Basic
#align_import order.filter.prod from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
open Set
open Filter
namespace Filter
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort*}
section Prod
variable {s : Set Ξ±} {t : Set Ξ²} {f : Filter Ξ±} {g : Filter Ξ²}
protected def prod (f : Filter Ξ±) (g : Filter Ξ²) : Filter (Ξ± Γ Ξ²) :=
f.comap Prod.fst β g.comap Prod.snd
#align filter.prod Filter.prod
instance instSProd : SProd (Filter Ξ±) (Filter Ξ²) (Filter (Ξ± Γ Ξ²)) where
sprod := Filter.prod
theorem prod_mem_prod (hs : s β f) (ht : t β g) : s ΓΛ’ t β f ΓΛ’ g :=
inter_mem_inf (preimage_mem_comap hs) (preimage_mem_comap ht)
#align filter.prod_mem_prod Filter.prod_mem_prod
theorem mem_prod_iff {s : Set (Ξ± Γ Ξ²)} {f : Filter Ξ±} {g : Filter Ξ²} :
s β f ΓΛ’ g β β tβ β f, β tβ β g, tβ ΓΛ’ tβ β s := by
simp only [SProd.sprod, Filter.prod]
constructor
Β· rintro β¨tβ, β¨sβ, hsβ, htsββ©, tβ, β¨sβ, hsβ, htsββ©, rflβ©
exact β¨sβ, hsβ, sβ, hsβ, fun p β¨h, h'β© => β¨htsβ h, htsβ h'β©β©
Β· rintro β¨tβ, htβ, tβ, htβ, hβ©
exact mem_inf_of_inter (preimage_mem_comap htβ) (preimage_mem_comap htβ) h
#align filter.mem_prod_iff Filter.mem_prod_iff
@[simp]
theorem prod_mem_prod_iff [f.NeBot] [g.NeBot] : s ΓΛ’ t β f ΓΛ’ g β s β f β§ t β g :=
β¨fun h =>
let β¨_s', hs', _t', ht', Hβ© := mem_prod_iff.1 h
(prod_subset_prod_iff.1 H).elim
(fun β¨hs's, ht'tβ© => β¨mem_of_superset hs' hs's, mem_of_superset ht' ht'tβ©) fun h =>
h.elim (fun hs'e => absurd hs'e (nonempty_of_mem hs').ne_empty) fun ht'e =>
absurd ht'e (nonempty_of_mem ht').ne_empty,
fun h => prod_mem_prod h.1 h.2β©
#align filter.prod_mem_prod_iff Filter.prod_mem_prod_iff
theorem mem_prod_principal {s : Set (Ξ± Γ Ξ²)} :
s β f ΓΛ’ π t β { a | β b β t, (a, b) β s } β f := by
rw [β @exists_mem_subset_iff _ f, mem_prod_iff]
refine exists_congr fun u => Iff.rfl.and β¨?_, fun h => β¨t, mem_principal_self t, ?_β©β©
Β· rintro β¨v, v_in, hvβ© a a_in b b_in
exact hv (mk_mem_prod a_in <| v_in b_in)
Β· rintro β¨x, yβ© β¨hx, hyβ©
exact h hx y hy
#align filter.mem_prod_principal Filter.mem_prod_principal
theorem mem_prod_top {s : Set (Ξ± Γ Ξ²)} :
s β f ΓΛ’ (β€ : Filter Ξ²) β { a | β b, (a, b) β s } β f := by
rw [β principal_univ, mem_prod_principal]
simp only [mem_univ, forall_true_left]
#align filter.mem_prod_top Filter.mem_prod_top
theorem eventually_prod_principal_iff {p : Ξ± Γ Ξ² β Prop} {s : Set Ξ²} :
(βαΆ x : Ξ± Γ Ξ² in f ΓΛ’ π s, p x) β βαΆ x : Ξ± in f, β y : Ξ², y β s β p (x, y) := by
rw [eventually_iff, eventually_iff, mem_prod_principal]
simp only [mem_setOf_eq]
#align filter.eventually_prod_principal_iff Filter.eventually_prod_principal_iff
theorem comap_prod (f : Ξ± β Ξ² Γ Ξ³) (b : Filter Ξ²) (c : Filter Ξ³) :
comap f (b ΓΛ’ c) = comap (Prod.fst β f) b β comap (Prod.snd β f) c := by
erw [comap_inf, Filter.comap_comap, Filter.comap_comap]
#align filter.comap_prod Filter.comap_prod
theorem prod_top : f ΓΛ’ (β€ : Filter Ξ²) = f.comap Prod.fst := by
dsimp only [SProd.sprod]
rw [Filter.prod, comap_top, inf_top_eq]
#align filter.prod_top Filter.prod_top
theorem top_prod : (β€ : Filter Ξ±) ΓΛ’ g = g.comap Prod.snd := by
dsimp only [SProd.sprod]
rw [Filter.prod, comap_top, top_inf_eq]
theorem sup_prod (fβ fβ : Filter Ξ±) (g : Filter Ξ²) : (fβ β fβ) ΓΛ’ g = (fβ ΓΛ’ g) β (fβ ΓΛ’ g) := by
dsimp only [SProd.sprod]
rw [Filter.prod, comap_sup, inf_sup_right, β Filter.prod, β Filter.prod]
#align filter.sup_prod Filter.sup_prod
theorem prod_sup (f : Filter Ξ±) (gβ gβ : Filter Ξ²) : f ΓΛ’ (gβ β gβ) = (f ΓΛ’ gβ) β (f ΓΛ’ gβ) := by
dsimp only [SProd.sprod]
rw [Filter.prod, comap_sup, inf_sup_left, β Filter.prod, β Filter.prod]
#align filter.prod_sup Filter.prod_sup
| Mathlib/Order/Filter/Prod.lean | 131 | 135 | theorem eventually_prod_iff {p : Ξ± Γ Ξ² β Prop} :
(βαΆ x in f ΓΛ’ g, p x) β
β pa : Ξ± β Prop, (βαΆ x in f, pa x) β§ β pb : Ξ² β Prop, (βαΆ y in g, pb y) β§
β {x}, pa x β β {y}, pb y β p (x, y) := by |
simpa only [Set.prod_subset_iff] using @mem_prod_iff Ξ± Ξ² p f g
| [
" s β f ΓΛ’ g β β tβ β f, β tβ β g, tβ ΓΛ’ tβ β s",
" s β comap Prod.fst f β comap Prod.snd g β β tβ β f, β tβ β g, tβ.prod tβ β s",
" s β comap Prod.fst f β comap Prod.snd g β β tβ β f, β tβ β g, tβ.prod tβ β s",
" β tβ_1 β f, β tβ_1 β g, tβ_1.prod tβ_1 β tβ β© tβ",
" (β tβ β f, β tβ β g, tβ.prod tβ β s) β s ... | [
" s β f ΓΛ’ g β β tβ β f, β tβ β g, tβ ΓΛ’ tβ β s",
" s β comap Prod.fst f β comap Prod.snd g β β tβ β f, β tβ β g, tβ.prod tβ β s",
" s β comap Prod.fst f β comap Prod.snd g β β tβ β f, β tβ β g, tβ.prod tβ β s",
" β tβ_1 β f, β tβ_1 β g, tβ_1.prod tβ_1 β tβ β© tβ",
" (β tβ β f, β tβ β g, tβ.prod tβ β s) β s ... |
import Mathlib.Topology.Order.IsLUB
open Set Filter TopologicalSpace Topology Function
open OrderDual (toDual ofDual)
variable {Ξ± Ξ² Ξ³ : Type*}
section DenselyOrdered
variable [TopologicalSpace Ξ±] [LinearOrder Ξ±] [OrderTopology Ξ±] [DenselyOrdered Ξ±] {a b : Ξ±}
{s : Set Ξ±}
theorem closure_Ioi' {a : Ξ±} (h : (Ioi a).Nonempty) : closure (Ioi a) = Ici a := by
apply Subset.antisymm
Β· exact closure_minimal Ioi_subset_Ici_self isClosed_Ici
Β· rw [β diff_subset_closure_iff, Ici_diff_Ioi_same, singleton_subset_iff]
exact isGLB_Ioi.mem_closure h
#align closure_Ioi' closure_Ioi'
@[simp]
theorem closure_Ioi (a : Ξ±) [NoMaxOrder Ξ±] : closure (Ioi a) = Ici a :=
closure_Ioi' nonempty_Ioi
#align closure_Ioi closure_Ioi
theorem closure_Iio' (h : (Iio a).Nonempty) : closure (Iio a) = Iic a :=
closure_Ioi' (Ξ± := Ξ±α΅α΅) h
#align closure_Iio' closure_Iio'
@[simp]
theorem closure_Iio (a : Ξ±) [NoMinOrder Ξ±] : closure (Iio a) = Iic a :=
closure_Iio' nonempty_Iio
#align closure_Iio closure_Iio
@[simp]
theorem closure_Ioo {a b : Ξ±} (hab : a β b) : closure (Ioo a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ioo_subset_Icc_self isClosed_Icc
Β· cases' hab.lt_or_lt with hab hab
Β· rw [β diff_subset_closure_iff, Icc_diff_Ioo_same hab.le]
have hab' : (Ioo a b).Nonempty := nonempty_Ioo.2 hab
simp only [insert_subset_iff, singleton_subset_iff]
exact β¨(isGLB_Ioo hab).mem_closure hab', (isLUB_Ioo hab).mem_closure hab'β©
Β· rw [Icc_eq_empty_of_lt hab]
exact empty_subset _
#align closure_Ioo closure_Ioo
@[simp]
theorem closure_Ioc {a b : Ξ±} (hab : a β b) : closure (Ioc a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ioc_subset_Icc_self isClosed_Icc
Β· apply Subset.trans _ (closure_mono Ioo_subset_Ioc_self)
rw [closure_Ioo hab]
#align closure_Ioc closure_Ioc
@[simp]
theorem closure_Ico {a b : Ξ±} (hab : a β b) : closure (Ico a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ico_subset_Icc_self isClosed_Icc
Β· apply Subset.trans _ (closure_mono Ioo_subset_Ico_self)
rw [closure_Ioo hab]
#align closure_Ico closure_Ico
@[simp]
theorem interior_Ici' {a : Ξ±} (ha : (Iio a).Nonempty) : interior (Ici a) = Ioi a := by
rw [β compl_Iio, interior_compl, closure_Iio' ha, compl_Iic]
#align interior_Ici' interior_Ici'
theorem interior_Ici [NoMinOrder Ξ±] {a : Ξ±} : interior (Ici a) = Ioi a :=
interior_Ici' nonempty_Iio
#align interior_Ici interior_Ici
@[simp]
theorem interior_Iic' {a : Ξ±} (ha : (Ioi a).Nonempty) : interior (Iic a) = Iio a :=
interior_Ici' (Ξ± := Ξ±α΅α΅) ha
#align interior_Iic' interior_Iic'
theorem interior_Iic [NoMaxOrder Ξ±] {a : Ξ±} : interior (Iic a) = Iio a :=
interior_Iic' nonempty_Ioi
#align interior_Iic interior_Iic
@[simp]
theorem interior_Icc [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b : Ξ±} : interior (Icc a b) = Ioo a b := by
rw [β Ici_inter_Iic, interior_inter, interior_Ici, interior_Iic, Ioi_inter_Iio]
#align interior_Icc interior_Icc
@[simp]
| Mathlib/Topology/Order/DenselyOrdered.lean | 106 | 108 | theorem Icc_mem_nhds_iff [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b x : Ξ±} :
Icc a b β π x β x β Ioo a b := by |
rw [β interior_Icc, mem_interior_iff_mem_nhds]
| [
" closure (Ioi a) = Ici a",
" closure (Ioi a) β Ici a",
" Ici a β closure (Ioi a)",
" a β closure (Ioi a)",
" closure (Ioo a b) = Icc a b",
" closure (Ioo a b) β Icc a b",
" Icc a b β closure (Ioo a b)",
" {a, b} β closure (Ioo a b)",
" a β closure (Ioo a b) β§ b β closure (Ioo a b)",
" β
β closure... | [
" closure (Ioi a) = Ici a",
" closure (Ioi a) β Ici a",
" Ici a β closure (Ioi a)",
" a β closure (Ioi a)",
" closure (Ioo a b) = Icc a b",
" closure (Ioo a b) β Icc a b",
" Icc a b β closure (Ioo a b)",
" {a, b} β closure (Ioo a b)",
" a β closure (Ioo a b) β§ b β closure (Ioo a b)",
" β
β closure... |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 259 | 262 | theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
| [
" Nontrivial (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β))",
" finrank β (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β)) = finrank β K",
" Function.Injective β(mixedEmbedding K)",
" (fun x => if hw : w.IsReal then βx.1 β¨w, hwβ©β else βx.2 β¨w, β―β©β) 0 = 0",
" { toFun := fun x => if hw : w.IsRea... | [
" Nontrivial (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β))",
" finrank β (({ w // w.IsReal } β β) Γ ({ w // w.IsComplex } β β)) = finrank β K",
" Function.Injective β(mixedEmbedding K)",
" (fun x => if hw : w.IsReal then βx.1 β¨w, hwβ©β else βx.2 β¨w, β―β©β) 0 = 0",
" { toFun := fun x => if hw : w.IsRea... |
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c"
variable {ΞΉ : Type*} [Fintype ΞΉ]
variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R)
variable (b : ΞΉ β M) (hb : Submodule.span R (Set.range b) = β€)
open Polynomial Matrix
def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R ββ[R] (ΞΉ β R) ββ[R] M :=
(LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap
#align pi_to_module.from_matrix PiToModule.fromMatrix
theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β R) :
PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) :=
rfl
#align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply
theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) :
PiToModule.fromMatrix R b A (Pi.single j 1) = β i : ΞΉ, A i j β’ b i := by
rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single]
simp_rw [mul_one]
#align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one
def PiToModule.fromEnd : Module.End R M ββ[R] (ΞΉ β R) ββ[R] M :=
LinearMap.lcomp _ _ (Fintype.total R R b)
#align pi_to_module.from_End PiToModule.fromEnd
theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β R) :
PiToModule.fromEnd R b f w = f (Fintype.total R R b w) :=
rfl
#align pi_to_module.from_End_apply PiToModule.fromEnd_apply
theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) :
PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by
rw [PiToModule.fromEnd_apply]
congr
convert Fintype.total_apply_single (S := R) R b i (1 : R)
rw [one_smul]
#align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one
theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = β€) :
Function.Injective (PiToModule.fromEnd R b) := by
intro x y e
ext m
obtain β¨m, rflβ© : m β LinearMap.range (Fintype.total R R b) := by
rw [(Fintype.range_total R b).trans hb]
exact Submodule.mem_top
exact (LinearMap.congr_fun e m : _)
#align pi_to_module.from_End_injective PiToModule.fromEnd_injective
section
variable {R} [DecidableEq ΞΉ]
def Matrix.Represents (A : Matrix ΞΉ ΞΉ R) (f : Module.End R M) : Prop :=
PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f
#align matrix.represents Matrix.Represents
variable {b}
theorem Matrix.Represents.congr_fun {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f)
(x) : Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) :=
LinearMap.congr_fun h x
#align matrix.represents.congr_fun Matrix.Represents.congr_fun
theorem Matrix.represents_iff {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} :
A.Represents b f β β x, Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) :=
β¨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H xβ©
#align matrix.represents_iff Matrix.represents_iff
theorem Matrix.represents_iff' {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} :
A.Represents b f β β j, β i : ΞΉ, A i j β’ b i = f (b j) := by
constructor
Β· intro h i
have := LinearMap.congr_fun h (Pi.single i 1)
rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this
Β· intro h
-- Porting note: was `ext`
refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_)
simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one,
PiToModule.fromMatrix_apply_single_one]
apply h
#align matrix.represents_iff' Matrix.represents_iff'
theorem Matrix.Represents.mul {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f)
(h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by
delta Matrix.Represents PiToModule.fromMatrix
rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_mul]
ext
dsimp [PiToModule.fromEnd]
rw [β h'.congr_fun, β h.congr_fun]
rfl
#align matrix.represents.mul Matrix.Represents.mul
theorem Matrix.Represents.one : (1 : Matrix ΞΉ ΞΉ R).Represents b 1 := by
delta Matrix.Represents PiToModule.fromMatrix
rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_one]
ext
rfl
#align matrix.represents.one Matrix.Represents.one
theorem Matrix.Represents.add {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f)
(h' : Matrix.Represents b A' f') : (A + A').Represents b (f + f') := by
delta Matrix.Represents at h h' β’; rw [map_add, map_add, h, h']
#align matrix.represents.add Matrix.Represents.add
theorem Matrix.Represents.zero : (0 : Matrix ΞΉ ΞΉ R).Represents b 0 := by
delta Matrix.Represents
rw [map_zero, map_zero]
#align matrix.represents.zero Matrix.Represents.zero
| Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean | 141 | 144 | theorem Matrix.Represents.smul {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f)
(r : R) : (r β’ A).Represents b (r β’ f) := by |
delta Matrix.Represents at h β’
rw [_root_.map_smul, _root_.map_smul, h]
| [
" ((fromMatrix R b) A) (Pi.single j 1) = β i : ΞΉ, A i j β’ b i",
" β i : ΞΉ, (fun i => A i j * 1) i β’ b i = β i : ΞΉ, A i j β’ b i",
" ((fromEnd R b) f) (Pi.single i 1) = f (b i)",
" f (((Fintype.total R R) b) (Pi.single i 1)) = f (b i)",
" ((Fintype.total R R) b) (Pi.single i 1) = b i",
" b i = 1 β’ b i",
"... | [
" ((fromMatrix R b) A) (Pi.single j 1) = β i : ΞΉ, A i j β’ b i",
" β i : ΞΉ, (fun i => A i j * 1) i β’ b i = β i : ΞΉ, A i j β’ b i",
" ((fromEnd R b) f) (Pi.single i 1) = f (b i)",
" f (((Fintype.total R R) b) (Pi.single i 1)) = f (b i)",
" ((Fintype.total R R) b) (Pi.single i 1) = b i",
" b i = 1 β’ b i",
"... |
import Mathlib.Topology.MetricSpace.Basic
#align_import topology.metric_space.infsep from "leanprover-community/mathlib"@"5316314b553dcf8c6716541851517c1a9715e22b"
variable {Ξ± Ξ² : Type*}
namespace Set
section Einfsep
open ENNReal
open Function
noncomputable def einfsep [EDist Ξ±] (s : Set Ξ±) : ββ₯0β :=
β¨
(x β s) (y β s) (_ : x β y), edist x y
#align set.einfsep Set.einfsep
section Infsep
open ENNReal
open Set Function
noncomputable def infsep [EDist Ξ±] (s : Set Ξ±) : β :=
ENNReal.toReal s.einfsep
#align set.infsep Set.infsep
section EDist
variable [EDist Ξ±] {x y : Ξ±} {s : Set Ξ±}
theorem infsep_zero : s.infsep = 0 β s.einfsep = 0 β¨ s.einfsep = β := by
rw [infsep, ENNReal.toReal_eq_zero_iff]
#align set.infsep_zero Set.infsep_zero
theorem infsep_nonneg : 0 β€ s.infsep :=
ENNReal.toReal_nonneg
#align set.infsep_nonneg Set.infsep_nonneg
| Mathlib/Topology/MetricSpace/Infsep.lean | 340 | 341 | theorem infsep_pos : 0 < s.infsep β 0 < s.einfsep β§ s.einfsep < β := by |
simp_rw [infsep, ENNReal.toReal_pos_iff]
| [
" s.infsep = 0 β s.einfsep = 0 β¨ s.einfsep = β€",
" 0 < s.infsep β 0 < s.einfsep β§ s.einfsep < β€"
] | [
" s.infsep = 0 β s.einfsep = 0 β¨ s.einfsep = β€",
" 0 < s.infsep β 0 < s.einfsep β§ s.einfsep < β€"
] |
import Mathlib.Algebra.Group.Semiconj.Defs
import Mathlib.Init.Algebra.Classes
#align_import algebra.group.commute from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102"
assert_not_exists MonoidWithZero
assert_not_exists DenselyOrdered
variable {G M S : Type*}
@[to_additive "Two elements additively commute if `a + b = b + a`"]
def Commute [Mul S] (a b : S) : Prop :=
SemiconjBy a b b
#align commute Commute
#align add_commute AddCommute
@[to_additive]
theorem commute_iff_eq [Mul S] (a b : S) : Commute a b β a * b = b * a := Iff.rfl
namespace Commute
@[to_additive]
protected theorem all [CommMagma S] (a b : S) : Commute a b :=
mul_comm a b
#align commute.all Commute.allβ
#align add_commute.all AddCommute.allβ
-- not sure why this needs an `β`, maybe instance names not aligned?
section Group
variable [Group G] {a b : G}
@[to_additive]
protected theorem mul_inv_cancel (h : Commute a b) : a * b * aβ»ΒΉ = b := by
rw [h.eq, mul_inv_cancel_right]
#align commute.mul_inv_cancel Commute.mul_inv_cancel
#align add_commute.add_neg_cancel AddCommute.add_neg_cancel
@[to_additive]
| Mathlib/Algebra/Group/Commute/Defs.lean | 262 | 263 | theorem mul_inv_cancel_assoc (h : Commute a b) : a * (b * aβ»ΒΉ) = b := by |
rw [β mul_assoc, h.mul_inv_cancel]
| [
" a * b * aβ»ΒΉ = b",
" a * (b * aβ»ΒΉ) = b"
] | [
" a * b * aβ»ΒΉ = b",
" a * (b * aβ»ΒΉ) = b"
] |
import Mathlib.Analysis.MeanInequalities
import Mathlib.Analysis.MeanInequalitiesPow
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
import Mathlib.Data.Set.Image
import Mathlib.Topology.Algebra.Order.LiminfLimsup
#align_import analysis.normed_space.lp_space from "leanprover-community/mathlib"@"de83b43717abe353f425855fcf0cedf9ea0fe8a4"
noncomputable section
open scoped NNReal ENNReal Function
variable {Ξ± : Type*} {E : Ξ± β Type*} {p q : ββ₯0β} [β i, NormedAddCommGroup (E i)]
def Memβp (f : β i, E i) (p : ββ₯0β) : Prop :=
if p = 0 then Set.Finite { i | f i β 0 }
else if p = β then BddAbove (Set.range fun i => βf iβ)
else Summable fun i => βf iβ ^ p.toReal
#align mem_βp Memβp
theorem memβp_zero_iff {f : β i, E i} : Memβp f 0 β Set.Finite { i | f i β 0 } := by
dsimp [Memβp]
rw [if_pos rfl]
#align mem_βp_zero_iff memβp_zero_iff
theorem memβp_zero {f : β i, E i} (hf : Set.Finite { i | f i β 0 }) : Memβp f 0 :=
memβp_zero_iff.2 hf
#align mem_βp_zero memβp_zero
theorem memβp_infty_iff {f : β i, E i} : Memβp f β β BddAbove (Set.range fun i => βf iβ) := by
dsimp [Memβp]
rw [if_neg ENNReal.top_ne_zero, if_pos rfl]
#align mem_βp_infty_iff memβp_infty_iff
theorem memβp_infty {f : β i, E i} (hf : BddAbove (Set.range fun i => βf iβ)) : Memβp f β :=
memβp_infty_iff.2 hf
#align mem_βp_infty memβp_infty
theorem memβp_gen_iff (hp : 0 < p.toReal) {f : β i, E i} :
Memβp f p β Summable fun i => βf iβ ^ p.toReal := by
rw [ENNReal.toReal_pos_iff] at hp
dsimp [Memβp]
rw [if_neg hp.1.ne', if_neg hp.2.ne]
#align mem_βp_gen_iff memβp_gen_iff
theorem memβp_gen {f : β i, E i} (hf : Summable fun i => βf iβ ^ p.toReal) : Memβp f p := by
rcases p.trichotomy with (rfl | rfl | hp)
Β· apply memβp_zero
have H : Summable fun _ : Ξ± => (1 : β) := by simpa using hf
exact (Set.Finite.of_summable_const (by norm_num) H).subset (Set.subset_univ _)
Β· apply memβp_infty
have H : Summable fun _ : Ξ± => (1 : β) := by simpa using hf
simpa using ((Set.Finite.of_summable_const (by norm_num) H).image fun i => βf iβ).bddAbove
exact (memβp_gen_iff hp).2 hf
#align mem_βp_gen memβp_gen
| Mathlib/Analysis/NormedSpace/lpSpace.lean | 117 | 127 | theorem memβp_gen' {C : β} {f : β i, E i} (hf : β s : Finset Ξ±, β i β s, βf iβ ^ p.toReal β€ C) :
Memβp f p := by |
apply memβp_gen
use β¨ s : Finset Ξ±, β i β s, βf iβ ^ p.toReal
apply hasSum_of_isLUB_of_nonneg
Β· intro b
exact Real.rpow_nonneg (norm_nonneg _) _
apply isLUB_ciSup
use C
rintro - β¨s, rflβ©
exact hf s
| [
" Memβp f 0 β {i | f i β 0}.Finite",
" (if 0 = 0 then {i | Β¬f i = 0}.Finite\n else if 0 = β€ then BddAbove (Set.range fun i => βf iβ) else Summable fun i => βf iβ ^ 0) β\n {i | Β¬f i = 0}.Finite",
" Memβp f β€ β BddAbove (Set.range fun i => βf iβ)",
" (if β€ = 0 then {i | Β¬f i = 0}.Finite\n else if β€ = β€... | [
" Memβp f 0 β {i | f i β 0}.Finite",
" (if 0 = 0 then {i | Β¬f i = 0}.Finite\n else if 0 = β€ then BddAbove (Set.range fun i => βf iβ) else Summable fun i => βf iβ ^ 0) β\n {i | Β¬f i = 0}.Finite",
" Memβp f β€ β BddAbove (Set.range fun i => βf iβ)",
" (if β€ = 0 then {i | Β¬f i = 0}.Finite\n else if β€ = β€... |
import Mathlib.Algebra.MonoidAlgebra.Basic
import Mathlib.Algebra.Group.UniqueProds
#align_import algebra.monoid_algebra.no_zero_divisors from "leanprover-community/mathlib"@"3e067975886cf5801e597925328c335609511b1a"
open Finsupp
variable {R A : Type*} [Semiring R]
namespace MonoidAlgebra
| Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean | 68 | 79 | theorem mul_apply_mul_eq_mul_of_uniqueMul [Mul A] {f g : MonoidAlgebra R A} {a0 b0 : A}
(h : UniqueMul f.support g.support a0 b0) :
(f * g) (a0 * b0) = f a0 * g b0 := by |
classical
simp_rw [mul_apply, sum, β Finset.sum_product']
refine (Finset.sum_eq_single (a0, b0) ?_ ?_).trans (if_pos rfl) <;> simp_rw [Finset.mem_product]
Β· refine fun ab hab hne => if_neg (fun he => hne <| Prod.ext ?_ ?_)
exacts [(h hab.1 hab.2 he).1, (h hab.1 hab.2 he).2]
Β· refine fun hnmem => ite_eq_right_iff.mpr (fun _ => ?_)
rcases not_and_or.mp hnmem with af | bg
Β· rw [not_mem_support_iff.mp af, zero_mul]
Β· rw [not_mem_support_iff.mp bg, mul_zero]
| [
" (f * g) (a0 * b0) = f a0 * g b0",
" (β x β f.support ΓΛ’ g.support, if x.1 * x.2 = a0 * b0 then f x.1 * g x.2 else 0) = f a0 * g b0",
" β b β f.support ΓΛ’ g.support, b β (a0, b0) β (if b.1 * b.2 = a0 * b0 then f b.1 * g b.2 else 0) = 0",
" (a0, b0) β f.support ΓΛ’ g.support β (if (a0, b0).1 * (a0, b0).2 = a0 ... | [
" (f * g) (a0 * b0) = f a0 * g b0"
] |
import Mathlib.Data.Vector.Basic
import Mathlib.Data.Vector.Snoc
set_option autoImplicit true
namespace Vector
section Fold
section Binary
variable (xs : Vector Ξ± n) (ys : Vector Ξ² n)
@[simp]
theorem mapAccumrβ_mapAccumr_left (fβ : Ξ³ β Ξ² β Οβ β Οβ Γ ΞΆ) (fβ : Ξ± β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ (mapAccumr fβ xs sβ).snd ys sβ)
= let m := (mapAccumrβ (fun x y s =>
let rβ := fβ x s.snd
let rβ := fβ rβ.snd y s.fst
((rβ.fst, rβ.fst), rβ.snd)
) xs ys (sβ, sβ))
(m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
@[simp]
theorem mapβ_map_left (fβ : Ξ³ β Ξ² β ΞΆ) (fβ : Ξ± β Ξ³) :
mapβ fβ (map fβ xs) ys = mapβ (fun x y => fβ (fβ x) y) xs ys := by
induction xs, ys using Vector.revInductionOnβ <;> simp_all
@[simp]
theorem mapAccumrβ_mapAccumr_right (fβ : Ξ± β Ξ³ β Οβ β Οβ Γ ΞΆ) (fβ : Ξ² β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ xs (mapAccumr fβ ys sβ).snd sβ)
= let m := (mapAccumrβ (fun x y s =>
let rβ := fβ y s.snd
let rβ := fβ x rβ.snd s.fst
((rβ.fst, rβ.fst), rβ.snd)
) xs ys (sβ, sβ))
(m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
@[simp]
theorem mapβ_map_right (fβ : Ξ± β Ξ³ β ΞΆ) (fβ : Ξ² β Ξ³) :
mapβ fβ xs (map fβ ys) = mapβ (fun x y => fβ x (fβ y)) xs ys := by
induction xs, ys using Vector.revInductionOnβ <;> simp_all
@[simp]
theorem mapAccumr_mapAccumrβ (fβ : Ξ³ β Οβ β Οβ Γ ΞΆ) (fβ : Ξ± β Ξ² β Οβ β Οβ Γ Ξ³) :
(mapAccumr fβ (mapAccumrβ fβ xs ys sβ).snd sβ)
= let m := mapAccumrβ (fun x y s =>
let rβ := fβ x y s.snd
let rβ := fβ rβ.snd s.fst
((rβ.fst, rβ.fst), rβ.snd)
) xs ys (sβ, sβ)
(m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
@[simp]
theorem map_mapβ (fβ : Ξ³ β ΞΆ) (fβ : Ξ± β Ξ² β Ξ³) :
map fβ (mapβ fβ xs ys) = mapβ (fun x y => fβ <| fβ x y) xs ys := by
induction xs, ys using Vector.revInductionOnβ <;> simp_all
@[simp]
theorem mapAccumrβ_mapAccumrβ_left_left (fβ : Ξ³ β Ξ± β Οβ β Οβ Γ Ο) (fβ : Ξ± β Ξ² β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ (mapAccumrβ fβ xs ys sβ).snd xs sβ)
= let m := mapAccumrβ (fun x y (sβ, sβ) =>
let rβ := fβ x y sβ
let rβ := fβ rβ.snd x sβ
((rβ.fst, rβ.fst), rβ.snd)
)
xs ys (sβ, sβ)
(m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
@[simp]
theorem mapAccumrβ_mapAccumrβ_left_right
(fβ : Ξ³ β Ξ² β Οβ β Οβ Γ Ο) (fβ : Ξ± β Ξ² β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ (mapAccumrβ fβ xs ys sβ).snd ys sβ)
= let m := mapAccumrβ (fun x y (sβ, sβ) =>
let rβ := fβ x y sβ
let rβ := fβ rβ.snd y sβ
((rβ.fst, rβ.fst), rβ.snd)
)
xs ys (sβ, sβ)
(m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
@[simp]
theorem mapAccumrβ_mapAccumrβ_right_left (fβ : Ξ± β Ξ³ β Οβ β Οβ Γ Ο) (fβ : Ξ± β Ξ² β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ xs (mapAccumrβ fβ xs ys sβ).snd sβ)
= let m := mapAccumrβ (fun x y (sβ, sβ) =>
let rβ := fβ x y sβ
let rβ := fβ x rβ.snd sβ
((rβ.fst, rβ.fst), rβ.snd)
)
xs ys (sβ, sβ)
(m.fst.fst, m.snd) := by
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
@[simp]
| Mathlib/Data/Vector/MapLemmas.lean | 145 | 154 | theorem mapAccumrβ_mapAccumrβ_right_right (fβ : Ξ² β Ξ³ β Οβ β Οβ Γ Ο) (fβ : Ξ± β Ξ² β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ ys (mapAccumrβ fβ xs ys sβ).snd sβ)
= let m := mapAccumrβ (fun x y (sβ, sβ) =>
let rβ := fβ x y sβ
let rβ := fβ y rβ.snd sβ
((rβ.fst, rβ.fst), rβ.snd)
)
xs ys (sβ, sβ)
(m.fst.fst, m.snd) := by |
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
| [
" mapAccumrβ fβ (mapAccumr fβ xs sβ).2 ys sβ =\n let m :=\n mapAccumrβ\n (fun x y s =>\n let rβ := fβ x s.2;\n let rβ := fβ rβ.2 y s.1;\n ((rβ.1, rβ.1), rβ.2))\n xs ys (sβ, sβ);\n (m.1.1, m.2)",
" mapAccumrβ fβ (mapAccumr fβ nil sβ).2 nil sβ =\n let m :=\n ... | [
" mapAccumrβ fβ (mapAccumr fβ xs sβ).2 ys sβ =\n let m :=\n mapAccumrβ\n (fun x y s =>\n let rβ := fβ x s.2;\n let rβ := fβ rβ.2 y s.1;\n ((rβ.1, rβ.1), rβ.2))\n xs ys (sβ, sβ);\n (m.1.1, m.2)",
" mapAccumrβ fβ (mapAccumr fβ nil sβ).2 nil sβ =\n let m :=\n ... |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Order.SupIndep
import Mathlib.Order.Atoms
#align_import order.partition.finpartition from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
open Finset Function
variable {Ξ± : Type*}
@[ext]
structure Finpartition [Lattice Ξ±] [OrderBot Ξ±] (a : Ξ±) where
-- Porting note: Docstrings added
parts : Finset Ξ±
supIndep : parts.SupIndep id
sup_parts : parts.sup id = a
not_bot_mem : β₯ β parts
deriving DecidableEq
#align finpartition Finpartition
#align finpartition.parts Finpartition.parts
#align finpartition.sup_indep Finpartition.supIndep
#align finpartition.sup_parts Finpartition.sup_parts
#align finpartition.not_bot_mem Finpartition.not_bot_mem
-- Porting note: attribute [protected] doesn't work
-- attribute [protected] Finpartition.supIndep
namespace Finpartition
section Lattice
variable [Lattice Ξ±] [OrderBot Ξ±]
@[simps]
def ofErase [DecidableEq Ξ±] {a : Ξ±} (parts : Finset Ξ±) (sup_indep : parts.SupIndep id)
(sup_parts : parts.sup id = a) : Finpartition a where
parts := parts.erase β₯
supIndep := sup_indep.subset (erase_subset _ _)
sup_parts := (sup_erase_bot _).trans sup_parts
not_bot_mem := not_mem_erase _ _
#align finpartition.of_erase Finpartition.ofErase
@[simps]
def ofSubset {a b : Ξ±} (P : Finpartition a) {parts : Finset Ξ±} (subset : parts β P.parts)
(sup_parts : parts.sup id = b) : Finpartition b :=
{ parts := parts
supIndep := P.supIndep.subset subset
sup_parts := sup_parts
not_bot_mem := fun h β¦ P.not_bot_mem (subset h) }
#align finpartition.of_subset Finpartition.ofSubset
@[simps]
def copy {a b : Ξ±} (P : Finpartition a) (h : a = b) : Finpartition b where
parts := P.parts
supIndep := P.supIndep
sup_parts := h βΈ P.sup_parts
not_bot_mem := P.not_bot_mem
#align finpartition.copy Finpartition.copy
def map {Ξ² : Type*} [Lattice Ξ²] [OrderBot Ξ²] {a : Ξ±} (e : Ξ± βo Ξ²) (P : Finpartition a) :
Finpartition (e a) where
parts := P.parts.map e
supIndep u hu _ hb hbu _ hx hxu := by
rw [β map_symm_subset] at hu
simp only [mem_map_equiv] at hb
have := P.supIndep hu hb (by simp [hbu]) (map_rel e.symm hx) ?_
Β· rw [β e.symm.map_bot] at this
exact e.symm.map_rel_iff.mp this
Β· convert e.symm.map_rel_iff.mpr hxu
rw [map_finset_sup, sup_map]
rfl
sup_parts := by simp [β P.sup_parts]
not_bot_mem := by
rw [mem_map_equiv]
convert P.not_bot_mem
exact e.symm.map_bot
@[simp]
theorem parts_map {Ξ² : Type*} [Lattice Ξ²] [OrderBot Ξ²] {a : Ξ±} {e : Ξ± βo Ξ²} {P : Finpartition a} :
(P.map e).parts = P.parts.map e := rfl
variable (Ξ±)
@[simps]
protected def empty : Finpartition (β₯ : Ξ±) where
parts := β
supIndep := supIndep_empty _
sup_parts := Finset.sup_empty
not_bot_mem := not_mem_empty β₯
#align finpartition.empty Finpartition.empty
instance : Inhabited (Finpartition (β₯ : Ξ±)) :=
β¨Finpartition.empty Ξ±β©
@[simp]
theorem default_eq_empty : (default : Finpartition (β₯ : Ξ±)) = Finpartition.empty Ξ± :=
rfl
#align finpartition.default_eq_empty Finpartition.default_eq_empty
variable {Ξ±} {a : Ξ±}
@[simps]
def indiscrete (ha : a β β₯) : Finpartition a where
parts := {a}
supIndep := supIndep_singleton _ _
sup_parts := Finset.sup_singleton
not_bot_mem h := ha (mem_singleton.1 h).symm
#align finpartition.indiscrete Finpartition.indiscrete
variable (P : Finpartition a)
protected theorem le {b : Ξ±} (hb : b β P.parts) : b β€ a :=
(le_sup hb).trans P.sup_parts.le
#align finpartition.le Finpartition.le
| Mathlib/Order/Partition/Finpartition.lean | 178 | 182 | theorem ne_bot {b : Ξ±} (hb : b β P.parts) : b β β₯ := by |
intro h
refine P.not_bot_mem (?_)
rw [h] at hb
exact hb
| [
" xβ β€ β₯",
" (βe).symm xβΒΉ β Finset.map (βe).symm.toEmbedding u",
" e.symm xβ β€ (Finset.map (βe).symm.toEmbedding u).sup id",
" (Finset.map (βe).symm.toEmbedding u).sup id = e.symm (u.sup id)",
" u.sup (id β β(βe).symm.toEmbedding) = u.sup (βe.symm β id)",
" (Finset.map (βe).toEmbedding P.parts).sup id = ... | [
" xβ β€ β₯",
" (βe).symm xβΒΉ β Finset.map (βe).symm.toEmbedding u",
" e.symm xβ β€ (Finset.map (βe).symm.toEmbedding u).sup id",
" (Finset.map (βe).symm.toEmbedding u).sup id = e.symm (u.sup id)",
" u.sup (id β β(βe).symm.toEmbedding) = u.sup (βe.symm β id)",
" (Finset.map (βe).toEmbedding P.parts).sup id = ... |
import Mathlib.Data.Complex.Basic
import Mathlib.Data.Real.Cardinality
#align_import data.complex.cardinality from "leanprover-community/mathlib"@"1c4e18434eeb5546b212e830b2b39de6a83c473c"
-- Porting note: the lemmas `mk_complex` and `mk_univ_complex` should be in the namespace `Cardinal`
-- like their real counterparts.
open Cardinal Set
open Cardinal
@[simp]
| Mathlib/Data/Complex/Cardinality.lean | 25 | 26 | theorem mk_complex : #β = π := by |
rw [mk_congr Complex.equivRealProd, mk_prod, lift_id, mk_real, continuum_mul_self]
| [
" #β = π "
] | [
" #β = π "
] |
import Mathlib.FieldTheory.RatFunc.Defs
import Mathlib.RingTheory.EuclideanDomain
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Polynomial.Content
#align_import field_theory.ratfunc from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6"
universe u v
noncomputable section
open scoped Classical
open scoped nonZeroDivisors Polynomial
variable {K : Type u}
namespace RatFunc
section Field
variable [CommRing K]
protected irreducible_def zero : RatFunc K :=
β¨0β©
#align ratfunc.zero RatFunc.zero
instance : Zero (RatFunc K) :=
β¨RatFunc.zeroβ©
-- Porting note: added `OfNat.ofNat`. using `simp?` produces `simp only [zero_def]`
-- that does not close the goal
theorem ofFractionRing_zero : (ofFractionRing 0 : RatFunc K) = 0 := by
simp only [Zero.zero, OfNat.ofNat, RatFunc.zero]
#align ratfunc.of_fraction_ring_zero RatFunc.ofFractionRing_zero
protected irreducible_def add : RatFunc K β RatFunc K β RatFunc K
| β¨pβ©, β¨qβ© => β¨p + qβ©
#align ratfunc.add RatFunc.add
instance : Add (RatFunc K) :=
β¨RatFunc.addβ©
-- Porting note: added `HAdd.hAdd`. using `simp?` produces `simp only [add_def]`
-- that does not close the goal
theorem ofFractionRing_add (p q : FractionRing K[X]) :
ofFractionRing (p + q) = ofFractionRing p + ofFractionRing q := by
simp only [HAdd.hAdd, Add.add, RatFunc.add]
#align ratfunc.of_fraction_ring_add RatFunc.ofFractionRing_add
protected irreducible_def sub : RatFunc K β RatFunc K β RatFunc K
| β¨pβ©, β¨qβ© => β¨p - qβ©
#align ratfunc.sub RatFunc.sub
instance : Sub (RatFunc K) :=
β¨RatFunc.subβ©
-- Porting note: added `HSub.hSub`. using `simp?` produces `simp only [sub_def]`
-- that does not close the goal
theorem ofFractionRing_sub (p q : FractionRing K[X]) :
ofFractionRing (p - q) = ofFractionRing p - ofFractionRing q := by
simp only [Sub.sub, HSub.hSub, RatFunc.sub]
#align ratfunc.of_fraction_ring_sub RatFunc.ofFractionRing_sub
protected irreducible_def neg : RatFunc K β RatFunc K
| β¨pβ© => β¨-pβ©
#align ratfunc.neg RatFunc.neg
instance : Neg (RatFunc K) :=
β¨RatFunc.negβ©
theorem ofFractionRing_neg (p : FractionRing K[X]) :
ofFractionRing (-p) = -ofFractionRing p := by simp only [Neg.neg, RatFunc.neg]
#align ratfunc.of_fraction_ring_neg RatFunc.ofFractionRing_neg
protected irreducible_def one : RatFunc K :=
β¨1β©
#align ratfunc.one RatFunc.one
instance : One (RatFunc K) :=
β¨RatFunc.oneβ©
-- Porting note: added `OfNat.ofNat`. using `simp?` produces `simp only [one_def]`
-- that does not close the goal
theorem ofFractionRing_one : (ofFractionRing 1 : RatFunc K) = 1 := by
simp only [One.one, OfNat.ofNat, RatFunc.one]
#align ratfunc.of_fraction_ring_one RatFunc.ofFractionRing_one
protected irreducible_def mul : RatFunc K β RatFunc K β RatFunc K
| β¨pβ©, β¨qβ© => β¨p * qβ©
#align ratfunc.mul RatFunc.mul
instance : Mul (RatFunc K) :=
β¨RatFunc.mulβ©
-- Porting note: added `HMul.hMul`. using `simp?` produces `simp only [mul_def]`
-- that does not close the goal
theorem ofFractionRing_mul (p q : FractionRing K[X]) :
ofFractionRing (p * q) = ofFractionRing p * ofFractionRing q := by
simp only [Mul.mul, HMul.hMul, RatFunc.mul]
#align ratfunc.of_fraction_ring_mul RatFunc.ofFractionRing_mul
section SMul
variable {R : Type*}
protected irreducible_def smul [SMul R (FractionRing K[X])] : R β RatFunc K β RatFunc K
| r, β¨pβ© => β¨r β’ pβ©
#align ratfunc.smul RatFunc.smul
-- cannot reproduce
--@[nolint fails_quickly] -- Porting note: `linter 'fails_quickly' not found`
instance [SMul R (FractionRing K[X])] : SMul R (RatFunc K) :=
β¨RatFunc.smulβ©
-- Porting note: added `SMul.hSMul`. using `simp?` produces `simp only [smul_def]`
-- that does not close the goal
| Mathlib/FieldTheory/RatFunc/Basic.lean | 209 | 211 | theorem ofFractionRing_smul [SMul R (FractionRing K[X])] (c : R) (p : FractionRing K[X]) :
ofFractionRing (c β’ p) = c β’ ofFractionRing p := by |
simp only [SMul.smul, HSMul.hSMul, RatFunc.smul]
| [
" { toFractionRing := 0 } = 0",
" { toFractionRing := p + q } = { toFractionRing := p } + { toFractionRing := q }",
" { toFractionRing := p - q } = { toFractionRing := p } - { toFractionRing := q }",
" { toFractionRing := -p } = -{ toFractionRing := p }",
" { toFractionRing := 1 } = 1",
" { toFractionRing... | [
" { toFractionRing := 0 } = 0",
" { toFractionRing := p + q } = { toFractionRing := p } + { toFractionRing := q }",
" { toFractionRing := p - q } = { toFractionRing := p } - { toFractionRing := q }",
" { toFractionRing := -p } = -{ toFractionRing := p }",
" { toFractionRing := 1 } = 1",
" { toFractionRing... |
import Mathlib.Topology.Connected.Basic
open Set Topology
universe u v
variable {Ξ± : Type u} {Ξ² : Type v} {ΞΉ : Type*} {Ο : ΞΉ β Type*} [TopologicalSpace Ξ±]
{s t u v : Set Ξ±}
section LocallyConnectedSpace
class LocallyConnectedSpace (Ξ± : Type*) [TopologicalSpace Ξ±] : Prop where
open_connected_basis : β x, (π x).HasBasis (fun s : Set Ξ± => IsOpen s β§ x β s β§ IsConnected s) id
#align locally_connected_space LocallyConnectedSpace
theorem locallyConnectedSpace_iff_open_connected_basis :
LocallyConnectedSpace Ξ± β
β x, (π x).HasBasis (fun s : Set Ξ± => IsOpen s β§ x β s β§ IsConnected s) id :=
β¨@LocallyConnectedSpace.open_connected_basis _ _, LocallyConnectedSpace.mkβ©
#align locally_connected_space_iff_open_connected_basis locallyConnectedSpace_iff_open_connected_basis
theorem locallyConnectedSpace_iff_open_connected_subsets :
LocallyConnectedSpace Ξ± β
β x, β U β π x, β V : Set Ξ±, V β U β§ IsOpen V β§ x β V β§ IsConnected V := by
simp_rw [locallyConnectedSpace_iff_open_connected_basis]
refine forall_congr' fun _ => ?_
constructor
Β· intro h U hU
rcases h.mem_iff.mp hU with β¨V, hV, hVUβ©
exact β¨V, hVU, hVβ©
Β· exact fun h => β¨fun U => β¨fun hU =>
let β¨V, hVU, hVβ© := h U hU
β¨V, hV, hVUβ©, fun β¨V, β¨hV, hxV, _β©, hVUβ© => mem_nhds_iff.mpr β¨V, hVU, hV, hxVβ©β©β©
#align locally_connected_space_iff_open_connected_subsets locallyConnectedSpace_iff_open_connected_subsets
instance (priority := 100) DiscreteTopology.toLocallyConnectedSpace (Ξ±) [TopologicalSpace Ξ±]
[DiscreteTopology Ξ±] : LocallyConnectedSpace Ξ± :=
locallyConnectedSpace_iff_open_connected_subsets.2 fun x _U hU =>
β¨{x}, singleton_subset_iff.2 <| mem_of_mem_nhds hU, isOpen_discrete _, rfl,
isConnected_singletonβ©
#align discrete_topology.to_locally_connected_space DiscreteTopology.toLocallyConnectedSpace
theorem connectedComponentIn_mem_nhds [LocallyConnectedSpace Ξ±] {F : Set Ξ±} {x : Ξ±} (h : F β π x) :
connectedComponentIn F x β π x := by
rw [(LocallyConnectedSpace.open_connected_basis x).mem_iff] at h
rcases h with β¨s, β¨h1s, hxs, h2sβ©, hsFβ©
exact mem_nhds_iff.mpr β¨s, h2s.isPreconnected.subset_connectedComponentIn hxs hsF, h1s, hxsβ©
#align connected_component_in_mem_nhds connectedComponentIn_mem_nhds
protected theorem IsOpen.connectedComponentIn [LocallyConnectedSpace Ξ±] {F : Set Ξ±} {x : Ξ±}
(hF : IsOpen F) : IsOpen (connectedComponentIn F x) := by
rw [isOpen_iff_mem_nhds]
intro y hy
rw [connectedComponentIn_eq hy]
exact connectedComponentIn_mem_nhds (hF.mem_nhds <| connectedComponentIn_subset F x hy)
#align is_open.connected_component_in IsOpen.connectedComponentIn
theorem isOpen_connectedComponent [LocallyConnectedSpace Ξ±] {x : Ξ±} :
IsOpen (connectedComponent x) := by
rw [β connectedComponentIn_univ]
exact isOpen_univ.connectedComponentIn
#align is_open_connected_component isOpen_connectedComponent
theorem isClopen_connectedComponent [LocallyConnectedSpace Ξ±] {x : Ξ±} :
IsClopen (connectedComponent x) :=
β¨isClosed_connectedComponent, isOpen_connectedComponentβ©
#align is_clopen_connected_component isClopen_connectedComponent
| Mathlib/Topology/Connected/LocallyConnected.lean | 89 | 101 | theorem locallyConnectedSpace_iff_connectedComponentIn_open :
LocallyConnectedSpace Ξ± β
β F : Set Ξ±, IsOpen F β β x β F, IsOpen (connectedComponentIn F x) := by |
constructor
Β· intro h
exact fun F hF x _ => hF.connectedComponentIn
Β· intro h
rw [locallyConnectedSpace_iff_open_connected_subsets]
refine fun x U hU =>
β¨connectedComponentIn (interior U) x,
(connectedComponentIn_subset _ _).trans interior_subset, h _ isOpen_interior x ?_,
mem_connectedComponentIn ?_, isConnected_connectedComponentIn_iff.mpr ?_β© <;>
exact mem_interior_iff_mem_nhds.mpr hU
| [
" LocallyConnectedSpace Ξ± β β (x : Ξ±), β U β π x, β V β U, IsOpen V β§ x β V β§ IsConnected V",
" (β (x : Ξ±), (π x).HasBasis (fun s => IsOpen s β§ x β s β§ IsConnected s) id) β\n β (x : Ξ±), β U β π x, β V β U, IsOpen V β§ x β V β§ IsConnected V",
" (π xβ).HasBasis (fun s => IsOpen s β§ xβ β s β§ IsConnected s) i... | [
" LocallyConnectedSpace Ξ± β β (x : Ξ±), β U β π x, β V β U, IsOpen V β§ x β V β§ IsConnected V",
" (β (x : Ξ±), (π x).HasBasis (fun s => IsOpen s β§ x β s β§ IsConnected s) id) β\n β (x : Ξ±), β U β π x, β V β U, IsOpen V β§ x β V β§ IsConnected V",
" (π xβ).HasBasis (fun s => IsOpen s β§ xβ β s β§ IsConnected s) i... |
import Mathlib.Data.Set.Prod
import Mathlib.Logic.Equiv.Fin
import Mathlib.ModelTheory.LanguageMap
#align_import model_theory.syntax from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728"
universe u v w u' v'
namespace FirstOrder
namespace Language
variable (L : Language.{u, v}) {L' : Language}
variable {M : Type w} {N P : Type*} [L.Structure M] [L.Structure N] [L.Structure P]
variable {Ξ± : Type u'} {Ξ² : Type v'} {Ξ³ : Type*}
open FirstOrder
open Structure Fin
inductive Term (Ξ± : Type u') : Type max u u'
| var : Ξ± β Term Ξ±
| func : β {l : β} (_f : L.Functions l) (_ts : Fin l β Term Ξ±), Term Ξ±
#align first_order.language.term FirstOrder.Language.Term
export Term (var func)
variable {L}
namespace Term
open Finset
@[simp]
def varFinset [DecidableEq Ξ±] : L.Term Ξ± β Finset Ξ±
| var i => {i}
| func _f ts => univ.biUnion fun i => (ts i).varFinset
#align first_order.language.term.var_finset FirstOrder.Language.Term.varFinset
-- Porting note: universes in different order
@[simp]
def varFinsetLeft [DecidableEq Ξ±] : L.Term (Sum Ξ± Ξ²) β Finset Ξ±
| var (Sum.inl i) => {i}
| var (Sum.inr _i) => β
| func _f ts => univ.biUnion fun i => (ts i).varFinsetLeft
#align first_order.language.term.var_finset_left FirstOrder.Language.Term.varFinsetLeft
-- Porting note: universes in different order
@[simp]
def relabel (g : Ξ± β Ξ²) : L.Term Ξ± β L.Term Ξ²
| var i => var (g i)
| func f ts => func f fun {i} => (ts i).relabel g
#align first_order.language.term.relabel FirstOrder.Language.Term.relabel
| Mathlib/ModelTheory/Syntax.lean | 107 | 110 | theorem relabel_id (t : L.Term Ξ±) : t.relabel id = t := by |
induction' t with _ _ _ _ ih
Β· rfl
Β· simp [ih]
| [
" relabel id t = t",
" relabel id (var aβ) = var aβ",
" relabel id (func _fβ _tsβ) = func _fβ _tsβ"
] | [
" relabel id t = t"
] |
import Mathlib.Analysis.Analytic.Constructions
import Mathlib.Analysis.Calculus.Dslope
import Mathlib.Analysis.Calculus.FDeriv.Analytic
import Mathlib.Analysis.Analytic.Uniqueness
#align_import analysis.analytic.isolated_zeros from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090"
open scoped Classical
open Filter Function Nat FormalMultilinearSeries EMetric Set
open scoped Topology
variable {π : Type*} [NontriviallyNormedField π] {E : Type*} [NormedAddCommGroup E]
[NormedSpace π E] {s : E} {p q : FormalMultilinearSeries π π E} {f g : π β E} {n : β} {z zβ : π}
namespace HasFPowerSeriesAt
theorem has_fpower_series_dslope_fslope (hp : HasFPowerSeriesAt f p zβ) :
HasFPowerSeriesAt (dslope f zβ) p.fslope zβ := by
have hpd : deriv f zβ = p.coeff 1 := hp.deriv
have hp0 : p.coeff 0 = f zβ := hp.coeff_zero 1
simp only [hasFPowerSeriesAt_iff, apply_eq_pow_smul_coeff, coeff_fslope] at hp β’
refine hp.mono fun x hx => ?_
by_cases h : x = 0
Β· convert hasSum_single (Ξ± := E) 0 _ <;> intros <;> simp [*]
Β· have hxx : β n : β, xβ»ΒΉ * x ^ (n + 1) = x ^ n := fun n => by field_simp [h, _root_.pow_succ]
suffices HasSum (fun n => xβ»ΒΉ β’ x ^ (n + 1) β’ p.coeff (n + 1)) (xβ»ΒΉ β’ (f (zβ + x) - f zβ)) by
simpa [dslope, slope, h, smul_smul, hxx] using this
simpa [hp0] using ((hasSum_nat_add_iff' 1).mpr hx).const_smul xβ»ΒΉ
#align has_fpower_series_at.has_fpower_series_dslope_fslope HasFPowerSeriesAt.has_fpower_series_dslope_fslope
| Mathlib/Analysis/Analytic/IsolatedZeros.lean | 83 | 87 | theorem has_fpower_series_iterate_dslope_fslope (n : β) (hp : HasFPowerSeriesAt f p zβ) :
HasFPowerSeriesAt ((swap dslope zβ)^[n] f) (fslope^[n] p) zβ := by |
induction' n with n ih generalizing f p
Β· exact hp
Β· simpa using ih (has_fpower_series_dslope_fslope hp)
| [
" HasFPowerSeriesAt (dslope f zβ) p.fslope zβ",
" βαΆ (z : π) in π 0, HasSum (fun n => z ^ n β’ p.coeff (n + 1)) (dslope f zβ (zβ + z))",
" HasSum (fun n => x ^ n β’ p.coeff (n + 1)) (dslope f zβ (zβ + x))",
" dslope f zβ (zβ + x) = x ^ 0 β’ p.coeff (0 + 1)",
" β (b' : β), b' β 0 β x ^ b' β’ p.coeff (b' + 1) =... | [
" HasFPowerSeriesAt (dslope f zβ) p.fslope zβ",
" βαΆ (z : π) in π 0, HasSum (fun n => z ^ n β’ p.coeff (n + 1)) (dslope f zβ (zβ + z))",
" HasSum (fun n => x ^ n β’ p.coeff (n + 1)) (dslope f zβ (zβ + x))",
" dslope f zβ (zβ + x) = x ^ 0 β’ p.coeff (0 + 1)",
" β (b' : β), b' β 0 β x ^ b' β’ p.coeff (b' + 1) =... |
import Mathlib.Probability.Kernel.Composition
#align_import probability.kernel.invariance from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b"
open MeasureTheory
open scoped MeasureTheory ENNReal ProbabilityTheory
namespace ProbabilityTheory
variable {Ξ± Ξ² Ξ³ : Type*} {mΞ± : MeasurableSpace Ξ±} {mΞ² : MeasurableSpace Ξ²} {mΞ³ : MeasurableSpace Ξ³}
namespace kernel
@[simp]
theorem bind_add (ΞΌ Ξ½ : Measure Ξ±) (ΞΊ : kernel Ξ± Ξ²) : (ΞΌ + Ξ½).bind ΞΊ = ΞΌ.bind ΞΊ + Ξ½.bind ΞΊ := by
ext1 s hs
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_add_measure, Measure.coe_add,
Pi.add_apply, Measure.bind_apply hs (kernel.measurable _),
Measure.bind_apply hs (kernel.measurable _)]
#align probability_theory.kernel.bind_add ProbabilityTheory.kernel.bind_add
@[simp]
theorem bind_smul (ΞΊ : kernel Ξ± Ξ²) (ΞΌ : Measure Ξ±) (r : ββ₯0β) : (r β’ ΞΌ).bind ΞΊ = r β’ ΞΌ.bind ΞΊ := by
ext1 s hs
rw [Measure.bind_apply hs (kernel.measurable _), lintegral_smul_measure, Measure.coe_smul,
Pi.smul_apply, Measure.bind_apply hs (kernel.measurable _), smul_eq_mul]
#align probability_theory.kernel.bind_smul ProbabilityTheory.kernel.bind_smul
theorem const_bind_eq_comp_const (ΞΊ : kernel Ξ± Ξ²) (ΞΌ : Measure Ξ±) :
const Ξ± (ΞΌ.bind ΞΊ) = ΞΊ ββ const Ξ± ΞΌ := by
ext a s hs
simp_rw [comp_apply' _ _ _ hs, const_apply, Measure.bind_apply hs (kernel.measurable _)]
#align probability_theory.kernel.const_bind_eq_comp_const ProbabilityTheory.kernel.const_bind_eq_comp_const
theorem comp_const_apply_eq_bind (ΞΊ : kernel Ξ± Ξ²) (ΞΌ : Measure Ξ±) (a : Ξ±) :
(ΞΊ ββ const Ξ± ΞΌ) a = ΞΌ.bind ΞΊ := by
rw [β const_apply (ΞΌ.bind ΞΊ) a, const_bind_eq_comp_const ΞΊ ΞΌ]
#align probability_theory.kernel.comp_const_apply_eq_bind ProbabilityTheory.kernel.comp_const_apply_eq_bind
def Invariant (ΞΊ : kernel Ξ± Ξ±) (ΞΌ : Measure Ξ±) : Prop :=
ΞΌ.bind ΞΊ = ΞΌ
#align probability_theory.kernel.invariant ProbabilityTheory.kernel.Invariant
variable {ΞΊ Ξ· : kernel Ξ± Ξ±} {ΞΌ : Measure Ξ±}
theorem Invariant.def (hΞΊ : Invariant ΞΊ ΞΌ) : ΞΌ.bind ΞΊ = ΞΌ :=
hΞΊ
#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
| Mathlib/Probability/Kernel/Invariance.lean | 83 | 84 | theorem Invariant.comp_const (hΞΊ : Invariant ΞΊ ΞΌ) : ΞΊ ββ const Ξ± ΞΌ = const Ξ± ΞΌ := by |
rw [β const_bind_eq_comp_const ΞΊ ΞΌ, hΞΊ.def]
| [
" (ΞΌ + Ξ½).bind βΞΊ = ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ",
" ((ΞΌ + Ξ½).bind βΞΊ) s = (ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ) s",
" (r β’ ΞΌ).bind βΞΊ = r β’ ΞΌ.bind βΞΊ",
" ((r β’ ΞΌ).bind βΞΊ) s = (r β’ ΞΌ.bind βΞΊ) s",
" const Ξ± (ΞΌ.bind βΞΊ) = ΞΊ ββ const Ξ± ΞΌ",
" ((const Ξ± (ΞΌ.bind βΞΊ)) a) s = ((ΞΊ ββ const Ξ± ΞΌ) a) s",
" (ΞΊ ββ const Ξ± ΞΌ) a = ΞΌ.bind ... | [
" (ΞΌ + Ξ½).bind βΞΊ = ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ",
" ((ΞΌ + Ξ½).bind βΞΊ) s = (ΞΌ.bind βΞΊ + Ξ½.bind βΞΊ) s",
" (r β’ ΞΌ).bind βΞΊ = r β’ ΞΌ.bind βΞΊ",
" ((r β’ ΞΌ).bind βΞΊ) s = (r β’ ΞΌ.bind βΞΊ) s",
" const Ξ± (ΞΌ.bind βΞΊ) = ΞΊ ββ const Ξ± ΞΌ",
" ((const Ξ± (ΞΌ.bind βΞΊ)) a) s = ((ΞΊ ββ const Ξ± ΞΌ) a) s",
" (ΞΊ ββ const Ξ± ΞΌ) a = ΞΌ.bind ... |
import Mathlib.Data.Nat.Choose.Basic
import Mathlib.Data.Sym.Sym2
namespace List
variable {Ξ± : Type*}
section Sym
protected def sym : (n : β) β List Ξ± β List (Sym Ξ± n)
| 0, _ => [.nil]
| _, [] => []
| n + 1, x :: xs => ((x :: xs).sym n |>.map fun p => x ::β p) ++ xs.sym (n + 1)
variable {xs ys : List Ξ±} {n : β}
| Mathlib/Data/List/Sym.lean | 165 | 169 | theorem sym_one_eq : xs.sym 1 = xs.map (Β· ::β .nil) := by |
induction xs with
| nil => simp only [List.sym, Nat.succ_eq_add_one, Nat.reduceAdd, map_nil]
| cons x xs ih =>
rw [map_cons, β ih, List.sym, List.sym, map_singleton, singleton_append]
| [
" List.sym 1 xs = map (fun x => x ::β Sym.nil) xs",
" List.sym 1 [] = map (fun x => x ::β Sym.nil) []",
" List.sym 1 (x :: xs) = map (fun x => x ::β Sym.nil) (x :: xs)"
] | [
" List.sym 1 xs = map (fun x => x ::β Sym.nil) xs"
] |
import Mathlib.Data.Matrix.Block
import Mathlib.Data.Matrix.Notation
import Mathlib.LinearAlgebra.StdBasis
import Mathlib.RingTheory.AlgebraTower
import Mathlib.Algebra.Algebra.Subalgebra.Tower
#align_import linear_algebra.matrix.to_lin from "leanprover-community/mathlib"@"0e2aab2b0d521f060f62a14d2cf2e2c54e8491d6"
noncomputable section
open LinearMap Matrix Set Submodule
section ToMatrixRight
variable {R : Type*} [Semiring R]
variable {l m n : Type*}
def Matrix.vecMulLinear [Fintype m] (M : Matrix m n R) : (m β R) ββ[R] n β R where
toFun x := x α΅₯* M
map_add' _ _ := funext fun _ β¦ add_dotProduct _ _ _
map_smul' _ _ := funext fun _ β¦ smul_dotProduct _ _ _
#align matrix.vec_mul_linear Matrix.vecMulLinear
@[simp] theorem Matrix.vecMulLinear_apply [Fintype m] (M : Matrix m n R) (x : m β R) :
M.vecMulLinear x = x α΅₯* M := rfl
theorem Matrix.coe_vecMulLinear [Fintype m] (M : Matrix m n R) :
(M.vecMulLinear : _ β _) = M.vecMul := rfl
variable [Fintype m] [DecidableEq m]
@[simp]
theorem Matrix.vecMul_stdBasis (M : Matrix m n R) (i j) :
(LinearMap.stdBasis R (fun _ β¦ R) i 1 α΅₯* M) j = M i j := by
have : (β i', (if i = i' then 1 else 0) * M i' j) = M i j := by
simp_rw [boole_mul, Finset.sum_ite_eq, Finset.mem_univ, if_true]
simp only [vecMul, dotProduct]
convert this
split_ifs with h <;> simp only [stdBasis_apply]
Β· rw [h, Function.update_same]
Β· rw [Function.update_noteq (Ne.symm h), Pi.zero_apply]
#align matrix.vec_mul_std_basis Matrix.vecMul_stdBasis
theorem range_vecMulLinear (M : Matrix m n R) :
LinearMap.range M.vecMulLinear = span R (range M) := by
letI := Classical.decEq m
simp_rw [range_eq_map, β iSup_range_stdBasis, Submodule.map_iSup, range_eq_map, β
Ideal.span_singleton_one, Ideal.span, Submodule.map_span, image_image, image_singleton,
Matrix.vecMulLinear_apply, iSup_span, range_eq_iUnion, iUnion_singleton_eq_range,
LinearMap.stdBasis, coe_single]
unfold vecMul
simp_rw [single_dotProduct, one_mul]
| Mathlib/LinearAlgebra/Matrix/ToLin.lean | 112 | 123 | theorem Matrix.vecMul_injective_iff {R : Type*} [CommRing R] {M : Matrix m n R} :
Function.Injective M.vecMul β LinearIndependent R (fun i β¦ M i) := by |
rw [β coe_vecMulLinear]
simp only [β LinearMap.ker_eq_bot, Fintype.linearIndependent_iff, Submodule.eq_bot_iff,
LinearMap.mem_ker, vecMulLinear_apply]
refine β¨fun h c h0 β¦ congr_fun <| h c ?_, fun h c h0 β¦ funext <| h c ?_β©
Β· rw [β h0]
ext i
simp [vecMul, dotProduct]
Β· rw [β h0]
ext j
simp [vecMul, dotProduct]
| [
" ((LinearMap.stdBasis R (fun x => R) i) 1 α΅₯* M) j = M i j",
" β i' : m, (if i = i' then 1 else 0) * M i' j = M i j",
" β x : m, (LinearMap.stdBasis R (fun x => R) i) 1 x * M x j = M i j",
" (LinearMap.stdBasis R (fun x => R) i) 1 xβ = if i = xβ then 1 else 0",
" (LinearMap.stdBasis R (fun x => R) i) 1 xβ =... | [
" ((LinearMap.stdBasis R (fun x => R) i) 1 α΅₯* M) j = M i j",
" β i' : m, (if i = i' then 1 else 0) * M i' j = M i j",
" β x : m, (LinearMap.stdBasis R (fun x => R) i) 1 x * M x j = M i j",
" (LinearMap.stdBasis R (fun x => R) i) 1 xβ = if i = xβ then 1 else 0",
" (LinearMap.stdBasis R (fun x => R) i) 1 xβ =... |
import Mathlib.Data.Set.Subsingleton
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Algebra.Group.Nat
import Mathlib.Data.Set.Basic
#align_import data.set.equitable from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1"
variable {Ξ± Ξ² : Type*}
namespace Set
def EquitableOn [LE Ξ²] [Add Ξ²] [One Ξ²] (s : Set Ξ±) (f : Ξ± β Ξ²) : Prop :=
β β¦aβ aββ¦, aβ β s β aβ β s β f aβ β€ f aβ + 1
#align set.equitable_on Set.EquitableOn
@[simp]
theorem equitableOn_empty [LE Ξ²] [Add Ξ²] [One Ξ²] (f : Ξ± β Ξ²) : EquitableOn β
f := fun a _ ha =>
(Set.not_mem_empty a ha).elim
#align set.equitable_on_empty Set.equitableOn_empty
| Mathlib/Data/Set/Equitable.lean | 42 | 54 | theorem equitableOn_iff_exists_le_le_add_one {s : Set Ξ±} {f : Ξ± β β} :
s.EquitableOn f β β b, β a β s, b β€ f a β§ f a β€ b + 1 := by |
refine β¨?_, fun β¨b, hbβ© x y hx hy => (hb x hx).2.trans (add_le_add_right (hb y hy).1 _)β©
obtain rfl | β¨x, hxβ© := s.eq_empty_or_nonempty
Β· simp
intro hs
by_cases h : β y β s, f x β€ f y
Β· exact β¨f x, fun y hy => β¨h _ hy, hs hy hxβ©β©
push_neg at h
obtain β¨w, hw, hwxβ© := h
refine β¨f w, fun y hy => β¨Nat.le_of_succ_le_succ ?_, hs hy hwβ©β©
rw [(Nat.succ_le_of_lt hwx).antisymm (hs hx hw)]
exact hs hx hy
| [
" s.EquitableOn f β β b, β a β s, b β€ f a β§ f a β€ b + 1",
" s.EquitableOn f β β b, β a β s, b β€ f a β§ f a β€ b + 1",
" β
.EquitableOn f β β b, β a β β
, b β€ f a β§ f a β€ b + 1",
" β b, β a β s, b β€ f a β§ f a β€ b + 1",
" (f w).succ β€ (f y).succ",
" f x β€ (f y).succ"
] | [
" s.EquitableOn f β β b, β a β s, b β€ f a β§ f a β€ b + 1"
] |
import Mathlib.Data.Matrix.Block
import Mathlib.Data.Matrix.Notation
import Mathlib.Data.Matrix.RowCol
import Mathlib.GroupTheory.GroupAction.Ring
import Mathlib.GroupTheory.Perm.Fin
import Mathlib.LinearAlgebra.Alternating.Basic
#align_import linear_algebra.matrix.determinant from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
universe u v w z
open Equiv Equiv.Perm Finset Function
namespace Matrix
open Matrix
variable {m n : Type*} [DecidableEq n] [Fintype n] [DecidableEq m] [Fintype m]
variable {R : Type v} [CommRing R]
local notation "Ξ΅ " Ο:arg => ((sign Ο : β€) : R)
def detRowAlternating : (n β R) [β^n]ββ[R] R :=
MultilinearMap.alternatization ((MultilinearMap.mkPiAlgebra R n R).compLinearMap LinearMap.proj)
#align matrix.det_row_alternating Matrix.detRowAlternating
abbrev det (M : Matrix n n R) : R :=
detRowAlternating M
#align matrix.det Matrix.det
theorem det_apply (M : Matrix n n R) : M.det = β Ο : Perm n, Equiv.Perm.sign Ο β’ β i, M (Ο i) i :=
MultilinearMap.alternatization_apply _ M
#align matrix.det_apply Matrix.det_apply
-- This is what the old definition was. We use it to avoid having to change the old proofs below
| Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean | 68 | 69 | theorem det_apply' (M : Matrix n n R) : M.det = β Ο : Perm n, Ξ΅ Ο * β i, M (Ο i) i := by |
simp [det_apply, Units.smul_def]
| [
" M.det = β Ο : Perm n, ββ(sign Ο) * β i : n, M (Ο i) i"
] | [
" M.det = β Ο : Perm n, ββ(sign Ο) * β i : n, M (Ο i) i"
] |
import Mathlib.Analysis.Analytic.Basic
import Mathlib.Analysis.Analytic.CPolynomial
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.ContDiff.Defs
import Mathlib.Analysis.Calculus.FDeriv.Add
#align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
open Filter Asymptotics
open scoped ENNReal
universe u v
variable {π : Type*} [NontriviallyNormedField π]
variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π E]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
namespace FormalMultilinearSeries
variable (p : FormalMultilinearSeries π E F)
open Fintype ContinuousLinearMap in
| Mathlib/Analysis/Calculus/FDeriv/Analytic.lean | 449 | 458 | theorem derivSeries_apply_diag (n : β) (x : E) :
derivSeries p n (fun _ β¦ x) x = (n + 1) β’ p (n + 1) fun _ β¦ x := by |
simp only [derivSeries, compFormalMultilinearSeries_apply, changeOriginSeries,
compContinuousMultilinearMap_coe, ContinuousLinearEquiv.coe_coe, LinearIsometryEquiv.coe_coe,
Function.comp_apply, ContinuousMultilinearMap.sum_apply, map_sum, coe_sum', Finset.sum_apply,
continuousMultilinearCurryFin1_apply, Matrix.zero_empty]
convert Finset.sum_const _
Β· rw [Fin.snoc_zero, changeOriginSeriesTerm_apply, Finset.piecewise_same, add_comm]
Β· rw [β card, card_subtype, β Finset.powerset_univ, β Finset.powersetCard_eq_filter,
Finset.card_powersetCard, β card, card_fin, eq_comm, add_comm, Nat.choose_succ_self_right]
| [
" ((p.derivSeries n) fun x_1 => x) x = (n + 1) β’ (p (n + 1)) fun x_1 => x",
" β x_1 : { s // s.card = n }, ((p.changeOriginSeriesTerm 1 n βx_1 β―) fun x_2 => x) (Fin.snoc ![] x) =\n (n + 1) β’ (p (n + 1)) fun x_1 => x",
" ((p.changeOriginSeriesTerm 1 n βxβ β―) fun x_1 => x) (Fin.snoc ![] x) = (p (n + 1)) fun x_... | [
" ((p.derivSeries n) fun x_1 => x) x = (n + 1) β’ (p (n + 1)) fun x_1 => x"
] |
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 CLMCompApply
open ContinuousLinearMap
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π G] {c : π β F βL[π] G} {c' : F βL[π] G}
{d : π β E βL[π] F} {d' : E βL[π] F} {u : π β F} {u' : F}
theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) :
HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x := by
have := (hc.hasStrictFDerivAt.clm_comp hd.hasStrictFDerivAt).hasStrictDerivAt
rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul,
one_smul, add_comm] at this
#align has_strict_deriv_at.clm_comp HasStrictDerivAt.clm_comp
| Mathlib/Analysis/Calculus/Deriv/Mul.lean | 454 | 459 | theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
(hd : HasDerivWithinAt d d' s x) :
HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x := by |
have := (hc.hasFDerivWithinAt.clm_comp hd.hasFDerivWithinAt).hasDerivWithinAt
rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul,
one_smul, add_comm] at this
| [
" HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x",
" HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x"
] | [
" HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x",
" HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x"
] |
import Batteries.Data.Array.Lemmas
namespace ByteArray
@[ext] theorem ext : {a b : ByteArray} β a.data = b.data β a = b
| β¨_β©, β¨_β©, rfl => rfl
theorem getElem_eq_data_getElem (a : ByteArray) (h : i < a.size) : a[i] = a.data[i] := rfl
@[simp] theorem uset_eq_set (a : ByteArray) {i : USize} (h : i.toNat < a.size) (v : UInt8) :
a.uset i v h = a.set β¨i.toNat, hβ© v := rfl
@[simp] theorem mkEmpty_data (cap) : (mkEmpty cap).data = #[] := rfl
@[simp] theorem empty_data : empty.data = #[] := rfl
@[simp] theorem size_empty : empty.size = 0 := rfl
@[simp] theorem push_data (a : ByteArray) (b : UInt8) : (a.push b).data = a.data.push b := rfl
@[simp] theorem size_push (a : ByteArray) (b : UInt8) : (a.push b).size = a.size + 1 :=
Array.size_push ..
@[simp] theorem get_push_eq (a : ByteArray) (x : UInt8) : (a.push x)[a.size] = x :=
Array.get_push_eq ..
theorem get_push_lt (a : ByteArray) (x : UInt8) (i : Nat) (h : i < a.size) :
(a.push x)[i]'(size_push .. βΈ Nat.lt_succ_of_lt h) = a[i] :=
Array.get_push_lt ..
@[simp] theorem set_data (a : ByteArray) (i : Fin a.size) (v : UInt8) :
(a.set i v).data = a.data.set i v := rfl
@[simp] theorem size_set (a : ByteArray) (i : Fin a.size) (v : UInt8) :
(a.set i v).size = a.size :=
Array.size_set ..
@[simp] theorem get_set_eq (a : ByteArray) (i : Fin a.size) (v : UInt8) : (a.set i v)[i.val] = v :=
Array.get_set_eq ..
theorem get_set_ne (a : ByteArray) (i : Fin a.size) (v : UInt8) (hj : j < a.size) (h : i.val β j) :
(a.set i v)[j]'(a.size_set .. βΈ hj) = a[j] :=
Array.get_set_ne (h:=h) ..
theorem set_set (a : ByteArray) (i : Fin a.size) (v v' : UInt8) :
(a.set i v).set β¨i, by simp [i.2]β© v' = a.set i v' :=
ByteArray.ext <| Array.set_set ..
@[simp] theorem copySlice_data (a i b j len exact) :
(copySlice a i b j len exact).data = b.data.extract 0 j ++ a.data.extract i (i + len)
++ b.data.extract (j + min len (a.data.size - i)) b.data.size := rfl
@[simp] theorem append_eq (a b) : ByteArray.append a b = a ++ b := rfl
@[simp] theorem append_data (a b : ByteArray) : (a ++ b).data = a.data ++ b.data := by
rw [βappend_eq]; simp [ByteArray.append, size]
rw [Array.extract_empty_of_stop_le_start (h:=Nat.le_add_right ..), Array.append_nil]
theorem size_append (a b : ByteArray) : (a ++ b).size = a.size + b.size := by
simp only [size, append_eq, append_data]; exact Array.size_append ..
theorem get_append_left {a b : ByteArray} (hlt : i < a.size)
(h : i < (a ++ b).size := size_append .. βΈ Nat.lt_of_lt_of_le hlt (Nat.le_add_right ..)) :
(a ++ b)[i] = a[i] := by
simp [getElem_eq_data_getElem]; exact Array.get_append_left hlt
theorem get_append_right {a b : ByteArray} (hle : a.size β€ i) (h : i < (a ++ b).size)
(h' : i - a.size < b.size := Nat.sub_lt_left_of_lt_add hle (size_append .. βΈ h)) :
(a ++ b)[i] = b[i - a.size] := by
simp [getElem_eq_data_getElem]; exact Array.get_append_right hle
@[simp] theorem extract_data (a : ByteArray) (start stop) :
(a.extract start stop).data = a.data.extract start stop := by
simp [extract]
match Nat.le_total start stop with
| .inl h => simp [h, Nat.add_sub_cancel']
| .inr h => simp [h, Nat.sub_eq_zero_of_le, Array.extract_empty_of_stop_le_start]
@[simp] theorem size_extract (a : ByteArray) (start stop) :
(a.extract start stop).size = min stop a.size - start := by
simp [size]
| .lake/packages/batteries/Batteries/Data/ByteArray.lean | 102 | 105 | theorem get_extract_aux {a : ByteArray} {start stop} (h : i < (a.extract start stop).size) :
start + i < a.size := by |
apply Nat.add_lt_of_lt_sub'; apply Nat.lt_of_lt_of_le h
rw [size_extract, β Nat.sub_min_sub_right]; exact Nat.min_le_right ..
| [
" βi < (a.set i v).size",
" (a ++ b).data = a.data ++ b.data",
" (a.append b).data = a.data ++ b.data",
" a.data ++ b.data ++ a.data.extract (a.data.size + b.data.size) a.data.size = a.data ++ b.data",
" (a ++ b).size = a.size + b.size",
" (a.data ++ b.data).size = a.data.size + b.data.size",
" (a ++ b)... | [
" βi < (a.set i v).size",
" (a ++ b).data = a.data ++ b.data",
" (a.append b).data = a.data ++ b.data",
" a.data ++ b.data ++ a.data.extract (a.data.size + b.data.size) a.data.size = a.data ++ b.data",
" (a ++ b).size = a.size + b.size",
" (a.data ++ b.data).size = a.data.size + b.data.size",
" (a ++ b)... |
import Mathlib.Analysis.Normed.Order.Lattice
import Mathlib.MeasureTheory.Function.LpSpace
#align_import measure_theory.function.lp_order from "leanprover-community/mathlib"@"5dc275ec639221ca4d5f56938eb966f6ad9bc89f"
set_option linter.uppercaseLean3 false
open TopologicalSpace MeasureTheory
open scoped ENNReal
variable {Ξ± E : Type*} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {p : ββ₯0β}
namespace MeasureTheory
namespace Lp
section Order
variable [NormedLatticeAddCommGroup E]
| Mathlib/MeasureTheory/Function/LpOrder.lean | 41 | 42 | theorem coeFn_le (f g : Lp E p ΞΌ) : f β€α΅[ΞΌ] g β f β€ g := by |
rw [β Subtype.coe_le_coe, β AEEqFun.coeFn_le]
| [
" ββf β€αΆ [ae ΞΌ] ββg β f β€ g"
] | [
" ββf β€αΆ [ae ΞΌ] ββg β f β€ g"
] |
import Mathlib.Data.List.Defs
import Mathlib.Data.Option.Basic
import Mathlib.Data.Nat.Defs
import Mathlib.Init.Data.List.Basic
import Mathlib.Util.AssertExists
-- Make sure we haven't imported `Data.Nat.Order.Basic`
assert_not_exists OrderedSub
namespace List
universe u v
variable {Ξ± : Type u} {Ξ² : Type v} (l : List Ξ±) (x : Ξ±) (xs : List Ξ±) (n : β)
section getD
variable (d : Ξ±)
#align list.nthd_nil List.getD_nilβ -- argument order
#align list.nthd_cons_zero List.getD_cons_zeroβ -- argument order
#align list.nthd_cons_succ List.getD_cons_succβ -- argument order
theorem getD_eq_get {n : β} (hn : n < l.length) : l.getD n d = l.get β¨n, hnβ© := by
induction l generalizing n with
| nil => simp at hn
| cons head tail ih =>
cases n
Β· exact getD_cons_zero
Β· exact ih _
@[simp]
theorem getD_map {n : β} (f : Ξ± β Ξ²) : (map f l).getD n (f d) = f (l.getD n d) := by
induction l generalizing n with
| nil => rfl
| cons head tail ih =>
cases n
Β· rfl
Β· simp [ih]
#align list.nthd_eq_nth_le List.getD_eq_get
theorem getD_eq_default {n : β} (hn : l.length β€ n) : l.getD n d = d := by
induction l generalizing n with
| nil => exact getD_nil
| cons head tail ih =>
cases n
Β· simp at hn
Β· exact ih (Nat.le_of_succ_le_succ hn)
#align list.nthd_eq_default List.getD_eq_defaultβ -- argument order
def decidableGetDNilNe (a : Ξ±) : DecidablePred fun i : β => getD ([] : List Ξ±) i a β a :=
fun _ => isFalse fun H => H getD_nil
#align list.decidable_nthd_nil_ne List.decidableGetDNilNeβ -- argument order
@[simp]
theorem getD_singleton_default_eq (n : β) : [d].getD n d = d := by cases n <;> simp
#align list.nthd_singleton_default_eq List.getD_singleton_default_eqβ -- argument order
@[simp]
theorem getD_replicate_default_eq (r n : β) : (replicate r d).getD n d = d := by
induction r generalizing n with
| zero => simp
| succ n ih => cases n <;> simp [ih]
#align list.nthd_replicate_default_eq List.getD_replicate_default_eqβ -- argument order
theorem getD_append (l l' : List Ξ±) (d : Ξ±) (n : β) (h : n < l.length) :
(l ++ l').getD n d = l.getD n d := by
rw [getD_eq_get _ _ (Nat.lt_of_lt_of_le h (length_append _ _ βΈ Nat.le_add_right _ _)),
get_append _ h, getD_eq_get]
#align list.nthd_append List.getD_appendβ -- argument order
| Mathlib/Data/List/GetD.lean | 89 | 99 | theorem getD_append_right (l l' : List Ξ±) (d : Ξ±) (n : β) (h : l.length β€ n) :
(l ++ l').getD n d = l'.getD (n - l.length) d := by |
cases Nat.lt_or_ge n (l ++ l').length with
| inl h' =>
rw [getD_eq_get (l ++ l') d h', get_append_right, getD_eq_get]
Β· rw [length_append] at h'
exact Nat.sub_lt_left_of_lt_add h h'
Β· exact Nat.not_lt_of_le h
| inr h' =>
rw [getD_eq_default _ _ h', getD_eq_default]
rwa [Nat.le_sub_iff_add_le' h, β length_append]
| [
" l.getD n d = l.get β¨n, hnβ©",
" [].getD n d = [].get β¨n, hnβ©",
" (head :: tail).getD n d = (head :: tail).get β¨n, hnβ©",
" (head :: tail).getD 0 d = (head :: tail).get β¨0, hnβ©",
" (head :: tail).getD (nβ + 1) d = (head :: tail).get β¨nβ + 1, hnβ©",
" (map f l).getD n (f d) = f (l.getD n d)",
" (map f []).... | [
" l.getD n d = l.get β¨n, hnβ©",
" [].getD n d = [].get β¨n, hnβ©",
" (head :: tail).getD n d = (head :: tail).get β¨n, hnβ©",
" (head :: tail).getD 0 d = (head :: tail).get β¨0, hnβ©",
" (head :: tail).getD (nβ + 1) d = (head :: tail).get β¨nβ + 1, hnβ©",
" (map f l).getD n (f d) = f (l.getD n d)",
" (map f []).... |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.Deriv.Slope
import Mathlib.Analysis.NormedSpace.FiniteDimension
import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
#align_import analysis.calculus.fderiv_measurable from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
set_option linter.uppercaseLean3 false -- A B D
noncomputable section
open Set Metric Asymptotics Filter ContinuousLinearMap MeasureTheory TopologicalSpace
open scoped Topology
section fderiv
variable {π : Type*} [NontriviallyNormedField π]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
variable {f : E β F} (K : Set (E βL[π] F))
section RightDeriv
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace β F]
variable {f : β β F} (K : Set F)
namespace RightDerivMeasurableAux
def A (f : β β F) (L : F) (r Ξ΅ : β) : Set β :=
{ x | β r' β Ioc (r / 2) r, βα΅ (y β Icc x (x + r')) (z β Icc x (x + r')),
βf z - f y - (z - y) β’ Lβ β€ Ξ΅ * r }
#align right_deriv_measurable_aux.A RightDerivMeasurableAux.A
def B (f : β β F) (K : Set F) (r s Ξ΅ : β) : Set β :=
β L β K, A f L r Ξ΅ β© A f L s Ξ΅
#align right_deriv_measurable_aux.B RightDerivMeasurableAux.B
def D (f : β β F) (K : Set F) : Set β :=
β e : β, β n : β, β (p β₯ n) (q β₯ n), B f K ((1 / 2) ^ p) ((1 / 2) ^ q) ((1 / 2) ^ e)
#align right_deriv_measurable_aux.D RightDerivMeasurableAux.D
theorem A_mem_nhdsWithin_Ioi {L : F} {r Ξ΅ x : β} (hx : x β A f L r Ξ΅) : A f L r Ξ΅ β π[>] x := by
rcases hx with β¨r', rr', hr'β©
rw [mem_nhdsWithin_Ioi_iff_exists_Ioo_subset]
obtain β¨s, s_gt, s_ltβ© : β s : β, r / 2 < s β§ s < r' := exists_between rr'.1
have : s β Ioc (r / 2) r := β¨s_gt, le_of_lt (s_lt.trans_le rr'.2)β©
refine β¨x + r' - s, by simp only [mem_Ioi]; linarith, fun x' hx' => β¨s, this, ?_β©β©
have A : Icc x' (x' + s) β Icc x (x + r') := by
apply Icc_subset_Icc hx'.1.le
linarith [hx'.2]
intro y hy z hz
exact hr' y (A hy) z (A hz)
#align right_deriv_measurable_aux.A_mem_nhds_within_Ioi RightDerivMeasurableAux.A_mem_nhdsWithin_Ioi
theorem B_mem_nhdsWithin_Ioi {K : Set F} {r s Ξ΅ x : β} (hx : x β B f K r s Ξ΅) :
B f K r s Ξ΅ β π[>] x := by
obtain β¨L, LK, hLβ, hLββ© : β L : F, L β K β§ x β A f L r Ξ΅ β§ x β A f L s Ξ΅ := by
simpa only [B, mem_iUnion, mem_inter_iff, exists_prop] using hx
filter_upwards [A_mem_nhdsWithin_Ioi hLβ, A_mem_nhdsWithin_Ioi hLβ] with y hyβ hyβ
simp only [B, mem_iUnion, mem_inter_iff, exists_prop]
exact β¨L, LK, hyβ, hyββ©
#align right_deriv_measurable_aux.B_mem_nhds_within_Ioi RightDerivMeasurableAux.B_mem_nhdsWithin_Ioi
theorem measurableSet_B {K : Set F} {r s Ξ΅ : β} : MeasurableSet (B f K r s Ξ΅) :=
measurableSet_of_mem_nhdsWithin_Ioi fun _ hx => B_mem_nhdsWithin_Ioi hx
#align right_deriv_measurable_aux.measurable_set_B RightDerivMeasurableAux.measurableSet_B
theorem A_mono (L : F) (r : β) {Ξ΅ Ξ΄ : β} (h : Ξ΅ β€ Ξ΄) : A f L r Ξ΅ β A f L r Ξ΄ := by
rintro x β¨r', r'r, hr'β©
refine β¨r', r'r, fun y hy z hz => (hr' y hy z hz).trans (mul_le_mul_of_nonneg_right h ?_)β©
linarith [hy.1, hy.2, r'r.2]
#align right_deriv_measurable_aux.A_mono RightDerivMeasurableAux.A_mono
theorem le_of_mem_A {r Ξ΅ : β} {L : F} {x : β} (hx : x β A f L r Ξ΅) {y z : β}
(hy : y β Icc x (x + r / 2)) (hz : z β Icc x (x + r / 2)) :
βf z - f y - (z - y) β’ Lβ β€ Ξ΅ * r := by
rcases hx with β¨r', r'mem, hr'β©
have A : x + r / 2 β€ x + r' := by linarith [r'mem.1]
exact hr' _ ((Icc_subset_Icc le_rfl A) hy) _ ((Icc_subset_Icc le_rfl A) hz)
#align right_deriv_measurable_aux.le_of_mem_A RightDerivMeasurableAux.le_of_mem_A
| Mathlib/Analysis/Calculus/FDeriv/Measurable.lean | 513 | 538 | theorem mem_A_of_differentiable {Ξ΅ : β} (hΞ΅ : 0 < Ξ΅) {x : β}
(hx : DifferentiableWithinAt β f (Ici x) x) :
β R > 0, β r β Ioo (0 : β) R, x β A f (derivWithin f (Ici x) x) r Ξ΅ := by |
have := hx.hasDerivWithinAt
simp_rw [hasDerivWithinAt_iff_isLittleO, isLittleO_iff] at this
rcases mem_nhdsWithin_Ici_iff_exists_Ico_subset.1 (this (half_pos hΞ΅)) with β¨m, xm, hmβ©
refine β¨m - x, by linarith [show x < m from xm], fun r hr => ?_β©
have : r β Ioc (r / 2) r := β¨half_lt_self hr.1, le_rflβ©
refine β¨r, this, fun y hy z hz => ?_β©
calc
βf z - f y - (z - y) β’ derivWithin f (Ici x) xβ =
βf z - f x - (z - x) β’ derivWithin f (Ici x) x -
(f y - f x - (y - x) β’ derivWithin f (Ici x) x)β := by
congr 1; simp only [sub_smul]; abel
_ β€
βf z - f x - (z - x) β’ derivWithin f (Ici x) xβ +
βf y - f x - (y - x) β’ derivWithin f (Ici x) xβ :=
(norm_sub_le _ _)
_ β€ Ξ΅ / 2 * βz - xβ + Ξ΅ / 2 * βy - xβ :=
(add_le_add (hm β¨hz.1, hz.2.trans_lt (by linarith [hr.2])β©)
(hm β¨hy.1, hy.2.trans_lt (by linarith [hr.2])β©))
_ β€ Ξ΅ / 2 * r + Ξ΅ / 2 * r := by
gcongr
Β· rw [Real.norm_of_nonneg] <;> linarith [hz.1, hz.2]
Β· rw [Real.norm_of_nonneg] <;> linarith [hy.1, hy.2]
_ = Ξ΅ * r := by ring
| [
" A f L r Ξ΅ β π[>] x",
" β u β Ioi x, Ioo x u β A f L r Ξ΅",
" x + r' - s β Ioi x",
" x < x + r' - s",
" β y β Icc x' (x' + s), β z β Icc x' (x' + s), βf z - f y - (z - y) β’ Lβ β€ Ξ΅ * r",
" Icc x' (x' + s) β Icc x (x + r')",
" x' + s β€ x + r'",
" βf z - f y - (z - y) β’ Lβ β€ Ξ΅ * r",
" B f K r s Ξ΅ β π... | [
" A f L r Ξ΅ β π[>] x",
" β u β Ioi x, Ioo x u β A f L r Ξ΅",
" x + r' - s β Ioi x",
" x < x + r' - s",
" β y β Icc x' (x' + s), β z β Icc x' (x' + s), βf z - f y - (z - y) β’ Lβ β€ Ξ΅ * r",
" Icc x' (x' + s) β Icc x (x + r')",
" x' + s β€ x + r'",
" βf z - f y - (z - y) β’ Lβ β€ Ξ΅ * r",
" B f K r s Ξ΅ β π... |
import Mathlib.Topology.MetricSpace.Isometry
#align_import topology.metric_space.gluing from "leanprover-community/mathlib"@"e1a7bdeb4fd826b7e71d130d34988f0a2d26a177"
noncomputable section
universe u v w
open Function Set Uniformity Topology
namespace Metric
namespace Sigma
variable {ΞΉ : Type*} {E : ΞΉ β Type*} [β i, MetricSpace (E i)]
open scoped Classical
protected def dist : (Ξ£ i, E i) β (Ξ£ i, E i) β β
| β¨i, xβ©, β¨j, yβ© =>
if h : i = j then
haveI : E j = E i := by rw [h]
Dist.dist x (cast this y)
else Dist.dist x (Nonempty.some β¨xβ©) + 1 + Dist.dist (Nonempty.some β¨yβ©) y
#align metric.sigma.dist Metric.Sigma.dist
def instDist : Dist (Ξ£i, E i) :=
β¨Sigma.distβ©
#align metric.sigma.has_dist Metric.Sigma.instDist
attribute [local instance] Sigma.instDist
@[simp]
theorem dist_same (i : ΞΉ) (x y : E i) : dist (Sigma.mk i x) β¨i, yβ© = dist x y := by
simp [Dist.dist, Sigma.dist]
#align metric.sigma.dist_same Metric.Sigma.dist_same
@[simp]
theorem dist_ne {i j : ΞΉ} (h : i β j) (x : E i) (y : E j) :
dist (β¨i, xβ© : Ξ£k, E k) β¨j, yβ© = dist x (Nonempty.some β¨xβ©) + 1 + dist (Nonempty.some β¨yβ©) y :=
dif_neg h
#align metric.sigma.dist_ne Metric.Sigma.dist_ne
theorem one_le_dist_of_ne {i j : ΞΉ} (h : i β j) (x : E i) (y : E j) :
1 β€ dist (β¨i, xβ© : Ξ£k, E k) β¨j, yβ© := by
rw [Sigma.dist_ne h x y]
linarith [@dist_nonneg _ _ x (Nonempty.some β¨xβ©), @dist_nonneg _ _ (Nonempty.some β¨yβ©) y]
#align metric.sigma.one_le_dist_of_ne Metric.Sigma.one_le_dist_of_ne
| Mathlib/Topology/MetricSpace/Gluing.lean | 358 | 361 | theorem fst_eq_of_dist_lt_one (x y : Ξ£i, E i) (h : dist x y < 1) : x.1 = y.1 := by |
cases x; cases y
contrapose! h
apply one_le_dist_of_ne h
| [
" E j = E i",
" dist β¨i, xβ© β¨i, yβ© = dist x y",
" 1 β€ dist β¨i, xβ© β¨j, yβ©",
" 1 β€ dist x β―.some + 1 + dist β―.some y",
" x.fst = y.fst",
" β¨fstβ, sndββ©.fst = y.fst",
" β¨fstβΒΉ, sndβΒΉβ©.fst = β¨fstβ, sndββ©.fst",
" 1 β€ dist β¨fstβΒΉ, sndβΒΉβ© β¨fstβ, sndββ©"
] | [
" E j = E i",
" dist β¨i, xβ© β¨i, yβ© = dist x y",
" 1 β€ dist β¨i, xβ© β¨j, yβ©",
" 1 β€ dist x β―.some + 1 + dist β―.some y",
" x.fst = y.fst"
] |
import Mathlib.Topology.Order.IsLUB
open Set Filter TopologicalSpace Topology Function
open OrderDual (toDual ofDual)
variable {Ξ± Ξ² Ξ³ : Type*}
section DenselyOrdered
variable [TopologicalSpace Ξ±] [LinearOrder Ξ±] [OrderTopology Ξ±] [DenselyOrdered Ξ±] {a b : Ξ±}
{s : Set Ξ±}
theorem closure_Ioi' {a : Ξ±} (h : (Ioi a).Nonempty) : closure (Ioi a) = Ici a := by
apply Subset.antisymm
Β· exact closure_minimal Ioi_subset_Ici_self isClosed_Ici
Β· rw [β diff_subset_closure_iff, Ici_diff_Ioi_same, singleton_subset_iff]
exact isGLB_Ioi.mem_closure h
#align closure_Ioi' closure_Ioi'
@[simp]
theorem closure_Ioi (a : Ξ±) [NoMaxOrder Ξ±] : closure (Ioi a) = Ici a :=
closure_Ioi' nonempty_Ioi
#align closure_Ioi closure_Ioi
theorem closure_Iio' (h : (Iio a).Nonempty) : closure (Iio a) = Iic a :=
closure_Ioi' (Ξ± := Ξ±α΅α΅) h
#align closure_Iio' closure_Iio'
@[simp]
theorem closure_Iio (a : Ξ±) [NoMinOrder Ξ±] : closure (Iio a) = Iic a :=
closure_Iio' nonempty_Iio
#align closure_Iio closure_Iio
@[simp]
theorem closure_Ioo {a b : Ξ±} (hab : a β b) : closure (Ioo a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ioo_subset_Icc_self isClosed_Icc
Β· cases' hab.lt_or_lt with hab hab
Β· rw [β diff_subset_closure_iff, Icc_diff_Ioo_same hab.le]
have hab' : (Ioo a b).Nonempty := nonempty_Ioo.2 hab
simp only [insert_subset_iff, singleton_subset_iff]
exact β¨(isGLB_Ioo hab).mem_closure hab', (isLUB_Ioo hab).mem_closure hab'β©
Β· rw [Icc_eq_empty_of_lt hab]
exact empty_subset _
#align closure_Ioo closure_Ioo
@[simp]
theorem closure_Ioc {a b : Ξ±} (hab : a β b) : closure (Ioc a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ioc_subset_Icc_self isClosed_Icc
Β· apply Subset.trans _ (closure_mono Ioo_subset_Ioc_self)
rw [closure_Ioo hab]
#align closure_Ioc closure_Ioc
@[simp]
theorem closure_Ico {a b : Ξ±} (hab : a β b) : closure (Ico a b) = Icc a b := by
apply Subset.antisymm
Β· exact closure_minimal Ico_subset_Icc_self isClosed_Icc
Β· apply Subset.trans _ (closure_mono Ioo_subset_Ico_self)
rw [closure_Ioo hab]
#align closure_Ico closure_Ico
@[simp]
theorem interior_Ici' {a : Ξ±} (ha : (Iio a).Nonempty) : interior (Ici a) = Ioi a := by
rw [β compl_Iio, interior_compl, closure_Iio' ha, compl_Iic]
#align interior_Ici' interior_Ici'
theorem interior_Ici [NoMinOrder Ξ±] {a : Ξ±} : interior (Ici a) = Ioi a :=
interior_Ici' nonempty_Iio
#align interior_Ici interior_Ici
@[simp]
theorem interior_Iic' {a : Ξ±} (ha : (Ioi a).Nonempty) : interior (Iic a) = Iio a :=
interior_Ici' (Ξ± := Ξ±α΅α΅) ha
#align interior_Iic' interior_Iic'
theorem interior_Iic [NoMaxOrder Ξ±] {a : Ξ±} : interior (Iic a) = Iio a :=
interior_Iic' nonempty_Ioi
#align interior_Iic interior_Iic
@[simp]
| Mathlib/Topology/Order/DenselyOrdered.lean | 101 | 102 | theorem interior_Icc [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b : Ξ±} : interior (Icc a b) = Ioo a b := by |
rw [β Ici_inter_Iic, interior_inter, interior_Ici, interior_Iic, Ioi_inter_Iio]
| [
" closure (Ioi a) = Ici a",
" closure (Ioi a) β Ici a",
" Ici a β closure (Ioi a)",
" a β closure (Ioi a)",
" closure (Ioo a b) = Icc a b",
" closure (Ioo a b) β Icc a b",
" Icc a b β closure (Ioo a b)",
" {a, b} β closure (Ioo a b)",
" a β closure (Ioo a b) β§ b β closure (Ioo a b)",
" β
β closure... | [
" closure (Ioi a) = Ici a",
" closure (Ioi a) β Ici a",
" Ici a β closure (Ioi a)",
" a β closure (Ioi a)",
" closure (Ioo a b) = Icc a b",
" closure (Ioo a b) β Icc a b",
" Icc a b β closure (Ioo a b)",
" {a, b} β closure (Ioo a b)",
" a β closure (Ioo a b) β§ b β closure (Ioo a b)",
" β
β closure... |
import Mathlib.Topology.Order
#align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d"
open Set Filter Function
open TopologicalSpace Topology Filter
variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β Y} {g : Y β Z}
section Inducing
variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]
theorem inducing_induced (f : X β Y) : @Inducing X Y (TopologicalSpace.induced f βΉ_βΊ) _ f :=
@Inducing.mk _ _ (TopologicalSpace.induced f βΉ_βΊ) _ _ rfl
theorem inducing_id : Inducing (@id X) :=
β¨induced_id.symmβ©
#align inducing_id inducing_id
protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) :
Inducing (g β f) :=
β¨by rw [hf.induced, hg.induced, induced_compose]β©
#align inducing.comp Inducing.comp
theorem Inducing.of_comp_iff (hg : Inducing g) :
Inducing (g β f) β Inducing f := by
refine β¨fun h β¦ ?_, hg.compβ©
rw [inducing_iff, hg.induced, induced_compose, h.induced]
#align inducing.inducing_iff Inducing.of_comp_iff
theorem inducing_of_inducing_compose
(hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g β f)) : Inducing f :=
β¨le_antisymm (by rwa [β continuous_iff_le_induced])
(by
rw [hgf.induced, β induced_compose]
exact induced_mono hg.le_induced)β©
#align inducing_of_inducing_compose inducing_of_inducing_compose
theorem inducing_iff_nhds : Inducing f β β x, π x = comap f (π (f x)) :=
(inducing_iff _).trans (induced_iff_nhds_eq f)
#align inducing_iff_nhds inducing_iff_nhds
namespace Inducing
theorem nhds_eq_comap (hf : Inducing f) : β x : X, π x = comap f (π <| f x) :=
inducing_iff_nhds.1 hf
#align inducing.nhds_eq_comap Inducing.nhds_eq_comap
theorem basis_nhds {p : ΞΉ β Prop} {s : ΞΉ β Set Y} (hf : Inducing f) {x : X}
(h_basis : (π (f x)).HasBasis p s) : (π x).HasBasis p (preimage f β s) :=
hf.nhds_eq_comap x βΈ h_basis.comap f
theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) :
πΛ’ s = comap f (πΛ’ (f '' s)) := by
simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image]
#align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap
theorem map_nhds_eq (hf : Inducing f) (x : X) : (π x).map f = π[range f] f x :=
hf.induced.symm βΈ map_nhds_induced_eq x
#align inducing.map_nhds_eq Inducing.map_nhds_eq
theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f β π (f x)) :
(π x).map f = π (f x) :=
hf.induced.symm βΈ map_nhds_induced_of_mem h
#align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem
-- Porting note (#10756): new lemma
theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} :
MapClusterPt (f x) l f β ClusterPt x l := by
delta MapClusterPt ClusterPt
rw [β Filter.push_pull', β hf.nhds_eq_comap, map_neBot_iff]
theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s β π x) :
f '' s β π[range f] f x :=
hf.map_nhds_eq x βΈ image_mem_map hs
#align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin
theorem tendsto_nhds_iff {f : ΞΉ β Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) :
Tendsto f l (π y) β Tendsto (g β f) l (π (g y)) := by
rw [hg.nhds_eq_comap, tendsto_comap_iff]
#align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff
theorem continuousAt_iff (hg : Inducing g) {x : X} :
ContinuousAt f x β ContinuousAt (g β f) x :=
hg.tendsto_nhds_iff
#align inducing.continuous_at_iff Inducing.continuousAt_iff
theorem continuous_iff (hg : Inducing g) :
Continuous f β Continuous (g β f) := by
simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff]
#align inducing.continuous_iff Inducing.continuous_iff
theorem continuousAt_iff' (hf : Inducing f) {x : X} (h : range f β π (f x)) :
ContinuousAt (g β f) x β ContinuousAt g (f x) := by
simp_rw [ContinuousAt, Filter.Tendsto, β hf.map_nhds_of_mem _ h, Filter.map_map, comp]
#align inducing.continuous_at_iff' Inducing.continuousAt_iff'
protected theorem continuous (hf : Inducing f) : Continuous f :=
hf.continuous_iff.mp continuous_id
#align inducing.continuous Inducing.continuous
| Mathlib/Topology/Maps.lean | 146 | 149 | theorem closure_eq_preimage_closure_image (hf : Inducing f) (s : Set X) :
closure s = f β»ΒΉ' closure (f '' s) := by |
ext x
rw [Set.mem_preimage, β closure_induced, hf.induced]
| [
" instβΒ² = TopologicalSpace.induced (g β f) instβ",
" Inducing (g β f) β Inducing f",
" Inducing f",
" instβΒ² β€ induced f instβΒΉ",
" induced f instβΒΉ β€ instβΒ²",
" induced f instβΒΉ β€ induced f (induced g instβ)",
" πΛ’ s = comap f (πΛ’ (f '' s))",
" MapClusterPt (f x) l f β ClusterPt x l",
" (π (f x... | [
" instβΒ² = TopologicalSpace.induced (g β f) instβ",
" Inducing (g β f) β Inducing f",
" Inducing f",
" instβΒ² β€ induced f instβΒΉ",
" induced f instβΒΉ β€ instβΒ²",
" induced f instβΒΉ β€ induced f (induced g instβ)",
" πΛ’ s = comap f (πΛ’ (f '' s))",
" MapClusterPt (f x) l f β ClusterPt x l",
" (π (f x... |
import Mathlib.RingTheory.TensorProduct.Basic
import Mathlib.Algebra.Module.ULift
#align_import ring_theory.is_tensor_product from "leanprover-community/mathlib"@"c4926d76bb9c5a4a62ed2f03d998081786132105"
universe u vβ vβ vβ vβ
open TensorProduct
section IsTensorProduct
variable {R : Type*} [CommSemiring R]
variable {Mβ Mβ M M' : Type*}
variable [AddCommMonoid Mβ] [AddCommMonoid Mβ] [AddCommMonoid M] [AddCommMonoid M']
variable [Module R Mβ] [Module R Mβ] [Module R M] [Module R M']
variable (f : Mβ ββ[R] Mβ ββ[R] M)
variable {Nβ Nβ N : Type*} [AddCommMonoid Nβ] [AddCommMonoid Nβ] [AddCommMonoid N]
variable [Module R Nβ] [Module R Nβ] [Module R N]
variable {g : Nβ ββ[R] Nβ ββ[R] N}
def IsTensorProduct : Prop :=
Function.Bijective (TensorProduct.lift f)
#align is_tensor_product IsTensorProduct
variable (R M N) {f}
theorem TensorProduct.isTensorProduct : IsTensorProduct (TensorProduct.mk R M N) := by
delta IsTensorProduct
convert_to Function.Bijective (LinearMap.id : M β[R] N ββ[R] M β[R] N) using 2
Β· apply TensorProduct.ext'
simp
Β· exact Function.bijective_id
#align tensor_product.is_tensor_product TensorProduct.isTensorProduct
variable {R M N}
@[simps! apply]
noncomputable def IsTensorProduct.equiv (h : IsTensorProduct f) : Mβ β[R] Mβ ββ[R] M :=
LinearEquiv.ofBijective _ h
#align is_tensor_product.equiv IsTensorProduct.equiv
@[simp]
theorem IsTensorProduct.equiv_toLinearMap (h : IsTensorProduct f) :
h.equiv.toLinearMap = TensorProduct.lift f :=
rfl
#align is_tensor_product.equiv_to_linear_map IsTensorProduct.equiv_toLinearMap
@[simp]
theorem IsTensorProduct.equiv_symm_apply (h : IsTensorProduct f) (xβ : Mβ) (xβ : Mβ) :
h.equiv.symm (f xβ xβ) = xβ ββ xβ := by
apply h.equiv.injective
refine (h.equiv.apply_symm_apply _).trans ?_
simp
#align is_tensor_product.equiv_symm_apply IsTensorProduct.equiv_symm_apply
noncomputable def IsTensorProduct.lift (h : IsTensorProduct f) (f' : Mβ ββ[R] Mβ ββ[R] M') :
M ββ[R] M' :=
(TensorProduct.lift f').comp h.equiv.symm.toLinearMap
#align is_tensor_product.lift IsTensorProduct.lift
theorem IsTensorProduct.lift_eq (h : IsTensorProduct f) (f' : Mβ ββ[R] Mβ ββ[R] M') (xβ : Mβ)
(xβ : Mβ) : h.lift f' (f xβ xβ) = f' xβ xβ := by
delta IsTensorProduct.lift
simp
#align is_tensor_product.lift_eq IsTensorProduct.lift_eq
noncomputable def IsTensorProduct.map (hf : IsTensorProduct f) (hg : IsTensorProduct g)
(iβ : Mβ ββ[R] Nβ) (iβ : Mβ ββ[R] Nβ) : M ββ[R] N :=
hg.equiv.toLinearMap.comp ((TensorProduct.map iβ iβ).comp hf.equiv.symm.toLinearMap)
#align is_tensor_product.map IsTensorProduct.map
| Mathlib/RingTheory/IsTensorProduct.lean | 109 | 112 | theorem IsTensorProduct.map_eq (hf : IsTensorProduct f) (hg : IsTensorProduct g) (iβ : Mβ ββ[R] Nβ)
(iβ : Mβ ββ[R] Nβ) (xβ : Mβ) (xβ : Mβ) : hf.map hg iβ iβ (f xβ xβ) = g (iβ xβ) (iβ xβ) := by |
delta IsTensorProduct.map
simp
| [
" IsTensorProduct (mk R M N)",
" Function.Bijective β(lift (mk R M N))",
" lift (mk R M N) = LinearMap.id",
" β (x : M) (y : N), (lift (mk R M N)) (x ββ[R] y) = LinearMap.id (x ββ[R] y)",
" Function.Bijective βLinearMap.id",
" h.equiv.symm ((f xβ) xβ) = xβ ββ[R] xβ",
" h.equiv (h.equiv.symm ((f xβ) xβ))... | [
" IsTensorProduct (mk R M N)",
" Function.Bijective β(lift (mk R M N))",
" lift (mk R M N) = LinearMap.id",
" β (x : M) (y : N), (lift (mk R M N)) (x ββ[R] y) = LinearMap.id (x ββ[R] y)",
" Function.Bijective βLinearMap.id",
" h.equiv.symm ((f xβ) xβ) = xβ ββ[R] xβ",
" h.equiv (h.equiv.symm ((f xβ) xβ))... |
import Mathlib.Data.ZMod.Basic
import Mathlib.GroupTheory.Index
import Mathlib.GroupTheory.GroupAction.ConjAct
import Mathlib.GroupTheory.GroupAction.Quotient
import Mathlib.GroupTheory.Perm.Cycle.Type
import Mathlib.GroupTheory.SpecificGroups.Cyclic
import Mathlib.Tactic.IntervalCases
#align_import group_theory.p_group from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
open Fintype MulAction
variable (p : β) (G : Type*) [Group G]
def IsPGroup : Prop :=
β g : G, β k : β, g ^ p ^ k = 1
#align is_p_group IsPGroup
variable {p} {G}
namespace IsPGroup
theorem iff_orderOf [hp : Fact p.Prime] : IsPGroup p G β β g : G, β k : β, orderOf g = p ^ k :=
forall_congr' fun g =>
β¨fun β¨k, hkβ© =>
Exists.imp (fun _ h => h.right)
((Nat.dvd_prime_pow hp.out).mp (orderOf_dvd_of_pow_eq_one hk)),
Exists.imp fun k hk => by rw [β hk, pow_orderOf_eq_one]β©
#align is_p_group.iff_order_of IsPGroup.iff_orderOf
theorem of_card [Fintype G] {n : β} (hG : card G = p ^ n) : IsPGroup p G := fun g =>
β¨n, by rw [β hG, pow_card_eq_one]β©
#align is_p_group.of_card IsPGroup.of_card
theorem of_bot : IsPGroup p (β₯ : Subgroup G) :=
of_card (by rw [β Nat.card_eq_fintype_card, Subgroup.card_bot, pow_zero])
#align is_p_group.of_bot IsPGroup.of_bot
theorem iff_card [Fact p.Prime] [Fintype G] : IsPGroup p G β β n : β, card G = p ^ n := by
have hG : card G β 0 := card_ne_zero
refine β¨fun h => ?_, fun β¨n, hnβ© => of_card hnβ©
suffices β q β Nat.factors (card G), q = p by
use (card G).factors.length
rw [β List.prod_replicate, β List.eq_replicate_of_mem this, Nat.prod_factors hG]
intro q hq
obtain β¨hq1, hq2β© := (Nat.mem_factors hG).mp hq
haveI : Fact q.Prime := β¨hq1β©
obtain β¨g, hgβ© := exists_prime_orderOf_dvd_card q hq2
obtain β¨k, hkβ© := (iff_orderOf.mp h) g
exact (hq1.pow_eq_iff.mp (hg.symm.trans hk).symm).1.symm
#align is_p_group.iff_card IsPGroup.iff_card
alias β¨exists_card_eq, _β© := iff_card
section GIsPGroup
variable (hG : IsPGroup p G)
| Mathlib/GroupTheory/PGroup.lean | 74 | 77 | theorem of_injective {H : Type*} [Group H] (Ο : H β* G) (hΟ : Function.Injective Ο) :
IsPGroup p H := by |
simp_rw [IsPGroup, β hΟ.eq_iff, Ο.map_pow, Ο.map_one]
exact fun h => hG (Ο h)
| [
" g ^ p ^ k = 1",
" g ^ p ^ n = 1",
" card β₯β₯ = p ^ ?m.2806",
" IsPGroup p G β β n, card G = p ^ n",
" β n, card G = p ^ n",
" card G = p ^ (card G).factors.length",
" β q β (card G).factors, q = p",
" q = p",
" IsPGroup p H",
" β (g : H), β k, Ο g ^ p ^ k = 1"
] | [
" g ^ p ^ k = 1",
" g ^ p ^ n = 1",
" card β₯β₯ = p ^ ?m.2806",
" IsPGroup p G β β n, card G = p ^ n",
" β n, card G = p ^ n",
" card G = p ^ (card G).factors.length",
" β q β (card G).factors, q = p",
" q = p",
" IsPGroup p H"
] |
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Data.Rat.Denumerable
import Mathlib.Data.Set.Pointwise.Interval
import Mathlib.SetTheory.Cardinal.Continuum
#align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d"
open Nat Set
open Cardinal
noncomputable section
namespace Cardinal
variable {c : β} {f g : β β Bool} {n : β}
def cantorFunctionAux (c : β) (f : β β Bool) (n : β) : β :=
cond (f n) (c ^ n) 0
#align cardinal.cantor_function_aux Cardinal.cantorFunctionAux
@[simp]
theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by
simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true
@[simp]
theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by
simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false
| Mathlib/Data/Real/Cardinality.lean | 73 | 75 | theorem cantorFunctionAux_nonneg (h : 0 β€ c) : 0 β€ cantorFunctionAux c f n := by |
cases h' : f n <;> simp [h']
apply pow_nonneg h
| [
" cantorFunctionAux c f n = c ^ n",
" cantorFunctionAux c f n = 0",
" 0 β€ cantorFunctionAux c f n",
" 0 β€ c ^ n"
] | [
" cantorFunctionAux c f n = c ^ n",
" cantorFunctionAux c f n = 0",
" 0 β€ cantorFunctionAux c f n"
] |
import Mathlib.Algebra.BigOperators.Intervals
import Mathlib.Topology.Algebra.InfiniteSum.Order
import Mathlib.Topology.Instances.Real
import Mathlib.Topology.Instances.ENNReal
#align_import topology.algebra.infinite_sum.real from "leanprover-community/mathlib"@"9a59dcb7a2d06bf55da57b9030169219980660cd"
open Filter Finset NNReal Topology
variable {Ξ± Ξ² : Type*} [PseudoMetricSpace Ξ±] {f : β β Ξ±} {a : Ξ±}
theorem cauchySeq_of_dist_le_of_summable (d : β β β) (hf : β n, dist (f n) (f n.succ) β€ d n)
(hd : Summable d) : CauchySeq f := by
lift d to β β ββ₯0 using fun n β¦ dist_nonneg.trans (hf n)
apply cauchySeq_of_edist_le_of_summable d (Ξ± := Ξ±) (f := f)
Β· exact_mod_cast hf
Β· exact_mod_cast hd
#align cauchy_seq_of_dist_le_of_summable cauchySeq_of_dist_le_of_summable
theorem cauchySeq_of_summable_dist (h : Summable fun n β¦ dist (f n) (f n.succ)) : CauchySeq f :=
cauchySeq_of_dist_le_of_summable _ (fun _ β¦ le_rfl) h
#align cauchy_seq_of_summable_dist cauchySeq_of_summable_dist
theorem dist_le_tsum_of_dist_le_of_tendsto (d : β β β) (hf : β n, dist (f n) (f n.succ) β€ d n)
(hd : Summable d) {a : Ξ±} (ha : Tendsto f atTop (π a)) (n : β) :
dist (f n) a β€ β' m, d (n + m) := by
refine le_of_tendsto (tendsto_const_nhds.dist ha) (eventually_atTop.2 β¨n, fun m hnm β¦ ?_β©)
refine le_trans (dist_le_Ico_sum_of_dist_le hnm fun _ _ β¦ hf _) ?_
rw [sum_Ico_eq_sum_range]
refine sum_le_tsum (range _) (fun _ _ β¦ le_trans dist_nonneg (hf _)) ?_
exact hd.comp_injective (add_right_injective n)
#align dist_le_tsum_of_dist_le_of_tendsto dist_le_tsum_of_dist_le_of_tendsto
theorem dist_le_tsum_of_dist_le_of_tendstoβ (d : β β β) (hf : β n, dist (f n) (f n.succ) β€ d n)
(hd : Summable d) (ha : Tendsto f atTop (π a)) : dist (f 0) a β€ tsum d := by
simpa only [zero_add] using dist_le_tsum_of_dist_le_of_tendsto d hf hd ha 0
#align dist_le_tsum_of_dist_le_of_tendstoβ dist_le_tsum_of_dist_le_of_tendstoβ
theorem dist_le_tsum_dist_of_tendsto (h : Summable fun n β¦ dist (f n) (f n.succ))
(ha : Tendsto f atTop (π a)) (n) : dist (f n) a β€ β' m, dist (f (n + m)) (f (n + m).succ) :=
show dist (f n) a β€ β' m, (fun x β¦ dist (f x) (f x.succ)) (n + m) from
dist_le_tsum_of_dist_le_of_tendsto (fun n β¦ dist (f n) (f n.succ)) (fun _ β¦ le_rfl) h ha n
#align dist_le_tsum_dist_of_tendsto dist_le_tsum_dist_of_tendsto
theorem dist_le_tsum_dist_of_tendstoβ (h : Summable fun n β¦ dist (f n) (f n.succ))
(ha : Tendsto f atTop (π a)) : dist (f 0) a β€ β' n, dist (f n) (f n.succ) := by
simpa only [zero_add] using dist_le_tsum_dist_of_tendsto h ha 0
#align dist_le_tsum_dist_of_tendstoβ dist_le_tsum_dist_of_tendstoβ
section summable
theorem not_summable_iff_tendsto_nat_atTop_of_nonneg {f : β β β} (hf : β n, 0 β€ f n) :
Β¬Summable f β Tendsto (fun n : β => β i β Finset.range n, f i) atTop atTop := by
lift f to β β ββ₯0 using hf
exact mod_cast NNReal.not_summable_iff_tendsto_nat_atTop
#align not_summable_iff_tendsto_nat_at_top_of_nonneg not_summable_iff_tendsto_nat_atTop_of_nonneg
| Mathlib/Topology/Algebra/InfiniteSum/Real.lean | 73 | 75 | theorem summable_iff_not_tendsto_nat_atTop_of_nonneg {f : β β β} (hf : β n, 0 β€ f n) :
Summable f β Β¬Tendsto (fun n : β => β i β Finset.range n, f i) atTop atTop := by |
rw [β not_iff_not, Classical.not_not, not_summable_iff_tendsto_nat_atTop_of_nonneg hf]
| [
" CauchySeq f",
" β (n : β), edist (f n) (f n.succ) β€ β(d n)",
" Summable d",
" dist (f n) a β€ β' (m : β), d (n + m)",
" dist (f n) (f m) β€ β' (m : β), d (n + m)",
" β i β Ico n m, d i β€ β' (m : β), d (n + m)",
" β k β range (m - n), d (n + k) β€ β' (m : β), d (n + m)",
" Summable fun k => d (n + k)",
... | [
" CauchySeq f",
" β (n : β), edist (f n) (f n.succ) β€ β(d n)",
" Summable d",
" dist (f n) a β€ β' (m : β), d (n + m)",
" dist (f n) (f m) β€ β' (m : β), d (n + m)",
" β i β Ico n m, d i β€ β' (m : β), d (n + m)",
" β k β range (m - n), d (n + k) β€ β' (m : β), d (n + m)",
" Summable fun k => d (n + k)",
... |
import Mathlib.Algebra.Order.Monoid.OrderDual
import Mathlib.Tactic.Lift
import Mathlib.Tactic.Monotonicity.Attr
open Function
variable {Ξ² G M : Type*}
section Monoid
variable [Monoid M]
section Preorder
variable [Preorder M]
section Left
variable [CovariantClass M M (Β· * Β·) (Β· β€ Β·)] {x : M}
@[to_additive (attr := mono, gcongr) nsmul_le_nsmul_right]
theorem pow_le_pow_left' [CovariantClass M M (swap (Β· * Β·)) (Β· β€ Β·)] {a b : M} (hab : a β€ b) :
β i : β, a ^ i β€ b ^ i
| 0 => by simp
| k + 1 => by
rw [pow_succ, pow_succ]
exact mul_le_mul' (pow_le_pow_left' hab k) hab
#align pow_le_pow_of_le_left' pow_le_pow_left'
#align nsmul_le_nsmul_of_le_right nsmul_le_nsmul_right
@[to_additive nsmul_nonneg]
theorem one_le_pow_of_one_le' {a : M} (H : 1 β€ a) : β n : β, 1 β€ a ^ n
| 0 => by simp
| k + 1 => by
rw [pow_succ]
exact one_le_mul (one_le_pow_of_one_le' H k) H
#align one_le_pow_of_one_le' one_le_pow_of_one_le'
#align nsmul_nonneg nsmul_nonneg
@[to_additive nsmul_nonpos]
theorem pow_le_one' {a : M} (H : a β€ 1) (n : β) : a ^ n β€ 1 :=
@one_le_pow_of_one_le' Mα΅α΅ _ _ _ _ H n
#align pow_le_one' pow_le_one'
#align nsmul_nonpos nsmul_nonpos
@[to_additive (attr := gcongr) nsmul_le_nsmul_left]
| Mathlib/Algebra/Order/Monoid/Unbundled/Pow.lean | 56 | 60 | theorem pow_le_pow_right' {a : M} {n m : β} (ha : 1 β€ a) (h : n β€ m) : a ^ n β€ a ^ m :=
let β¨k, hkβ© := Nat.le.dest h
calc
a ^ n β€ a ^ n * a ^ k := le_mul_of_one_le_right' (one_le_pow_of_one_le' ha _)
_ = a ^ m := by | rw [β hk, pow_add]
| [
" a ^ 0 β€ b ^ 0",
" a ^ (k + 1) β€ b ^ (k + 1)",
" a ^ k * a β€ b ^ k * b",
" 1 β€ a ^ 0",
" 1 β€ a ^ (k + 1)",
" 1 β€ a ^ k * a",
" a ^ n * a ^ k = a ^ m"
] | [
" a ^ 0 β€ b ^ 0",
" a ^ (k + 1) β€ b ^ (k + 1)",
" a ^ k * a β€ b ^ k * b",
" 1 β€ a ^ 0",
" 1 β€ a ^ (k + 1)",
" 1 β€ a ^ k * a",
" a ^ n * a ^ k = a ^ m"
] |
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.supported from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
universe u v w
namespace MvPolynomial
variable {Ο Ο : Type*} {R : Type u} {S : Type v} {r : R} {e : β} {n m : Ο}
section CommSemiring
variable [CommSemiring R] {p q : MvPolynomial Ο R}
variable (R)
noncomputable def supported (s : Set Ο) : Subalgebra R (MvPolynomial Ο R) :=
Algebra.adjoin R (X '' s)
#align mv_polynomial.supported MvPolynomial.supported
variable {R}
open Algebra
theorem supported_eq_range_rename (s : Set Ο) : supported R s = (rename ((β) : s β Ο)).range := by
rw [supported, Set.image_eq_range, adjoin_range_eq_range_aeval, rename]
congr
#align mv_polynomial.supported_eq_range_rename MvPolynomial.supported_eq_range_rename
noncomputable def supportedEquivMvPolynomial (s : Set Ο) : supported R s ββ[R] MvPolynomial s R :=
(Subalgebra.equivOfEq _ _ (supported_eq_range_rename s)).trans
(AlgEquiv.ofInjective (rename ((β) : s β Ο)) (rename_injective _ Subtype.val_injective)).symm
#align mv_polynomial.supported_equiv_mv_polynomial MvPolynomial.supportedEquivMvPolynomial
@[simp, nolint simpNF] -- Porting note: the `simpNF` linter complained about this lemma.
| Mathlib/Algebra/MvPolynomial/Supported.lean | 59 | 62 | theorem supportedEquivMvPolynomial_symm_C (s : Set Ο) (x : R) :
(supportedEquivMvPolynomial s).symm (C x) = algebraMap R (supported R s) x := by |
ext1
simp [supportedEquivMvPolynomial, MvPolynomial.algebraMap_eq]
| [
" supported R s = (rename Subtype.val).range",
" (aeval fun x => X βx).range = (aeval (X β Subtype.val)).range",
" (supportedEquivMvPolynomial s).symm (C x) = (algebraMap R β₯(supported R s)) x",
" β((supportedEquivMvPolynomial s).symm (C x)) = β((algebraMap R β₯(supported R s)) x)"
] | [
" supported R s = (rename Subtype.val).range",
" (aeval fun x => X βx).range = (aeval (X β Subtype.val)).range",
" (supportedEquivMvPolynomial s).symm (C x) = (algebraMap R β₯(supported R s)) x"
] |
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*}
theorem powerset_insert (s : Set Ξ±) (a : Ξ±) : π« insert a s = π« s βͺ insert a '' π« s := by
ext t
simp_rw [mem_union, mem_image, mem_powerset_iff]
constructor
Β· intro h
by_cases hs : a β t
Β· right
refine β¨t \ {a}, ?_, ?_β©
Β· rw [diff_singleton_subset_iff]
assumption
Β· rw [insert_diff_singleton, insert_eq_of_mem hs]
Β· left
exact (subset_insert_iff_of_not_mem hs).mp h
Β· rintro (h | β¨s', hβ, rflβ©)
Β· exact subset_trans h (subset_insert a s)
Β· exact insert_subset_insert hβ
#align set.powerset_insert Set.powerset_insert
section Range
variable {f : ΞΉ β Ξ±} {s t : Set Ξ±}
theorem forall_mem_range {p : Ξ± β Prop} : (β a β range f, p a) β β i, p (f i) := by simp
#align set.forall_range_iff Set.forall_mem_range
@[deprecated (since := "2024-02-21")] alias forall_range_iff := forall_mem_range
theorem forall_subtype_range_iff {p : range f β Prop} :
(β a : range f, p a) β β i, p β¨f i, mem_range_self _β© :=
β¨fun H i => H _, fun H β¨y, i, hiβ© => by
subst hi
apply Hβ©
#align set.forall_subtype_range_iff Set.forall_subtype_range_iff
theorem exists_range_iff {p : Ξ± β Prop} : (β a β range f, p a) β β i, p (f i) := by simp
#align set.exists_range_iff Set.exists_range_iff
@[deprecated (since := "2024-03-10")]
alias exists_range_iff' := exists_range_iff
#align set.exists_range_iff' Set.exists_range_iff'
theorem exists_subtype_range_iff {p : range f β Prop} :
(β a : range f, p a) β β i, p β¨f i, mem_range_self _β© :=
β¨fun β¨β¨a, i, hiβ©, haβ© => by
subst a
exact β¨i, haβ©,
fun β¨i, hiβ© => β¨_, hiβ©β©
#align set.exists_subtype_range_iff Set.exists_subtype_range_iff
theorem range_iff_surjective : range f = univ β Surjective f :=
eq_univ_iff_forall
#align set.range_iff_surjective Set.range_iff_surjective
alias β¨_, _root_.Function.Surjective.range_eqβ© := range_iff_surjective
#align function.surjective.range_eq Function.Surjective.range_eq
@[simp]
theorem subset_range_of_surjective {f : Ξ± β Ξ²} (h : Surjective f) (s : Set Ξ²) :
s β range f := Surjective.range_eq h βΈ subset_univ s
@[simp]
| Mathlib/Data/Set/Image.lean | 693 | 695 | theorem image_univ {f : Ξ± β Ξ²} : f '' univ = range f := by |
ext
simp [image, range]
| [
" π« insert a s = π« s βͺ insert a '' π« s",
" t β π« insert a s β t β π« s βͺ insert a '' π« s",
" t β insert a s β t β s β¨ β x β s, insert a x = t",
" t β insert a s β t β s β¨ β x β s, insert a x = t",
" t β s β¨ β x β s, insert a x = t",
" β x β s, insert a x = t",
" t \\ {a} β s",
" t β insert a s",
... | [
" π« insert a s = π« s βͺ insert a '' π« s",
" t β π« insert a s β t β π« s βͺ insert a '' π« s",
" t β insert a s β t β s β¨ β x β s, insert a x = t",
" t β insert a s β t β s β¨ β x β s, insert a x = t",
" t β s β¨ β x β s, insert a x = t",
" β x β s, insert a x = t",
" t \\ {a} β s",
" t β insert a s",
... |
import Mathlib.Control.Functor.Multivariate
import Mathlib.Data.PFunctor.Multivariate.Basic
import Mathlib.Data.PFunctor.Multivariate.M
import Mathlib.Data.QPF.Multivariate.Basic
#align_import data.qpf.multivariate.constructions.cofix from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u
open MvFunctor
namespace MvQPF
open TypeVec MvPFunctor
open MvFunctor (LiftP LiftR)
variable {n : β} {F : TypeVec.{u} (n + 1) β Type u} [mvf : MvFunctor F] [q : MvQPF F]
def corecF {Ξ± : TypeVec n} {Ξ² : Type u} (g : Ξ² β F (Ξ±.append1 Ξ²)) : Ξ² β q.P.M Ξ± :=
M.corec _ fun x => repr (g x)
set_option linter.uppercaseLean3 false in
#align mvqpf.corecF MvQPF.corecF
| Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean | 64 | 66 | theorem corecF_eq {Ξ± : TypeVec n} {Ξ² : Type u} (g : Ξ² β F (Ξ±.append1 Ξ²)) (x : Ξ²) :
M.dest q.P (corecF g x) = appendFun id (corecF g) <$$> repr (g x) := by |
rw [corecF, M.dest_corec]
| [
" M.dest (P F) (corecF g x) = (TypeVec.id ::: corecF g) <$$> repr (g x)"
] | [
" M.dest (P F) (corecF g x) = (TypeVec.id ::: corecF g) <$$> repr (g x)"
] |
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.add_torsor from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
class AddTorsor (G : outParam Type*) (P : Type*) [AddGroup G] extends AddAction G P,
VSub G P where
[nonempty : Nonempty P]
vsub_vadd' : β pβ pβ : P, (pβ -α΅₯ pβ : G) +α΅₯ pβ = pβ
vadd_vsub' : β (g : G) (p : P), g +α΅₯ p -α΅₯ p = g
#align add_torsor AddTorsor
-- Porting note(#12096): removed `nolint instance_priority`; lint not ported yet
attribute [instance 100] AddTorsor.nonempty
-- Porting note(#12094): removed nolint; dangerous_instance linter not ported yet
--attribute [nolint dangerous_instance] AddTorsor.toVSub
-- Porting note(#12096): linter not ported yet
--@[nolint instance_priority]
instance addGroupIsAddTorsor (G : Type*) [AddGroup G] : AddTorsor G G where
vsub := Sub.sub
vsub_vadd' := sub_add_cancel
vadd_vsub' := add_sub_cancel_right
#align add_group_is_add_torsor addGroupIsAddTorsor
@[simp]
theorem vsub_eq_sub {G : Type*} [AddGroup G] (gβ gβ : G) : gβ -α΅₯ gβ = gβ - gβ :=
rfl
#align vsub_eq_sub vsub_eq_sub
section General
variable {G : Type*} {P : Type*} [AddGroup G] [T : AddTorsor G P]
@[simp]
theorem vsub_vadd (pβ pβ : P) : pβ -α΅₯ pβ +α΅₯ pβ = pβ :=
AddTorsor.vsub_vadd' pβ pβ
#align vsub_vadd vsub_vadd
@[simp]
theorem vadd_vsub (g : G) (p : P) : g +α΅₯ p -α΅₯ p = g :=
AddTorsor.vadd_vsub' g p
#align vadd_vsub vadd_vsub
theorem vadd_right_cancel {gβ gβ : G} (p : P) (h : gβ +α΅₯ p = gβ +α΅₯ p) : gβ = gβ := by
-- Porting note: vadd_vsub gβ β vadd_vsub gβ p
rw [β vadd_vsub gβ p, h, vadd_vsub]
#align vadd_right_cancel vadd_right_cancel
@[simp]
theorem vadd_right_cancel_iff {gβ gβ : G} (p : P) : gβ +α΅₯ p = gβ +α΅₯ p β gβ = gβ :=
β¨vadd_right_cancel p, fun h => h βΈ rflβ©
#align vadd_right_cancel_iff vadd_right_cancel_iff
theorem vadd_right_injective (p : P) : Function.Injective ((Β· +α΅₯ p) : G β P) := fun _ _ =>
vadd_right_cancel p
#align vadd_right_injective vadd_right_injective
| Mathlib/Algebra/AddTorsor.lean | 117 | 119 | theorem vadd_vsub_assoc (g : G) (pβ pβ : P) : g +α΅₯ pβ -α΅₯ pβ = g + (pβ -α΅₯ pβ) := by |
apply vadd_right_cancel pβ
rw [vsub_vadd, add_vadd, vsub_vadd]
| [
" gβ = gβ",
" g +α΅₯ pβ -α΅₯ pβ = g + (pβ -α΅₯ pβ)",
" g +α΅₯ pβ -α΅₯ pβ +α΅₯ pβ = g + (pβ -α΅₯ pβ) +α΅₯ pβ"
] | [
" gβ = gβ",
" g +α΅₯ pβ -α΅₯ pβ = g + (pβ -α΅₯ pβ)"
] |
import Mathlib.RingTheory.PowerSeries.Trunc
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.Derivation.Basic
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
noncomputable def derivativeFun (f : Rβ¦Xβ§) : Rβ¦Xβ§ := mk fun n β¦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : Rβ¦Xβ§) (n : β) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : Rβ¦Xβ§).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : Rβ¦Xβ§) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
-- Note that `map_zero` didn't get picked up, apparently due to a missing `FunLike.coe`
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, (coeff R n).map_zero]
theorem trunc_derivativeFun (f : Rβ¦Xβ§) (n : β) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
Β· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
Β· have : Β¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : Rβ¦Xβ§) =
f * derivative g + g * derivative f := by
rw [β coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, β coe_mul, β coe_mul, Polynomial.coe_add]
| Mathlib/RingTheory/PowerSeries/Derivative.lean | 77 | 85 | theorem derivativeFun_mul (f g : Rβ¦Xβ§) :
derivativeFun (f * g) = f β’ g.derivativeFun + g β’ f.derivativeFun := by |
ext n
have hβ : n < n + 1 := lt_succ_self n
have hβ : n < n + 1 + 1 := Nat.lt_add_right _ hβ
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_truncβ g f.derivativeFun hβ hβ,
coeff_mul_eq_coeff_trunc_mul_truncβ f g.derivativeFun hβ hβ, trunc_derivativeFun,
trunc_derivativeFun, β map_add, β derivativeFun_coe_mul_coe, coeff_derivativeFun]
| [
" (coeff R n) f.derivativeFun = (coeff R (n + 1)) f * (βn + 1)",
" (βf).derivativeFun = β(derivative f)",
" (coeff R nβ) (βf).derivativeFun = (coeff R nβ) β(derivative f)",
" (f + g).derivativeFun = f.derivativeFun + g.derivativeFun",
" (coeff R nβ) (f + g).derivativeFun = (coeff R nβ) (f.derivativeFun + g.... | [
" (coeff R n) f.derivativeFun = (coeff R (n + 1)) f * (βn + 1)",
" (βf).derivativeFun = β(derivative f)",
" (coeff R nβ) (βf).derivativeFun = (coeff R nβ) β(derivative f)",
" (f + g).derivativeFun = f.derivativeFun + g.derivativeFun",
" (coeff R nβ) (f + g).derivativeFun = (coeff R nβ) (f.derivativeFun + g.... |
import Mathlib.Algebra.Group.Hom.Defs
import Mathlib.Algebra.Group.Units
#align_import algebra.hom.units from "leanprover-community/mathlib"@"a07d750983b94c530ab69a726862c2ab6802b38c"
assert_not_exists MonoidWithZero
assert_not_exists DenselyOrdered
open Function
universe u v w
namespace Units
variable {Ξ± : Type*} {M : Type u} {N : Type v} {P : Type w} [Monoid M] [Monoid N] [Monoid P]
@[to_additive "The additive homomorphism on `AddUnit`s induced by an `AddMonoidHom`."]
def map (f : M β* N) : MΛ£ β* NΛ£ :=
MonoidHom.mk'
(fun u => β¨f u.val, f u.inv,
by rw [β f.map_mul, u.val_inv, f.map_one],
by rw [β f.map_mul, u.inv_val, f.map_one]β©)
fun x y => ext (f.map_mul x y)
#align units.map Units.map
#align add_units.map AddUnits.map
@[to_additive (attr := simp)]
theorem coe_map (f : M β* N) (x : MΛ£) : β(map f x) = f x := rfl
#align units.coe_map Units.coe_map
#align add_units.coe_map AddUnits.coe_map
@[to_additive (attr := simp)]
theorem coe_map_inv (f : M β* N) (u : MΛ£) : β(map f u)β»ΒΉ = f βuβ»ΒΉ := rfl
#align units.coe_map_inv Units.coe_map_inv
#align add_units.coe_map_neg AddUnits.coe_map_neg
@[to_additive (attr := simp)]
theorem map_comp (f : M β* N) (g : N β* P) : map (g.comp f) = (map g).comp (map f) := rfl
#align units.map_comp Units.map_comp
#align add_units.map_comp AddUnits.map_comp
@[to_additive]
lemma map_injective {f : M β* N} (hf : Function.Injective f) :
Function.Injective (map f) := fun _ _ e => ext (hf (congr_arg val e))
variable (M)
@[to_additive (attr := simp)]
theorem map_id : map (MonoidHom.id M) = MonoidHom.id MΛ£ := by ext; rfl
#align units.map_id Units.map_id
#align add_units.map_id AddUnits.map_id
@[to_additive "Coercion `AddUnits M β M` as an AddMonoid homomorphism."]
def coeHom : MΛ£ β* M where
toFun := Units.val; map_one' := val_one; map_mul' := val_mul
#align units.coe_hom Units.coeHom
#align add_units.coe_hom AddUnits.coeHom
variable {M}
@[to_additive (attr := simp)]
theorem coeHom_apply (x : MΛ£) : coeHom M x = βx := rfl
#align units.coe_hom_apply Units.coeHom_apply
#align add_units.coe_hom_apply AddUnits.coeHom_apply
namespace IsUnit
variable {F G Ξ± M N : Type*} [FunLike F M N] [FunLike G N M]
section Monoid
variable [Monoid M] [Monoid N]
@[to_additive]
| Mathlib/Algebra/Group/Units/Hom.lean | 198 | 199 | theorem map [MonoidHomClass F M N] (f : F) {x : M} (h : IsUnit x) : IsUnit (f x) := by |
rcases h with β¨y, rflβ©; exact (Units.map (f : M β* N) y).isUnit
| [
" f βu * f u.inv = 1",
" f u.inv * f βu = 1",
" map (MonoidHom.id M) = MonoidHom.id MΛ£",
" β((map (MonoidHom.id M)) xβ) = β((MonoidHom.id MΛ£) xβ)",
" IsUnit (f x)",
" IsUnit (f βy)"
] | [
" f βu * f u.inv = 1",
" f u.inv * f βu = 1",
" map (MonoidHom.id M) = MonoidHom.id MΛ£",
" β((map (MonoidHom.id M)) xβ) = β((MonoidHom.id MΛ£) xβ)",
" IsUnit (f x)"
] |
import Mathlib.Topology.GDelta
import Mathlib.MeasureTheory.Group.Arithmetic
import Mathlib.Topology.Instances.EReal
import Mathlib.Analysis.Normed.Group.Basic
#align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce"
noncomputable section
open Set Filter MeasureTheory
open scoped Classical Topology NNReal ENNReal MeasureTheory
universe u v w x y
variable {Ξ± Ξ² Ξ³ Ξ³β Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±}
open MeasurableSpace TopologicalSpace
def borel (Ξ± : Type u) [TopologicalSpace Ξ±] : MeasurableSpace Ξ± :=
generateFrom { s : Set Ξ± | IsOpen s }
#align borel borel
theorem borel_anti : Antitone (@borel Ξ±) := fun _ _ h =>
MeasurableSpace.generateFrom_le fun _ hs => .basic _ (h _ hs)
#align borel_anti borel_anti
theorem borel_eq_top_of_discrete [TopologicalSpace Ξ±] [DiscreteTopology Ξ±] : borel Ξ± = β€ :=
top_le_iff.1 fun s _ => GenerateMeasurable.basic s (isOpen_discrete s)
#align borel_eq_top_of_discrete borel_eq_top_of_discrete
| Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean | 63 | 69 | theorem borel_eq_top_of_countable [TopologicalSpace Ξ±] [T1Space Ξ±] [Countable Ξ±] : borel Ξ± = β€ := by |
refine top_le_iff.1 fun s _ => biUnion_of_singleton s βΈ ?_
apply MeasurableSet.biUnion s.to_countable
intro x _
apply MeasurableSet.of_compl
apply GenerateMeasurable.basic
exact isClosed_singleton.isOpen_compl
| [
" borel Ξ± = β€",
" MeasurableSet (β x β s, {x})",
" β b β s, MeasurableSet {b}",
" MeasurableSet {x}",
" MeasurableSet {x}αΆ",
" {x}αΆ β {s | IsOpen s}"
] | [
" borel Ξ± = β€"
] |
import Mathlib.Algebra.Group.Basic
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.Order.Fin
import Mathlib.Order.PiLex
import Mathlib.Order.Interval.Set.Basic
#align_import data.fin.tuple.basic from "leanprover-community/mathlib"@"ef997baa41b5c428be3fb50089a7139bf4ee886b"
assert_not_exists MonoidWithZero
universe u v
namespace Fin
variable {m n : β}
open Function
section Tuple
example (Ξ± : Fin 0 β Sort u) : Unique (β i : Fin 0, Ξ± i) := by infer_instance
theorem tuple0_le {Ξ± : Fin 0 β Type*} [β i, Preorder (Ξ± i)] (f g : β i, Ξ± i) : f β€ g :=
finZeroElim
#align fin.tuple0_le Fin.tuple0_le
variable {Ξ± : Fin (n + 1) β Type u} (x : Ξ± 0) (q : β i, Ξ± i) (p : β i : Fin n, Ξ± i.succ) (i : Fin n)
(y : Ξ± i.succ) (z : Ξ± 0)
def tail (q : β i, Ξ± i) : β i : Fin n, Ξ± i.succ := fun i β¦ q i.succ
#align fin.tail Fin.tail
theorem tail_def {n : β} {Ξ± : Fin (n + 1) β Type*} {q : β i, Ξ± i} :
(tail fun k : Fin (n + 1) β¦ q k) = fun k : Fin n β¦ q k.succ :=
rfl
#align fin.tail_def Fin.tail_def
def cons (x : Ξ± 0) (p : β i : Fin n, Ξ± i.succ) : β i, Ξ± i := fun j β¦ Fin.cases x p j
#align fin.cons Fin.cons
@[simp]
theorem tail_cons : tail (cons x p) = p := by
simp (config := { unfoldPartialApp := true }) [tail, cons]
#align fin.tail_cons Fin.tail_cons
@[simp]
theorem cons_succ : cons x p i.succ = p i := by simp [cons]
#align fin.cons_succ Fin.cons_succ
@[simp]
theorem cons_zero : cons x p 0 = x := by simp [cons]
#align fin.cons_zero Fin.cons_zero
@[simp]
theorem cons_one {Ξ± : Fin (n + 2) β Type*} (x : Ξ± 0) (p : β i : Fin n.succ, Ξ± i.succ) :
cons x p 1 = p 0 := by
rw [β cons_succ x p]; rfl
@[simp]
| Mathlib/Data/Fin/Tuple/Basic.lean | 92 | 104 | theorem cons_update : cons x (update p i y) = update (cons x p) i.succ y := by |
ext j
by_cases h : j = 0
Β· rw [h]
simp [Ne.symm (succ_ne_zero i)]
Β· let j' := pred j h
have : j'.succ = j := succ_pred j h
rw [β this, cons_succ]
by_cases h' : j' = i
Β· rw [h']
simp
Β· have : j'.succ β i.succ := by rwa [Ne, succ_inj]
rw [update_noteq h', update_noteq this, cons_succ]
| [
" Unique ((i : Fin 0) β Ξ± i)",
" tail (cons x p) = p",
" cons x p i.succ = p i",
" cons x p 0 = x",
" cons x p 1 = p 0",
" cons x p 1 = cons x p (succ 0)",
" cons x (update p i y) = update (cons x p) i.succ y",
" cons x (update p i y) j = update (cons x p) i.succ y j",
" cons x (update p i y) 0 = up... | [
" Unique ((i : Fin 0) β Ξ± i)",
" tail (cons x p) = p",
" cons x p i.succ = p i",
" cons x p 0 = x",
" cons x p 1 = p 0",
" cons x p 1 = cons x p (succ 0)",
" cons x (update p i y) = update (cons x p) i.succ y"
] |
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Analysis.Calculus.Deriv.ZPow
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.SpecialFunctions.NonIntegrable
import Mathlib.Analysis.Analytic.Basic
#align_import measure_theory.integral.circle_integral from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
variable {E : Type*} [NormedAddCommGroup E]
noncomputable section
open scoped Real NNReal Interval Pointwise Topology
open Complex MeasureTheory TopologicalSpace Metric Function Set Filter Asymptotics
def circleMap (c : β) (R : β) : β β β := fun ΞΈ => c + R * exp (ΞΈ * I)
#align circle_map circleMap
theorem periodic_circleMap (c : β) (R : β) : Periodic (circleMap c R) (2 * Ο) := fun ΞΈ => by
simp [circleMap, add_mul, exp_periodic _]
#align periodic_circle_map periodic_circleMap
theorem Set.Countable.preimage_circleMap {s : Set β} (hs : s.Countable) (c : β) {R : β}
(hR : R β 0) : (circleMap c R β»ΒΉ' s).Countable :=
show (((β) : β β β) β»ΒΉ' ((Β· * I) β»ΒΉ'
(exp β»ΒΉ' ((R * Β·) β»ΒΉ' ((c + Β·) β»ΒΉ' s))))).Countable from
(((hs.preimage (add_right_injective _)).preimage <|
mul_right_injectiveβ <| ofReal_ne_zero.2 hR).preimage_cexp.preimage <|
mul_left_injectiveβ I_ne_zero).preimage ofReal_injective
#align set.countable.preimage_circle_map Set.Countable.preimage_circleMap
@[simp]
theorem circleMap_sub_center (c : β) (R : β) (ΞΈ : β) : circleMap c R ΞΈ - c = circleMap 0 R ΞΈ := by
simp [circleMap]
#align circle_map_sub_center circleMap_sub_center
theorem circleMap_zero (R ΞΈ : β) : circleMap 0 R ΞΈ = R * exp (ΞΈ * I) :=
zero_add _
#align circle_map_zero circleMap_zero
@[simp]
| Mathlib/MeasureTheory/Integral/CircleIntegral.lean | 114 | 114 | theorem abs_circleMap_zero (R : β) (ΞΈ : β) : abs (circleMap 0 R ΞΈ) = |R| := by | simp [circleMap]
| [
" circleMap c R (ΞΈ + 2 * Ο) = circleMap c R ΞΈ",
" circleMap c R ΞΈ - c = circleMap 0 R ΞΈ",
" Complex.abs (circleMap 0 R ΞΈ) = |R|"
] | [
" circleMap c R (ΞΈ + 2 * Ο) = circleMap c R ΞΈ",
" circleMap c R ΞΈ - c = circleMap 0 R ΞΈ",
" Complex.abs (circleMap 0 R ΞΈ) = |R|"
] |
import Mathlib.Topology.MetricSpace.Basic
#align_import topology.metric_space.infsep from "leanprover-community/mathlib"@"5316314b553dcf8c6716541851517c1a9715e22b"
variable {Ξ± Ξ² : Type*}
namespace Set
section Einfsep
open ENNReal
open Function
noncomputable def einfsep [EDist Ξ±] (s : Set Ξ±) : ββ₯0β :=
β¨
(x β s) (y β s) (_ : x β y), edist x y
#align set.einfsep Set.einfsep
section EDist
variable [EDist Ξ±] {x y : Ξ±} {s t : Set Ξ±}
theorem le_einfsep_iff {d} :
d β€ s.einfsep β β x β s, β y β s, x β y β d β€ edist x y := by
simp_rw [einfsep, le_iInf_iff]
#align set.le_einfsep_iff Set.le_einfsep_iff
theorem einfsep_zero : s.einfsep = 0 β β C > 0, β x β s, β y β s, x β y β§ edist x y < C := by
simp_rw [einfsep, β _root_.bot_eq_zero, iInf_eq_bot, iInf_lt_iff, exists_prop]
#align set.einfsep_zero Set.einfsep_zero
theorem einfsep_pos : 0 < s.einfsep β β C > 0, β x β s, β y β s, x β y β C β€ edist x y := by
rw [pos_iff_ne_zero, Ne, einfsep_zero]
simp only [not_forall, not_exists, not_lt, exists_prop, not_and]
#align set.einfsep_pos Set.einfsep_pos
theorem einfsep_top :
s.einfsep = β β β x β s, β y β s, x β y β edist x y = β := by
simp_rw [einfsep, iInf_eq_top]
#align set.einfsep_top Set.einfsep_top
theorem einfsep_lt_top :
s.einfsep < β β β x β s, β y β s, x β y β§ edist x y < β := by
simp_rw [einfsep, iInf_lt_iff, exists_prop]
#align set.einfsep_lt_top Set.einfsep_lt_top
theorem einfsep_ne_top :
s.einfsep β β β β x β s, β y β s, x β y β§ edist x y β β := by
simp_rw [β lt_top_iff_ne_top, einfsep_lt_top]
#align set.einfsep_ne_top Set.einfsep_ne_top
theorem einfsep_lt_iff {d} :
s.einfsep < d β β x β s, β y β s, x β y β§ edist x y < d := by
simp_rw [einfsep, iInf_lt_iff, exists_prop]
#align set.einfsep_lt_iff Set.einfsep_lt_iff
| Mathlib/Topology/MetricSpace/Infsep.lean | 84 | 86 | theorem nontrivial_of_einfsep_lt_top (hs : s.einfsep < β) : s.Nontrivial := by |
rcases einfsep_lt_top.1 hs with β¨_, hx, _, hy, hxy, _β©
exact β¨_, hx, _, hy, hxyβ©
| [
" d β€ s.einfsep β β x β s, β y β s, x β y β d β€ edist x y",
" s.einfsep = 0 β β C > 0, β x β s, β y β s, x β y β§ edist x y < C",
" 0 < s.einfsep β β C > 0, β x β s, β y β s, x β y β C β€ edist x y",
" (Β¬β C > 0, β x β s, β y β s, x β y β§ edist x y < C) β β C > 0, β x β s, β y β s, x β y β C β€ edist x y",
" s... | [
" d β€ s.einfsep β β x β s, β y β s, x β y β d β€ edist x y",
" s.einfsep = 0 β β C > 0, β x β s, β y β s, x β y β§ edist x y < C",
" 0 < s.einfsep β β C > 0, β x β s, β y β s, x β y β C β€ edist x y",
" (Β¬β C > 0, β x β s, β y β s, x β y β§ edist x y < C) β β C > 0, β x β s, β y β s, x β y β C β€ edist x y",
" s... |
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.RingTheory.Localization.Ideal
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177"
variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S]
variable [Algebra R S] {P : Type*} [CommRing P]
namespace IsLocalization
-- This was previously a `hasCoe` instance, but if `S = R` then this will loop.
-- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down
-- the rest of the library.
def coeSubmodule (I : Ideal R) : Submodule R S :=
Submodule.map (Algebra.linearMap R S) I
#align is_localization.coe_submodule IsLocalization.coeSubmodule
theorem mem_coeSubmodule (I : Ideal R) {x : S} :
x β coeSubmodule S I β β y : R, y β I β§ algebraMap R S y = x :=
Iff.rfl
#align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule
theorem coeSubmodule_mono {I J : Ideal R} (h : I β€ J) : coeSubmodule S I β€ coeSubmodule S J :=
Submodule.map_mono h
#align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono
@[simp]
theorem coeSubmodule_bot : coeSubmodule S (β₯ : Ideal R) = β₯ := by
rw [coeSubmodule, Submodule.map_bot]
#align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot
@[simp]
theorem coeSubmodule_top : coeSubmodule S (β€ : Ideal R) = 1 := by
rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range]
#align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top
@[simp]
theorem coeSubmodule_sup (I J : Ideal R) :
coeSubmodule S (I β J) = coeSubmodule S I β coeSubmodule S J :=
Submodule.map_sup _ _ _
#align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup
@[simp]
theorem coeSubmodule_mul (I J : Ideal R) :
coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J :=
Submodule.map_mul _ _ (Algebra.ofId R S)
#align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul
theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) :
Submodule.FG (coeSubmodule S I) β Submodule.FG I :=
β¨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _β©
#align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg
@[simp]
theorem coeSubmodule_span (s : Set R) :
coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by
rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span]
rfl
#align is_localization.coe_submodule_span IsLocalization.coeSubmodule_span
-- @[simp] -- Porting note (#10618): simp can prove this
theorem coeSubmodule_span_singleton (x : R) :
coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x} := by
rw [coeSubmodule_span, Set.image_singleton]
#align is_localization.coe_submodule_span_singleton IsLocalization.coeSubmodule_span_singleton
variable {g : R β+* P}
variable {T : Submonoid P} (hy : M β€ T.comap g) {Q : Type*} [CommRing Q]
variable [Algebra P Q] [IsLocalization T Q]
variable [IsLocalization M S]
section
| Mathlib/RingTheory/Localization/Submodule.lean | 94 | 96 | theorem isNoetherianRing (h : IsNoetherianRing R) : IsNoetherianRing S := by |
rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at h β’
exact OrderEmbedding.wellFounded (IsLocalization.orderEmbedding M S).dual h
| [
" coeSubmodule S β₯ = β₯",
" coeSubmodule S β€ = 1",
" coeSubmodule S (Ideal.span s) = Submodule.span R (β(algebraMap R S) '' s)",
" Submodule.span R (β(Algebra.linearMap R S) '' s) = Submodule.span R (β(algebraMap R S) '' s)",
" coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x}",
" IsN... | [
" coeSubmodule S β₯ = β₯",
" coeSubmodule S β€ = 1",
" coeSubmodule S (Ideal.span s) = Submodule.span R (β(algebraMap R S) '' s)",
" Submodule.span R (β(Algebra.linearMap R S) '' s) = Submodule.span R (β(algebraMap R S) '' s)",
" coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x}",
" IsN... |
import Mathlib.Analysis.Calculus.Deriv.ZPow
import Mathlib.Analysis.SpecialFunctions.Sqrt
import Mathlib.Analysis.SpecialFunctions.Log.Deriv
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
import Mathlib.Analysis.Convex.Deriv
#align_import analysis.convex.specific_functions.deriv from "leanprover-community/mathlib"@"a16665637b378379689c566204817ae792ac8b39"
open Real Set
open scoped NNReal
| Mathlib/Analysis/Convex/SpecificFunctions/Deriv.lean | 40 | 44 | theorem strictConvexOn_pow {n : β} (hn : 2 β€ n) : StrictConvexOn β (Ici 0) fun x : β => x ^ n := by |
apply StrictMonoOn.strictConvexOn_of_deriv (convex_Ici _) (continuousOn_pow _)
rw [deriv_pow', interior_Ici]
exact fun x (hx : 0 < x) y _ hxy => mul_lt_mul_of_pos_left
(pow_lt_pow_left hxy hx.le <| Nat.sub_ne_zero_of_lt hn) (by positivity)
| [
" StrictConvexOn β (Ici 0) fun x => x ^ n",
" StrictMonoOn (deriv fun x => x ^ n) (interior (Ici 0))",
" StrictMonoOn (fun x => βn * x ^ (n - 1)) (Ioi 0)",
" 0 < βn"
] | [
" StrictConvexOn β (Ici 0) fun x => x ^ n"
] |
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
| Mathlib/Analysis/SpecialFunctions/Complex/Log.lean | 65 | 67 | 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]
| [
" x.log.re = (abs x).log",
" x.log.im = x.arg",
" -Ο < x.log.im",
" x.log.im β€ Ο",
" cexp x.log = x",
" x β Set.range cexp β x β {0}αΆ",
" cexp x β {0}αΆ",
" (cexp x).log = x",
" x = y"
] | [
" x.log.re = (abs x).log",
" x.log.im = x.arg",
" -Ο < x.log.im",
" x.log.im β€ Ο",
" cexp x.log = x",
" x β Set.range cexp β x β {0}αΆ",
" cexp x β {0}αΆ",
" (cexp x).log = x",
" x = y"
] |
import Mathlib.Data.Matrix.Basis
import Mathlib.Data.Matrix.DMatrix
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.Tactic.FieldSimp
#align_import linear_algebra.matrix.transvection from "leanprover-community/mathlib"@"0e2aab2b0d521f060f62a14d2cf2e2c54e8491d6"
universe uβ uβ
namespace Matrix
open Matrix
variable (n p : Type*) (R : Type uβ) {π : Type*} [Field π]
variable [DecidableEq n] [DecidableEq p]
variable [CommRing R]
section Transvection
variable {R n} (i j : n)
def transvection (c : R) : Matrix n n R :=
1 + Matrix.stdBasisMatrix i j c
#align matrix.transvection Matrix.transvection
@[simp]
theorem transvection_zero : transvection i j (0 : R) = 1 := by simp [transvection]
#align matrix.transvection_zero Matrix.transvection_zero
section
| Mathlib/LinearAlgebra/Matrix/Transvection.lean | 94 | 108 | theorem updateRow_eq_transvection [Finite n] (c : R) :
updateRow (1 : Matrix n n R) i ((1 : Matrix n n R) i + c β’ (1 : Matrix n n R) j) =
transvection i j c := by |
cases nonempty_fintype n
ext a b
by_cases ha : i = a
Β· by_cases hb : j = b
Β· simp only [updateRow_self, transvection, ha, hb, Pi.add_apply, StdBasisMatrix.apply_same,
one_apply_eq, Pi.smul_apply, mul_one, Algebra.id.smul_eq_mul, add_apply]
Β· simp only [updateRow_self, transvection, ha, hb, StdBasisMatrix.apply_of_ne, Pi.add_apply,
Ne, not_false_iff, Pi.smul_apply, and_false_iff, one_apply_ne, Algebra.id.smul_eq_mul,
mul_zero, add_apply]
Β· simp only [updateRow_ne, transvection, ha, Ne.symm ha, StdBasisMatrix.apply_of_ne, add_zero,
Algebra.id.smul_eq_mul, Ne, not_false_iff, DMatrix.add_apply, Pi.smul_apply,
mul_zero, false_and_iff, add_apply]
| [
" transvection i j 0 = 1",
" updateRow 1 i (1 i + c β’ 1 j) = transvection i j c",
" updateRow 1 i (1 i + c β’ 1 j) a b = transvection i j c a b"
] | [
" transvection i j 0 = 1",
" updateRow 1 i (1 i + c β’ 1 j) = transvection i j c"
] |
import Mathlib.Data.Set.Finite
import Mathlib.GroupTheory.GroupAction.FixedPoints
import Mathlib.GroupTheory.Perm.Support
open Equiv List MulAction Pointwise Set Subgroup
variable {G Ξ± : Type*} [Group G] [MulAction G Ξ±] [DecidableEq Ξ±]
theorem finite_compl_fixedBy_closure_iff {S : Set G} :
(β g β closure S, (fixedBy Ξ± g)αΆ.Finite) β β g β S, (fixedBy Ξ± g)αΆ.Finite :=
β¨fun h g hg β¦ h g (subset_closure hg), fun h g hg β¦ by
refine closure_induction hg h (by simp) (fun g g' hg hg' β¦ (hg.union hg').subset ?_) (by simp)
simp_rw [β compl_inter, compl_subset_compl, fixedBy_mul]β©
theorem finite_compl_fixedBy_swap {x y : Ξ±} : (fixedBy Ξ± (swap x y))αΆ.Finite :=
Set.Finite.subset (s := {x, y}) (by simp)
(compl_subset_comm.mp fun z h β¦ by apply swap_apply_of_ne_of_ne <;> rintro rfl <;> simp at h)
theorem Equiv.Perm.IsSwap.finite_compl_fixedBy {Ο : Perm Ξ±} (h : Ο.IsSwap) :
(fixedBy Ξ± Ο)αΆ.Finite := by
obtain β¨x, y, -, rflβ© := h
exact finite_compl_fixedBy_swap
-- this result cannot be moved to Perm/Basic since Perm/Basic is not allowed to import Submonoid
theorem SubmonoidClass.swap_mem_trans {a b c : Ξ±} {C} [SetLike C (Perm Ξ±)]
[SubmonoidClass C (Perm Ξ±)] (M : C) (hab : swap a b β M) (hbc : swap b c β M) :
swap a c β M := by
obtain rfl | hab' := eq_or_ne a b
Β· exact hbc
obtain rfl | hac := eq_or_ne a c
Β· exact swap_self a βΈ one_mem M
rw [swap_comm, β swap_mul_swap_mul_swap hab' hac]
exact mul_mem (mul_mem hbc hab) hbc
theorem exists_smul_not_mem_of_subset_orbit_closure (S : Set G) (T : Set Ξ±) {a : Ξ±}
(hS : β g β S, gβ»ΒΉ β S) (subset : T β orbit (closure S) a) (not_mem : a β T)
(nonempty : T.Nonempty) : β Ο β S, β a β T, Ο β’ a β T := by
have key0 : Β¬ closure S β€ stabilizer G T := by
have β¨b, hbβ© := nonempty
obtain β¨Ο, rflβ© := subset hb
contrapose! not_mem with h
exact smul_mem_smul_set_iff.mp ((h Ο.2).symm βΈ hb)
contrapose! key0
refine (closure_le _).mpr fun Ο hΟ β¦ ?_
simp_rw [SetLike.mem_coe, mem_stabilizer_iff, Set.ext_iff, mem_smul_set_iff_inv_smul_mem]
exact fun a β¦ β¨fun h β¦ smul_inv_smul Ο a βΈ key0 Ο hΟ (Οβ»ΒΉ β’ a) h, key0 Οβ»ΒΉ (hS Ο hΟ) aβ©
theorem swap_mem_closure_isSwap {S : Set (Perm Ξ±)} (hS : β f β S, f.IsSwap) {x y : Ξ±} :
swap x y β closure S β x β orbit (closure S) y := by
refine β¨fun h β¦ β¨β¨swap x y, hβ©, swap_apply_right x yβ©, fun hf β¦ ?_β©
by_contra h
have := exists_smul_not_mem_of_subset_orbit_closure S {x | swap x y β closure S}
(fun f hf β¦ ?_) (fun z hz β¦ ?_) h β¨y, ?_β©
Β· obtain β¨Ο, hΟ, a, ha, hΟaβ© := this
obtain β¨z, w, hzw, rflβ© := hS Ο hΟ
have := ne_of_mem_of_not_mem ha hΟa
rw [Perm.smul_def, ne_comm, swap_apply_ne_self_iff, and_iff_right hzw] at this
refine hΟa (SubmonoidClass.swap_mem_trans (closure S) ?_ ha)
obtain rfl | rfl := this <;> simpa [swap_comm] using subset_closure hΟ
Β· obtain β¨x, y, -, rflβ© := hS f hf; rwa [swap_inv]
Β· exact orbit_eq_iff.mpr hf βΈ β¨β¨swap z y, hzβ©, swap_apply_right z yβ©
Β· rw [mem_setOf, swap_self]; apply one_mem
| Mathlib/GroupTheory/Perm/ClosureSwap.lean | 92 | 114 | theorem mem_closure_isSwap {S : Set (Perm Ξ±)} (hS : β f β S, f.IsSwap) {f : Perm Ξ±} :
f β closure S β (fixedBy Ξ± f)αΆ.Finite β§ β x, f x β orbit (closure S) x := by |
refine β¨fun hf β¦ β¨?_, fun x β¦ mem_orbit_iff.mpr β¨β¨f, hfβ©, rflβ©β©, ?_β©
Β· exact finite_compl_fixedBy_closure_iff.mpr (fun f hf β¦ (hS f hf).finite_compl_fixedBy) _ hf
rintro β¨fin, hfβ©
set supp := (fixedBy Ξ± f)αΆ with supp_eq
suffices h : (fixedBy Ξ± f)αΆ β supp β f β closure S from h supp_eq.symm.subset
clear_value supp; clear supp_eq; revert f
apply fin.induction_on ..
Β· rintro f - emp; convert (closure S).one_mem; ext; by_contra h; exact emp h
rintro a s - - ih f hf supp_subset
refine (mul_mem_cancel_left ((swap_mem_closure_isSwap hS).2 (hf a))).1
(ih (fun b β¦ ?_) fun b hb β¦ ?_)
Β· rw [Perm.mul_apply, swap_apply_def]; split_ifs with h1 h2
Β· rw [β orbit_eq_iff.mpr (hf b), h1, orbit_eq_iff.mpr (hf a)]; apply mem_orbit_self
Β· rw [β orbit_eq_iff.mpr (hf b), h2]; apply hf
Β· exact hf b
Β· contrapose! hb
simp_rw [not_mem_compl_iff, mem_fixedBy, Perm.smul_def, Perm.mul_apply, swap_apply_def,
apply_eq_iff_eq]
by_cases hb' : f b = b
Β· rw [hb']; split_ifs with h <;> simp only [h]
simp [show b = a by simpa [hb] using supp_subset hb']
| [
" (fixedBy Ξ± g)αΆ.Finite",
" (fixedBy Ξ± 1)αΆ.Finite",
" β (x : G), (fixedBy Ξ± x)αΆ.Finite β (fixedBy Ξ± xβ»ΒΉ)αΆ.Finite",
" (fixedBy Ξ± (g * g'))αΆ β (fixedBy Ξ± g)αΆ βͺ (fixedBy Ξ± g')αΆ",
" {x, y}.Finite",
" z β fixedBy Ξ± (swap x y)",
" z β x",
" z β y",
" False",
" (fixedBy Ξ± Ο)αΆ.Finite",
" (fixedBy Ξ± (swa... | [
" (fixedBy Ξ± g)αΆ.Finite",
" (fixedBy Ξ± 1)αΆ.Finite",
" β (x : G), (fixedBy Ξ± x)αΆ.Finite β (fixedBy Ξ± xβ»ΒΉ)αΆ.Finite",
" (fixedBy Ξ± (g * g'))αΆ β (fixedBy Ξ± g)αΆ βͺ (fixedBy Ξ± g')αΆ",
" {x, y}.Finite",
" z β fixedBy Ξ± (swap x y)",
" z β x",
" z β y",
" False",
" (fixedBy Ξ± Ο)αΆ.Finite",
" (fixedBy Ξ± (swa... |
import Mathlib.Analysis.NormedSpace.Multilinear.Curry
#align_import analysis.calculus.formal_multilinear_series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open Set Fin Topology
-- Porting note: added explicit universes to fix compile
universe u u' v w x
variable {π : Type u} {π' : Type u'} {E : Type v} {F : Type w} {G : Type x}
section
variable [Ring π] [AddCommGroup E] [Module π E] [TopologicalSpace E] [TopologicalAddGroup E]
[ContinuousConstSMul π E] [AddCommGroup F] [Module π F] [TopologicalSpace F]
[TopologicalAddGroup F] [ContinuousConstSMul π F] [AddCommGroup G] [Module π G]
[TopologicalSpace G] [TopologicalAddGroup G] [ContinuousConstSMul π G]
@[nolint unusedArguments]
def FormalMultilinearSeries (π : Type*) (E : Type*) (F : Type*) [Ring π] [AddCommGroup E]
[Module π E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousConstSMul π E]
[AddCommGroup F] [Module π F] [TopologicalSpace F] [TopologicalAddGroup F]
[ContinuousConstSMul π F] :=
β n : β, E[Γn]βL[π] F
#align formal_multilinear_series FormalMultilinearSeries
-- Porting note: was `deriving`
instance : AddCommGroup (FormalMultilinearSeries π E F) :=
inferInstanceAs <| AddCommGroup <| β n : β, E[Γn]βL[π] F
instance : Inhabited (FormalMultilinearSeries π E F) :=
β¨0β©
namespace FormalMultilinearSeries
@[simp] -- Porting note (#10756): new theorem; was not needed in Lean 3
theorem zero_apply (n : β) : (0 : FormalMultilinearSeries π E F) n = 0 := rfl
@[simp] -- Porting note (#10756): new theorem; was not needed in Lean 3
theorem neg_apply (f : FormalMultilinearSeries π E F) (n : β) : (-f) n = - f n := rfl
@[ext] -- Porting note (#10756): new theorem
protected theorem ext {p q : FormalMultilinearSeries π E F} (h : β n, p n = q n) : p = q :=
funext h
protected theorem ext_iff {p q : FormalMultilinearSeries π E F} : p = q β β n, p n = q n :=
Function.funext_iff
#align formal_multilinear_series.ext_iff FormalMultilinearSeries.ext_iff
protected theorem ne_iff {p q : FormalMultilinearSeries π E F} : p β q β β n, p n β q n :=
Function.ne_iff
#align formal_multilinear_series.ne_iff FormalMultilinearSeries.ne_iff
def prod (p : FormalMultilinearSeries π E F) (q : FormalMultilinearSeries π E G) :
FormalMultilinearSeries π E (F Γ G)
| n => (p n).prod (q n)
def removeZero (p : FormalMultilinearSeries π E F) : FormalMultilinearSeries π E F
| 0 => 0
| n + 1 => p (n + 1)
#align formal_multilinear_series.remove_zero FormalMultilinearSeries.removeZero
@[simp]
theorem removeZero_coeff_zero (p : FormalMultilinearSeries π E F) : p.removeZero 0 = 0 :=
rfl
#align formal_multilinear_series.remove_zero_coeff_zero FormalMultilinearSeries.removeZero_coeff_zero
@[simp]
theorem removeZero_coeff_succ (p : FormalMultilinearSeries π E F) (n : β) :
p.removeZero (n + 1) = p (n + 1) :=
rfl
#align formal_multilinear_series.remove_zero_coeff_succ FormalMultilinearSeries.removeZero_coeff_succ
theorem removeZero_of_pos (p : FormalMultilinearSeries π E F) {n : β} (h : 0 < n) :
p.removeZero n = p n := by
rw [β Nat.succ_pred_eq_of_pos h]
rfl
#align formal_multilinear_series.remove_zero_of_pos FormalMultilinearSeries.removeZero_of_pos
| Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean | 119 | 124 | theorem congr (p : FormalMultilinearSeries π E F) {m n : β} {v : Fin m β E} {w : Fin n β E}
(h1 : m = n) (h2 : β (i : β) (him : i < m) (hin : i < n), v β¨i, himβ© = w β¨i, hinβ©) :
p m v = p n w := by |
subst n
congr with β¨i, hiβ©
exact h2 i hi hi
| [
" p.removeZero n = p n",
" p.removeZero n.pred.succ = p n.pred.succ",
" (p m) v = (p n) w",
" (p m) v = (p m) w",
" v β¨i, hiβ© = w β¨i, hiβ©"
] | [
" p.removeZero n = p n",
" p.removeZero n.pred.succ = p n.pred.succ",
" (p m) v = (p n) w"
] |
import Mathlib.CategoryTheory.Limits.Shapes.Biproducts
import Mathlib.GroupTheory.EckmannHilton
import Mathlib.Tactic.CategoryTheory.Reassoc
#align_import category_theory.preadditive.of_biproducts from "leanprover-community/mathlib"@"061ea99a5610cfc72c286aa930d3c1f47f74f3d0"
noncomputable section
universe v u
open CategoryTheory
open CategoryTheory.Limits
namespace CategoryTheory.SemiadditiveOfBinaryBiproducts
variable {C : Type u} [Category.{v} C] [HasZeroMorphisms C] [HasBinaryBiproducts C]
section
variable (X Y : C)
@[simp]
def leftAdd (f g : X βΆ Y) : X βΆ Y :=
biprod.lift f g β« biprod.desc (π Y) (π Y)
#align category_theory.semiadditive_of_binary_biproducts.left_add CategoryTheory.SemiadditiveOfBinaryBiproducts.leftAdd
@[simp]
def rightAdd (f g : X βΆ Y) : X βΆ Y :=
biprod.lift (π X) (π X) β« biprod.desc f g
#align category_theory.semiadditive_of_binary_biproducts.right_add CategoryTheory.SemiadditiveOfBinaryBiproducts.rightAdd
local infixr:65 " +β " => leftAdd X Y
local infixr:65 " +α΅£ " => rightAdd X Y
| Mathlib/CategoryTheory/Preadditive/OfBiproducts.lean | 54 | 68 | theorem isUnital_leftAdd : EckmannHilton.IsUnital (Β· +β Β·) 0 := by |
have hr : β f : X βΆ Y, biprod.lift (0 : X βΆ Y) f = f β« biprod.inr := by
intro f
ext
Β· aesop_cat
Β· simp [biprod.lift_fst, Category.assoc, biprod.inr_fst, comp_zero]
have hl : β f : X βΆ Y, biprod.lift f (0 : X βΆ Y) = f β« biprod.inl := by
intro f
ext
Β· aesop_cat
Β· simp [biprod.lift_snd, Category.assoc, biprod.inl_snd, comp_zero]
exact {
left_id := fun f => by simp [hr f, leftAdd, Category.assoc, Category.comp_id, biprod.inr_desc],
right_id := fun f => by simp [hl f, leftAdd, Category.assoc, Category.comp_id, biprod.inl_desc]
}
| [
" EckmannHilton.IsUnital (fun x x_1 => leftAdd X Y x x_1) 0",
" β (f : X βΆ Y), biprod.lift 0 f = f β« biprod.inr",
" biprod.lift 0 f = f β« biprod.inr",
" biprod.lift 0 f β« biprod.fst = (f β« biprod.inr) β« biprod.fst",
" biprod.lift 0 f β« biprod.snd = (f β« biprod.inr) β« biprod.snd",
" β (f : X βΆ Y), biprod.l... | [
" EckmannHilton.IsUnital (fun x x_1 => leftAdd X Y x x_1) 0"
] |
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]
| Mathlib/Algebra/Ring/Semiconj.lean | 39 | 41 | 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]
| [
" SemiconjBy a (x + x') (y + y')",
" SemiconjBy (a + b) x y"
] | [
" SemiconjBy a (x + x') (y + y')",
" SemiconjBy (a + b) x y"
] |
import Mathlib.Analysis.NormedSpace.Basic
import Mathlib.Topology.Algebra.Module.Basic
#align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
open Metric Set Function Filter
open scoped NNReal Topology
instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E]
[ContinuousAdd E] [Nontrivial E] [Module β E] [ContinuousSMul β E] (x : E) : NeBot (π[β ] x) :=
Module.punctured_nhds_neBot β E x
#align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot
section Seminormed
variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β E]
theorem inv_norm_smul_mem_closed_unit_ball (x : E) :
βxββ»ΒΉ β’ x β closedBall (0 : E) 1 := by
simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, β div_eq_inv_mul,
div_self_le_one]
#align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball
theorem norm_smul_of_nonneg {t : β} (ht : 0 β€ t) (x : E) : βt β’ xβ = t * βxβ := by
rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht]
#align norm_smul_of_nonneg norm_smul_of_nonneg
theorem dist_smul_add_one_sub_smul_le {r : β} {x y : E} (h : r β Icc 0 1) :
dist (r β’ x + (1 - r) β’ y) x β€ dist y x :=
calc
dist (r β’ x + (1 - r) β’ y) x = β1 - rβ * βx - yβ := by
simp_rw [dist_eq_norm', β norm_smul, sub_smul, one_smul, smul_sub, β sub_sub, β sub_add,
sub_right_comm]
_ = (1 - r) * dist y x := by
rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm']
_ β€ (1 - 0) * dist y x := by gcongr; exact h.1
_ = dist y x := by rw [sub_zero, one_mul]
theorem closure_ball (x : E) {r : β} (hr : r β 0) : closure (ball x r) = closedBall x r := by
refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_
have : ContinuousWithinAt (fun c : β => c β’ (y - x) + x) (Ico 0 1) 1 :=
((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt
convert this.mem_closure _ _
Β· rw [one_smul, sub_add_cancel]
Β· simp [closure_Ico zero_ne_one, zero_le_one]
Β· rintro c β¨hc0, hc1β©
rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs,
abs_of_nonneg hc0, mul_comm, β mul_one r]
rw [mem_closedBall, dist_eq_norm] at hy
replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm
apply mul_lt_mul' <;> assumption
#align closure_ball closure_ball
theorem frontier_ball (x : E) {r : β} (hr : r β 0) :
frontier (ball x r) = sphere x r := by
rw [frontier, closure_ball x hr, isOpen_ball.interior_eq, closedBall_diff_ball]
#align frontier_ball frontier_ball
theorem interior_closedBall (x : E) {r : β} (hr : r β 0) :
interior (closedBall x r) = ball x r := by
cases' hr.lt_or_lt with hr hr
Β· rw [closedBall_eq_empty.2 hr, ball_eq_empty.2 hr.le, interior_empty]
refine Subset.antisymm ?_ ball_subset_interior_closedBall
intro y hy
rcases (mem_closedBall.1 <| interior_subset hy).lt_or_eq with (hr | rfl)
Β· exact hr
set f : β β E := fun c : β => c β’ (y - x) + x
suffices f β»ΒΉ' closedBall x (dist y x) β Icc (-1) 1 by
have hfc : Continuous f := (continuous_id.smul continuous_const).add continuous_const
have hf1 : (1 : β) β f β»ΒΉ' interior (closedBall x <| dist y x) := by simpa [f]
have h1 : (1 : β) β interior (Icc (-1 : β) 1) :=
interior_mono this (preimage_interior_subset_interior_preimage hfc hf1)
simp at h1
intro c hc
rw [mem_Icc, β abs_le, β Real.norm_eq_abs, β mul_le_mul_right hr]
simpa [f, dist_eq_norm, norm_smul] using hc
#align interior_closed_ball interior_closedBall
theorem frontier_closedBall (x : E) {r : β} (hr : r β 0) :
frontier (closedBall x r) = sphere x r := by
rw [frontier, closure_closedBall, interior_closedBall x hr, closedBall_diff_ball]
#align frontier_closed_ball frontier_closedBall
| Mathlib/Analysis/NormedSpace/Real.lean | 106 | 107 | theorem interior_sphere (x : E) {r : β} (hr : r β 0) : interior (sphere x r) = β
:= by |
rw [β frontier_closedBall x hr, interior_frontier isClosed_ball]
| [
" βxββ»ΒΉ β’ x β closedBall 0 1",
" βt β’ xβ = t * βxβ",
" dist (r β’ x + (1 - r) β’ y) x = β1 - rβ * βx - yβ",
" β1 - rβ * βx - yβ = (1 - r) * dist y x",
" (1 - r) * dist y x β€ (1 - 0) * dist y x",
" 0 β€ r",
" (1 - 0) * dist y x = dist y x",
" closure (ball x r) = closedBall x r",
" y β closure (ball x r... | [
" βxββ»ΒΉ β’ x β closedBall 0 1",
" βt β’ xβ = t * βxβ",
" dist (r β’ x + (1 - r) β’ y) x = β1 - rβ * βx - yβ",
" β1 - rβ * βx - yβ = (1 - r) * dist y x",
" (1 - r) * dist y x β€ (1 - 0) * dist y x",
" 0 β€ r",
" (1 - 0) * dist y x = dist y x",
" closure (ball x r) = closedBall x r",
" y β closure (ball x r... |
import Mathlib.Topology.ContinuousFunction.ZeroAtInfty
open Topology Filter
variable {E F π : Type*}
variable [SeminormedAddGroup E] [SeminormedAddCommGroup F]
variable [FunLike π E F] [ZeroAtInftyContinuousMapClass π E F]
theorem ZeroAtInftyContinuousMapClass.norm_le (f : π) (Ξ΅ : β) (hΞ΅ : 0 < Ξ΅) :
β (r : β), β (x : E) (_hx : r < βxβ), βf xβ < Ξ΅ := by
have h := zero_at_infty f
rw [tendsto_zero_iff_norm_tendsto_zero, tendsto_def] at h
specialize h (Metric.ball 0 Ξ΅) (Metric.ball_mem_nhds 0 hΞ΅)
rcases Metric.closedBall_compl_subset_of_mem_cocompact h 0 with β¨r, hrβ©
use r
intro x hr'
suffices x β (fun x β¦ βf xβ) β»ΒΉ' Metric.ball 0 Ξ΅ by aesop
apply hr
aesop
variable [ProperSpace E]
| Mathlib/Analysis/Normed/Group/ZeroAtInfty.lean | 38 | 49 | theorem zero_at_infty_of_norm_le (f : E β F)
(h : β (Ξ΅ : β) (_hΞ΅ : 0 < Ξ΅), β (r : β), β (x : E) (_hx : r < βxβ), βf xβ < Ξ΅) :
Tendsto f (cocompact E) (π 0) := by |
rw [tendsto_zero_iff_norm_tendsto_zero]
intro s hs
rw [mem_map, Metric.mem_cocompact_iff_closedBall_compl_subset 0]
rw [Metric.mem_nhds_iff] at hs
rcases hs with β¨Ξ΅, hΞ΅, hsβ©
rcases h Ξ΅ hΞ΅ with β¨r, hrβ©
use r
intro
aesop
| [
" β r, β (x : E), r < βxβ β βf xβ < Ξ΅",
" β (x : E), r < βxβ β βf xβ < Ξ΅",
" βf xβ < Ξ΅",
" x β (fun x => βf xβ) β»ΒΉ' Metric.ball 0 Ξ΅",
" x β (Metric.closedBall 0 r)αΆ",
" Tendsto f (cocompact E) (π 0)",
" Tendsto (fun x => βf xβ) (cocompact E) (π 0)",
" s β map (fun x => βf xβ) (cocompact E)",
" β r... | [
" β r, β (x : E), r < βxβ β βf xβ < Ξ΅",
" β (x : E), r < βxβ β βf xβ < Ξ΅",
" βf xβ < Ξ΅",
" x β (fun x => βf xβ) β»ΒΉ' Metric.ball 0 Ξ΅",
" x β (Metric.closedBall 0 r)αΆ",
" Tendsto f (cocompact E) (π 0)"
] |
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
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]
#align ring.mul_inverse_cancel_right Ring.mul_inverse_cancel_right
theorem inverse_mul_cancel_right (x y : Mβ) (h : IsUnit x) : y * inverse x * x = y := by
rw [mul_assoc, inverse_mul_cancel x h, mul_one]
#align ring.inverse_mul_cancel_right Ring.inverse_mul_cancel_right
| Mathlib/Algebra/GroupWithZero/Units/Basic.lean | 126 | 127 | theorem mul_inverse_cancel_left (x y : Mβ) (h : IsUnit x) : x * (inverse x * y) = y := by |
rw [β mul_assoc, mul_inverse_cancel x h, one_mul]
| [
" 0 = 1",
" inverse βu = βuβ»ΒΉ",
" x * inverse x = 1",
" βu * inverse βu = 1",
" inverse x * x = 1",
" inverse βu * βu = 1",
" y * x * inverse x = y",
" y * inverse x * x = y",
" x * (inverse x * y) = y"
] | [
" 0 = 1",
" inverse βu = βuβ»ΒΉ",
" x * inverse x = 1",
" βu * inverse βu = 1",
" inverse x * x = 1",
" inverse βu * βu = 1",
" y * x * inverse x = y",
" y * inverse x * x = y",
" x * (inverse x * y) = y"
] |
import Mathlib.RingTheory.AdjoinRoot
import Mathlib.FieldTheory.Minpoly.Field
import Mathlib.RingTheory.Polynomial.GaussLemma
#align_import field_theory.minpoly.is_integrally_closed from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
open scoped Classical Polynomial
open Polynomial Set Function minpoly
namespace minpoly
variable {R S : Type*} [CommRing R] [CommRing S] [IsDomain R] [Algebra R S]
section
variable (K L : Type*) [Field K] [Algebra R K] [IsFractionRing R K] [CommRing L] [Nontrivial L]
[Algebra R L] [Algebra S L] [Algebra K L] [IsScalarTower R K L] [IsScalarTower R S L]
variable [IsIntegrallyClosed R]
theorem isIntegrallyClosed_eq_field_fractions [IsDomain S] {s : S} (hs : IsIntegral R s) :
minpoly K (algebraMap S L s) = (minpoly R s).map (algebraMap R K) := by
refine (eq_of_irreducible_of_monic ?_ ?_ ?_).symm
Β· exact ((monic hs).irreducible_iff_irreducible_map_fraction_map).1 (irreducible hs)
Β· rw [aeval_map_algebraMap, aeval_algebraMap_apply, aeval, map_zero]
Β· exact (monic hs).map _
#align minpoly.is_integrally_closed_eq_field_fractions minpoly.isIntegrallyClosed_eq_field_fractions
theorem isIntegrallyClosed_eq_field_fractions' [IsDomain S] [Algebra K S] [IsScalarTower R K S]
{s : S} (hs : IsIntegral R s) : minpoly K s = (minpoly R s).map (algebraMap R K) := by
let L := FractionRing S
rw [β isIntegrallyClosed_eq_field_fractions K L hs, algebraMap_eq (IsFractionRing.injective S L)]
#align minpoly.is_integrally_closed_eq_field_fractions' minpoly.isIntegrallyClosed_eq_field_fractions'
end
variable [IsDomain S] [NoZeroSMulDivisors R S]
variable [IsIntegrallyClosed R]
| Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean | 75 | 92 | theorem isIntegrallyClosed_dvd {s : S} (hs : IsIntegral R s) {p : R[X]}
(hp : Polynomial.aeval s p = 0) : minpoly R s β£ p := by |
let K := FractionRing R
let L := FractionRing S
let _ : Algebra K L := FractionRing.liftAlgebra R L
have := FractionRing.isScalarTower_liftAlgebra R L
have : minpoly K (algebraMap S L s) β£ map (algebraMap R K) (p %β minpoly R s) := by
rw [map_modByMonic _ (minpoly.monic hs), modByMonic_eq_sub_mul_div]
Β· refine dvd_sub (minpoly.dvd K (algebraMap S L s) ?_) ?_
Β· rw [β map_aeval_eq_aeval_map, hp, map_zero]
rw [β IsScalarTower.algebraMap_eq, β IsScalarTower.algebraMap_eq]
apply dvd_mul_of_dvd_left
rw [isIntegrallyClosed_eq_field_fractions K L hs]
exact Monic.map _ (minpoly.monic hs)
rw [isIntegrallyClosed_eq_field_fractions _ _ hs,
map_dvd_map (algebraMap R K) (IsFractionRing.injective R K) (minpoly.monic hs)] at this
rw [β modByMonic_eq_zero_iff_dvd (minpoly.monic hs)]
exact Polynomial.eq_zero_of_dvd_of_degree_lt this (degree_modByMonic_lt p <| minpoly.monic hs)
| [
" minpoly K ((algebraMap S L) s) = map (algebraMap R K) (minpoly R s)",
" Irreducible (map (algebraMap R K) (minpoly R s))",
" (Polynomial.aeval ((algebraMap S L) s)) (map (algebraMap R K) (minpoly R s)) = 0",
" (map (algebraMap R K) (minpoly R s)).Monic",
" minpoly K s = map (algebraMap R K) (minpoly R s)"... | [
" minpoly K ((algebraMap S L) s) = map (algebraMap R K) (minpoly R s)",
" Irreducible (map (algebraMap R K) (minpoly R s))",
" (Polynomial.aeval ((algebraMap S L) s)) (map (algebraMap R K) (minpoly R s)) = 0",
" (map (algebraMap R K) (minpoly R s)).Monic",
" minpoly K s = map (algebraMap R K) (minpoly R s)"... |
import Mathlib.Analysis.Convex.Hull
import Mathlib.LinearAlgebra.AffineSpace.Independent
#align_import analysis.convex.simplicial_complex.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open Finset Set
variable (π E : Type*) {ΞΉ : Type*} [OrderedRing π] [AddCommGroup E] [Module π E]
namespace Geometry
-- TODO: update to new binder order? not sure what binder order is correct for `down_closed`.
@[ext]
structure SimplicialComplex where
faces : Set (Finset E)
not_empty_mem : β
β faces
indep : β {s}, s β faces β AffineIndependent π ((β) : s β E)
down_closed : β {s t}, s β faces β t β s β t β β
β t β faces
inter_subset_convexHull : β {s t}, s β faces β t β faces β
convexHull π βs β© convexHull π βt β convexHull π (s β© t : Set E)
#align geometry.simplicial_complex Geometry.SimplicialComplex
namespace SimplicialComplex
variable {π E}
variable {K : SimplicialComplex π E} {s t : Finset E} {x : E}
instance : Membership (Finset E) (SimplicialComplex π E) :=
β¨fun s K => s β K.facesβ©
def space (K : SimplicialComplex π E) : Set E :=
β s β K.faces, convexHull π (s : Set E)
#align geometry.simplicial_complex.space Geometry.SimplicialComplex.space
-- Porting note: Expanded `β s β K.faces` to get the type to match more closely with Lean 3
theorem mem_space_iff : x β K.space β β s β K.faces, x β convexHull π (s : Set E) := by
simp [space]
#align geometry.simplicial_complex.mem_space_iff Geometry.SimplicialComplex.mem_space_iff
-- Porting note: Original proof was `:= subset_biUnion_of_mem hs`
| Mathlib/Analysis/Convex/SimplicialComplex/Basic.lean | 91 | 93 | theorem convexHull_subset_space (hs : s β K.faces) : convexHull π βs β K.space := by |
convert subset_biUnion_of_mem hs
rfl
| [
" x β K.space β β s β K.faces, x β (convexHull π) βs",
" (convexHull π) βs β K.space",
" (convexHull π) βs = (convexHull π) βs"
] | [
" x β K.space β β s β K.faces, x β (convexHull π) βs",
" (convexHull π) βs β K.space"
] |
import Mathlib.Algebra.MvPolynomial.Derivation
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
universe u v
namespace MvPolynomial
open Set Function Finsupp
variable {R : Type u} {Ο : Type v} {a a' aβ aβ : R} {s : Ο ββ β}
section PDeriv
variable [CommSemiring R]
def pderiv (i : Ο) : Derivation R (MvPolynomial Ο R) (MvPolynomial Ο R) :=
letI := Classical.decEq Ο
mkDerivation R <| Pi.single i 1
#align mv_polynomial.pderiv MvPolynomial.pderiv
theorem pderiv_def [DecidableEq Ο] (i : Ο) : pderiv i = mkDerivation R (Pi.single i 1) := by
unfold pderiv; congr!
#align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
@[simp]
theorem pderiv_monomial {i : Ο} :
pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) := by
classical
simp only [pderiv_def, mkDerivation_monomial, Finsupp.smul_sum, smul_eq_mul, β smul_mul_assoc,
β (monomial _).map_smul]
refine (Finset.sum_eq_single i (fun j _ hne => ?_) fun hi => ?_).trans ?_
Β· simp [Pi.single_eq_of_ne hne]
Β· rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
Β· simp
#align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
theorem pderiv_C {i : Ο} : pderiv i (C a) = 0 :=
derivation_C _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_C MvPolynomial.pderiv_C
theorem pderiv_one {i : Ο} : pderiv i (1 : MvPolynomial Ο R) = 0 := pderiv_C
#align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
@[simp]
theorem pderiv_X [DecidableEq Ο] (i j : Ο) :
pderiv i (X j : MvPolynomial Ο R) = Pi.single (f := fun j => _) i 1 j := by
rw [pderiv_def, mkDerivation_X]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X MvPolynomial.pderiv_X
@[simp]
theorem pderiv_X_self (i : Ο) : pderiv i (X i : MvPolynomial Ο R) = 1 := by classical simp
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
@[simp]
theorem pderiv_X_of_ne {i j : Ο} (h : j β i) : pderiv i (X j : MvPolynomial Ο R) = 0 := by
classical simp [h]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
theorem pderiv_eq_zero_of_not_mem_vars {i : Ο} {f : MvPolynomial Ο R} (h : i β f.vars) :
pderiv i f = 0 :=
derivation_eq_zero_of_forall_mem_vars fun _ hj => pderiv_X_of_ne <| ne_of_mem_of_not_mem hj h
#align mv_polynomial.pderiv_eq_zero_of_not_mem_vars MvPolynomial.pderiv_eq_zero_of_not_mem_vars
theorem pderiv_monomial_single {i : Ο} {n : β} : pderiv i (monomial (single i n) a) =
monomial (single i (n - 1)) (a * n) := by simp
#align mv_polynomial.pderiv_monomial_single MvPolynomial.pderiv_monomial_single
| Mathlib/Algebra/MvPolynomial/PDeriv.lean | 115 | 117 | theorem pderiv_mul {i : Ο} {f g : MvPolynomial Ο R} :
pderiv i (f * g) = pderiv i f * g + f * pderiv i g := by |
simp only [(pderiv i).leibniz f g, smul_eq_mul, mul_comm, add_comm]
| [
" pderiv i = mkDerivation R (Pi.single i 1)",
" mkDerivation R (Pi.single i 1) = mkDerivation R (Pi.single i 1)",
" (pderiv i) ((monomial s) a) = (monomial (s - single i 1)) (a * β(s i))",
" (s.sum fun a_1 b => (monomial (s - single a_1 1)) (a * βb) * Pi.single i 1 a_1) =\n (monomial (s - single i 1)) (a *... | [
" pderiv i = mkDerivation R (Pi.single i 1)",
" mkDerivation R (Pi.single i 1) = mkDerivation R (Pi.single i 1)",
" (pderiv i) ((monomial s) a) = (monomial (s - single i 1)) (a * β(s i))",
" (s.sum fun a_1 b => (monomial (s - single a_1 1)) (a * βb) * Pi.single i 1 a_1) =\n (monomial (s - single i 1)) (a *... |
import Mathlib.Analysis.Convex.StrictConvexSpace
#align_import analysis.convex.uniform from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3"
open Set Metric
open Convex Pointwise
class UniformConvexSpace (E : Type*) [SeminormedAddCommGroup E] : Prop where
uniform_convex : β β¦Ξ΅ : ββ¦,
0 < Ξ΅ β β Ξ΄, 0 < Ξ΄ β§ β β¦x : Eβ¦, βxβ = 1 β β β¦yβ¦, βyβ = 1 β Ξ΅ β€ βx - yβ β βx + yβ β€ 2 - Ξ΄
#align uniform_convex_space UniformConvexSpace
variable {E : Type*}
section SeminormedAddCommGroup
variable (E) [SeminormedAddCommGroup E] [UniformConvexSpace E] {Ξ΅ : β}
theorem exists_forall_sphere_dist_add_le_two_sub (hΞ΅ : 0 < Ξ΅) :
β Ξ΄, 0 < Ξ΄ β§ β β¦x : Eβ¦, βxβ = 1 β β β¦yβ¦, βyβ = 1 β Ξ΅ β€ βx - yβ β βx + yβ β€ 2 - Ξ΄ :=
UniformConvexSpace.uniform_convex hΞ΅
#align exists_forall_sphere_dist_add_le_two_sub exists_forall_sphere_dist_add_le_two_sub
variable [NormedSpace β E]
theorem exists_forall_closed_ball_dist_add_le_two_sub (hΞ΅ : 0 < Ξ΅) :
β Ξ΄, 0 < Ξ΄ β§ β β¦x : Eβ¦, βxβ β€ 1 β β β¦yβ¦, βyβ β€ 1 β Ξ΅ β€ βx - yβ β βx + yβ β€ 2 - Ξ΄ := by
have hΞ΅' : 0 < Ξ΅ / 3 := div_pos hΞ΅ zero_lt_three
obtain β¨Ξ΄, hΞ΄, hβ© := exists_forall_sphere_dist_add_le_two_sub E hΞ΅'
set Ξ΄' := min (1 / 2) (min (Ξ΅ / 3) <| Ξ΄ / 3)
refine β¨Ξ΄', lt_min one_half_pos <| lt_min hΞ΅' (div_pos hΞ΄ zero_lt_three), fun x hx y hy hxy => ?_β©
obtain hx' | hx' := le_or_lt βxβ (1 - Ξ΄')
Β· rw [β one_add_one_eq_two]
exact (norm_add_le_of_le hx' hy).trans (sub_add_eq_add_sub _ _ _).le
obtain hy' | hy' := le_or_lt βyβ (1 - Ξ΄')
Β· rw [β one_add_one_eq_two]
exact (norm_add_le_of_le hx hy').trans (add_sub_assoc _ _ _).ge
have hΞ΄' : 0 < 1 - Ξ΄' := sub_pos_of_lt (min_lt_of_left_lt one_half_lt_one)
have hβ : β z : E, 1 - Ξ΄' < βzβ β ββzββ»ΒΉ β’ zβ = 1 := by
rintro z hz
rw [norm_smul_of_nonneg (inv_nonneg.2 <| norm_nonneg _), inv_mul_cancel (hΞ΄'.trans hz).ne']
have hβ : β z : E, βzβ β€ 1 β 1 - Ξ΄' β€ βzβ β ββzββ»ΒΉ β’ z - zβ β€ Ξ΄' := by
rintro z hz hΞ΄z
nth_rw 3 [β one_smul β z]
rwa [β sub_smul, norm_smul_of_nonneg (sub_nonneg_of_le <| one_le_inv (hΞ΄'.trans_le hΞ΄z) hz),
sub_mul, inv_mul_cancel (hΞ΄'.trans_le hΞ΄z).ne', one_mul, sub_le_comm]
set x' := βxββ»ΒΉ β’ x
set y' := βyββ»ΒΉ β’ y
have hxy' : Ξ΅ / 3 β€ βx' - y'β :=
calc
Ξ΅ / 3 = Ξ΅ - (Ξ΅ / 3 + Ξ΅ / 3) := by ring
_ β€ βx - yβ - (βx' - xβ + βy' - yβ) := by
gcongr
Β· exact (hβ _ hx hx'.le).trans <| min_le_of_right_le <| min_le_left _ _
Β· exact (hβ _ hy hy'.le).trans <| min_le_of_right_le <| min_le_left _ _
_ β€ _ := by
have : β x' y', x - y = x' - y' + (x - x') + (y' - y) := fun _ _ => by abel
rw [sub_le_iff_le_add, norm_sub_rev _ x, β add_assoc, this]
exact norm_addβ_le _ _ _
calc
βx + yβ β€ βx' + y'β + βx' - xβ + βy' - yβ := by
have : β x' y', x + y = x' + y' + (x - x') + (y - y') := fun _ _ => by abel
rw [norm_sub_rev, norm_sub_rev y', this]
exact norm_addβ_le _ _ _
_ β€ 2 - Ξ΄ + Ξ΄' + Ξ΄' :=
(add_le_add_three (h (hβ _ hx') (hβ _ hy') hxy') (hβ _ hx hx'.le) (hβ _ hy hy'.le))
_ β€ 2 - Ξ΄' := by
dsimp [Ξ΄']
rw [β le_sub_iff_add_le, β le_sub_iff_add_le, sub_sub, sub_sub]
refine sub_le_sub_left ?_ _
ring_nf
rw [β mul_div_cancelβ Ξ΄ three_ne_zero]
set_option tactic.skipAssignedInstances false in norm_num
-- Porting note: these three extra lines needed to make `exact` work
have : 3 * (Ξ΄ / 3) * (1 / 3) = Ξ΄ / 3 := by linarith
rw [this, mul_comm]
gcongr
exact min_le_of_right_le <| min_le_right _ _
#align exists_forall_closed_ball_dist_add_le_two_sub exists_forall_closed_ball_dist_add_le_two_sub
| Mathlib/Analysis/Convex/Uniform.lean | 115 | 126 | theorem exists_forall_closed_ball_dist_add_le_two_mul_sub (hΞ΅ : 0 < Ξ΅) (r : β) :
β Ξ΄, 0 < Ξ΄ β§ β β¦x : Eβ¦, βxβ β€ r β β β¦yβ¦, βyβ β€ r β Ξ΅ β€ βx - yβ β βx + yβ β€ 2 * r - Ξ΄ := by |
obtain hr | hr := le_or_lt r 0
Β· exact β¨1, one_pos, fun x hx y hy h => (hΞ΅.not_le <|
h.trans <| (norm_sub_le _ _).trans <| add_nonpos (hx.trans hr) (hy.trans hr)).elimβ©
obtain β¨Ξ΄, hΞ΄, hβ© := exists_forall_closed_ball_dist_add_le_two_sub E (div_pos hΞ΅ hr)
refine β¨Ξ΄ * r, mul_pos hΞ΄ hr, fun x hx y hy hxy => ?_β©
rw [β div_le_one hr, div_eq_inv_mul, β norm_smul_of_nonneg (inv_nonneg.2 hr.le)] at hx hy
have := h hx hy
simp_rw [β smul_add, β smul_sub, norm_smul_of_nonneg (inv_nonneg.2 hr.le), β div_eq_inv_mul,
div_le_div_right hr, div_le_iff hr, sub_mul] at this
exact this hxy
| [
" β Ξ΄, 0 < Ξ΄ β§ β β¦x : Eβ¦, βxβ β€ 1 β β β¦y : Eβ¦, βyβ β€ 1 β Ξ΅ β€ βx - yβ β βx + yβ β€ 2 - Ξ΄",
" βx + yβ β€ 2 - Ξ΄'",
" βx + yβ β€ 1 + 1 - Ξ΄'",
" β (z : E), 1 - Ξ΄' < βzβ β ββzββ»ΒΉ β’ zβ = 1",
" ββzββ»ΒΉ β’ zβ = 1",
" β (z : E), βzβ β€ 1 β 1 - Ξ΄' β€ βzβ β ββzββ»ΒΉ β’ z - zβ β€ Ξ΄'",
" ββzββ»ΒΉ β’ z - zβ β€ Ξ΄'",
" ββzββ»ΒΉ β’ z - ... | [
" β Ξ΄, 0 < Ξ΄ β§ β β¦x : Eβ¦, βxβ β€ 1 β β β¦y : Eβ¦, βyβ β€ 1 β Ξ΅ β€ βx - yβ β βx + yβ β€ 2 - Ξ΄",
" βx + yβ β€ 2 - Ξ΄'",
" βx + yβ β€ 1 + 1 - Ξ΄'",
" β (z : E), 1 - Ξ΄' < βzβ β ββzββ»ΒΉ β’ zβ = 1",
" ββzββ»ΒΉ β’ zβ = 1",
" β (z : E), βzβ β€ 1 β 1 - Ξ΄' β€ βzβ β ββzββ»ΒΉ β’ z - zβ β€ Ξ΄'",
" ββzββ»ΒΉ β’ z - zβ β€ Ξ΄'",
" ββzββ»ΒΉ β’ z - ... |
import Mathlib.Algebra.GeomSum
import Mathlib.Order.Filter.Archimedean
import Mathlib.Order.Iterate
import Mathlib.Topology.Algebra.Algebra
import Mathlib.Topology.Algebra.InfiniteSum.Real
#align_import analysis.specific_limits.basic from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
noncomputable section
open scoped Classical
open Set Function Filter Finset Metric
open scoped Classical
open Topology Nat uniformity NNReal ENNReal
variable {Ξ± : Type*} {Ξ² : Type*} {ΞΉ : Type*}
theorem tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : β β¦ (n : β)β»ΒΉ) atTop (π 0) :=
tendsto_inv_atTop_zero.comp tendsto_natCast_atTop_atTop
#align tendsto_inverse_at_top_nhds_0_nat tendsto_inverse_atTop_nhds_zero_nat
@[deprecated (since := "2024-01-31")]
alias tendsto_inverse_atTop_nhds_0_nat := tendsto_inverse_atTop_nhds_zero_nat
| Mathlib/Analysis/SpecificLimits/Basic.lean | 39 | 41 | theorem tendsto_const_div_atTop_nhds_zero_nat (C : β) :
Tendsto (fun n : β β¦ C / n) atTop (π 0) := by |
simpa only [mul_zero] using tendsto_const_nhds.mul tendsto_inverse_atTop_nhds_zero_nat
| [
" Tendsto (fun n => C / βn) atTop (π 0)"
] | [
" Tendsto (fun n => C / βn) atTop (π 0)"
] |
import Mathlib.LinearAlgebra.Ray
import Mathlib.Analysis.NormedSpace.Real
#align_import analysis.normed_space.ray from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
open Real
variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β E] {F : Type*}
[NormedAddCommGroup F] [NormedSpace β F]
namespace SameRay
variable {x y : E}
| Mathlib/Analysis/NormedSpace/Ray.lean | 32 | 35 | theorem norm_add (h : SameRay β x y) : βx + yβ = βxβ + βyβ := by |
rcases h.exists_eq_smul with β¨u, a, b, ha, hb, -, rfl, rflβ©
rw [β add_smul, norm_smul_of_nonneg (add_nonneg ha hb), norm_smul_of_nonneg ha,
norm_smul_of_nonneg hb, add_mul]
| [
" βx + yβ = βxβ + βyβ",
" βa β’ u + b β’ uβ = βa β’ uβ + βb β’ uβ"
] | [
" βx + yβ = βxβ + βyβ"
] |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.BigOperators
import Mathlib.LinearAlgebra.AffineSpace.AffineMap
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.Tactic.FinCases
#align_import linear_algebra.affine_space.combination from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
noncomputable section
open Affine
namespace Finset
theorem univ_fin2 : (univ : Finset (Fin 2)) = {0, 1} := by
ext x
fin_cases x <;> simp
#align finset.univ_fin2 Finset.univ_fin2
variable {k : Type*} {V : Type*} {P : Type*} [Ring k] [AddCommGroup V] [Module k V]
variable [S : AffineSpace V P]
variable {ΞΉ : Type*} (s : Finset ΞΉ)
variable {ΞΉβ : Type*} (sβ : Finset ΞΉβ)
def weightedVSubOfPoint (p : ΞΉ β P) (b : P) : (ΞΉ β k) ββ[k] V :=
β i β s, (LinearMap.proj i : (ΞΉ β k) ββ[k] k).smulRight (p i -α΅₯ b)
#align finset.weighted_vsub_of_point Finset.weightedVSubOfPoint
@[simp]
theorem weightedVSubOfPoint_apply (w : ΞΉ β k) (p : ΞΉ β P) (b : P) :
s.weightedVSubOfPoint p b w = β i β s, w i β’ (p i -α΅₯ b) := by
simp [weightedVSubOfPoint, LinearMap.sum_apply]
#align finset.weighted_vsub_of_point_apply Finset.weightedVSubOfPoint_apply
@[simp (high)]
theorem weightedVSubOfPoint_apply_const (w : ΞΉ β k) (p : P) (b : P) :
s.weightedVSubOfPoint (fun _ => p) b w = (β i β s, w i) β’ (p -α΅₯ b) := by
rw [weightedVSubOfPoint_apply, sum_smul]
#align finset.weighted_vsub_of_point_apply_const Finset.weightedVSubOfPoint_apply_const
| Mathlib/LinearAlgebra/AffineSpace/Combination.lean | 86 | 91 | theorem weightedVSubOfPoint_congr {wβ wβ : ΞΉ β k} (hw : β i β s, wβ i = wβ i) {pβ pβ : ΞΉ β P}
(hp : β i β s, pβ i = pβ i) (b : P) :
s.weightedVSubOfPoint pβ b wβ = s.weightedVSubOfPoint pβ b wβ := by |
simp_rw [weightedVSubOfPoint_apply]
refine sum_congr rfl fun i hi => ?_
rw [hw i hi, hp i hi]
| [
" univ = {0, 1}",
" x β univ β x β {0, 1}",
" β¨0, β―β© β univ β β¨0, β―β© β {0, 1}",
" β¨1, β―β© β univ β β¨1, β―β© β {0, 1}",
" (s.weightedVSubOfPoint p b) w = β i β s, w i β’ (p i -α΅₯ b)",
" (s.weightedVSubOfPoint (fun x => p) b) w = (β i β s, w i) β’ (p -α΅₯ b)",
" (s.weightedVSubOfPoint pβ b) wβ = (s.weightedVSubOf... | [
" univ = {0, 1}",
" x β univ β x β {0, 1}",
" β¨0, β―β© β univ β β¨0, β―β© β {0, 1}",
" β¨1, β―β© β univ β β¨1, β―β© β {0, 1}",
" (s.weightedVSubOfPoint p b) w = β i β s, w i β’ (p i -α΅₯ b)",
" (s.weightedVSubOfPoint (fun x => p) b) w = (β i β s, w i) β’ (p -α΅₯ b)",
" (s.weightedVSubOfPoint pβ b) wβ = (s.weightedVSubOf... |
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Combinatorics.Additive.AP.Three.Defs
import Mathlib.Combinatorics.Pigeonhole
import Mathlib.Data.Complex.ExponentialBounds
#align_import combinatorics.additive.behrend from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8"
open Nat hiding log
open Finset Metric Real
open scoped Pointwise
lemma threeAPFree_frontier {π E : Type*} [LinearOrderedField π] [TopologicalSpace E]
[AddCommMonoid E] [Module π E] {s : Set E} (hsβ : IsClosed s) (hsβ : StrictConvex π s) :
ThreeAPFree (frontier s) := by
intro a ha b hb c hc habc
obtain rfl : (1 / 2 : π) β’ a + (1 / 2 : π) β’ c = b := by
rwa [β smul_add, one_div, inv_smul_eq_iffβ (show (2 : π) β 0 by norm_num), two_smul]
have :=
hsβ.eq (hsβ.frontier_subset ha) (hsβ.frontier_subset hc) one_half_pos one_half_pos
(add_halves _) hb.2
simp [this, β add_smul]
ring_nf
simp
#align add_salem_spencer_frontier threeAPFree_frontier
lemma threeAPFree_sphere {E : Type*} [NormedAddCommGroup E] [NormedSpace β E]
[StrictConvexSpace β E] (x : E) (r : β) : ThreeAPFree (sphere x r) := by
obtain rfl | hr := eq_or_ne r 0
Β· rw [sphere_zero]
exact threeAPFree_singleton _
Β· convert threeAPFree_frontier isClosed_ball (strictConvex_closedBall β x r)
exact (frontier_closedBall _ hr).symm
#align add_salem_spencer_sphere threeAPFree_sphere
namespace Behrend
variable {Ξ± Ξ² : Type*} {n d k N : β} {x : Fin n β β}
def box (n d : β) : Finset (Fin n β β) :=
Fintype.piFinset fun _ => range d
#align behrend.box Behrend.box
theorem mem_box : x β box n d β β i, x i < d := by simp only [box, Fintype.mem_piFinset, mem_range]
#align behrend.mem_box Behrend.mem_box
@[simp]
| Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean | 101 | 101 | theorem card_box : (box n d).card = d ^ n := by | simp [box]
| [
" ThreeAPFree (frontier s)",
" a = b",
" (1 / 2) β’ a + (1 / 2) β’ c = b",
" 2 β 0",
" a = (1 / 2) β’ a + (1 / 2) β’ c",
" c = (2β»ΒΉ + 2β»ΒΉ) β’ c",
" c = 1 β’ c",
" ThreeAPFree (sphere x r)",
" ThreeAPFree (sphere x 0)",
" ThreeAPFree {x}",
" sphere x r = frontier (closedBall x r)",
" x β box n d β β ... | [
" ThreeAPFree (frontier s)",
" a = b",
" (1 / 2) β’ a + (1 / 2) β’ c = b",
" 2 β 0",
" a = (1 / 2) β’ a + (1 / 2) β’ c",
" c = (2β»ΒΉ + 2β»ΒΉ) β’ c",
" c = 1 β’ c",
" ThreeAPFree (sphere x r)",
" ThreeAPFree (sphere x 0)",
" ThreeAPFree {x}",
" sphere x r = frontier (closedBall x r)",
" x β box n d β β ... |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open 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 {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
section Composition
variable {π' : Type*} [NontriviallyNormedField π'] [NormedAlgebra π π'] [NormedSpace π' F]
[IsScalarTower π π' F] {s' t' : Set π'} {h : π β π'} {hβ : π β π} {hβ : π' β π'} {h' hβ' : π'}
{hβ' : π} {gβ : π' β F} {gβ' : F} {L' : Filter π'} {y : π'} (x)
theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter gβ gβ' (h x) L')
(hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by
simpa using ((hg.restrictScalars π).comp x hh hL).hasDerivAtFilter
#align has_deriv_at_filter.scomp HasDerivAtFilter.scomp
theorem HasDerivAtFilter.scomp_of_eq (hg : HasDerivAtFilter gβ gβ' y L')
(hh : HasDerivAtFilter h h' x L) (hy : y = h x) (hL : Tendsto h L L') :
HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by
rw [hy] at hg; exact hg.scomp x hh hL
theorem HasDerivWithinAt.scomp_hasDerivAt (hg : HasDerivWithinAt gβ gβ' s' (h x))
(hh : HasDerivAt h h' x) (hs : β x, h x β s') : HasDerivAt (gβ β h) (h' β’ gβ') x :=
hg.scomp x hh <| tendsto_inf.2 β¨hh.continuousAt, tendsto_principal.2 <| eventually_of_forall hsβ©
#align has_deriv_within_at.scomp_has_deriv_at HasDerivWithinAt.scomp_hasDerivAt
theorem HasDerivWithinAt.scomp_hasDerivAt_of_eq (hg : HasDerivWithinAt gβ gβ' s' y)
(hh : HasDerivAt h h' x) (hs : β x, h x β s') (hy : y = h x) :
HasDerivAt (gβ β h) (h' β’ gβ') x := by
rw [hy] at hg; exact hg.scomp_hasDerivAt x hh hs
nonrec theorem HasDerivWithinAt.scomp (hg : HasDerivWithinAt gβ gβ' t' (h x))
(hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') :
HasDerivWithinAt (gβ β h) (h' β’ gβ') s x :=
hg.scomp x hh <| hh.continuousWithinAt.tendsto_nhdsWithin hst
#align has_deriv_within_at.scomp HasDerivWithinAt.scomp
theorem HasDerivWithinAt.scomp_of_eq (hg : HasDerivWithinAt gβ gβ' t' y)
(hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') (hy : y = h x) :
HasDerivWithinAt (gβ β h) (h' β’ gβ') s x := by
rw [hy] at hg; exact hg.scomp x hh hst
nonrec theorem HasDerivAt.scomp (hg : HasDerivAt gβ gβ' (h x)) (hh : HasDerivAt h h' x) :
HasDerivAt (gβ β h) (h' β’ gβ') x :=
hg.scomp x hh hh.continuousAt
#align has_deriv_at.scomp HasDerivAt.scomp
theorem HasDerivAt.scomp_of_eq
(hg : HasDerivAt gβ gβ' y) (hh : HasDerivAt h h' x) (hy : y = h x) :
HasDerivAt (gβ β h) (h' β’ gβ') x := by
rw [hy] at hg; exact hg.scomp x hh
| Mathlib/Analysis/Calculus/Deriv/Comp.lean | 118 | 120 | theorem HasStrictDerivAt.scomp (hg : HasStrictDerivAt gβ gβ' (h x)) (hh : HasStrictDerivAt h h' x) :
HasStrictDerivAt (gβ β h) (h' β’ gβ') x := by |
simpa using ((hg.restrictScalars π).comp x hh).hasStrictDerivAt
| [
" HasDerivAtFilter (gβ β h) (h' β’ gβ') x L",
" HasDerivAt (gβ β h) (h' β’ gβ') x",
" HasDerivWithinAt (gβ β h) (h' β’ gβ') s x",
" HasStrictDerivAt (gβ β h) (h' β’ gβ') x"
] | [
" HasDerivAtFilter (gβ β h) (h' β’ gβ') x L",
" HasDerivAt (gβ β h) (h' β’ gβ') x",
" HasDerivWithinAt (gβ β h) (h' β’ gβ') s x",
" HasStrictDerivAt (gβ β h) (h' β’ gβ') x"
] |
import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine
import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine
import Mathlib.Tactic.IntervalCases
#align_import geometry.euclidean.triangle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped Classical
open scoped Real
open scoped RealInnerProductSpace
namespace InnerProductGeometry
variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β V]
theorem norm_sub_sq_eq_norm_sq_add_norm_sq_sub_two_mul_norm_mul_norm_mul_cos_angle (x y : V) :
βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ - 2 * βxβ * βyβ * Real.cos (angle x y) := by
rw [show 2 * βxβ * βyβ * Real.cos (angle x y) = 2 * (Real.cos (angle x y) * (βxβ * βyβ)) by ring,
cos_angle_mul_norm_mul_norm, β real_inner_self_eq_norm_mul_norm, β
real_inner_self_eq_norm_mul_norm, β real_inner_self_eq_norm_mul_norm, real_inner_sub_sub_self,
sub_add_eq_add_sub]
#align inner_product_geometry.norm_sub_sq_eq_norm_sq_add_norm_sq_sub_two_mul_norm_mul_norm_mul_cos_angle InnerProductGeometry.norm_sub_sq_eq_norm_sq_add_norm_sq_sub_two_mul_norm_mul_norm_mul_cos_angle
theorem angle_sub_eq_angle_sub_rev_of_norm_eq {x y : V} (h : βxβ = βyβ) :
angle x (x - y) = angle y (y - x) := by
refine Real.injOn_cos β¨angle_nonneg _ _, angle_le_pi _ _β© β¨angle_nonneg _ _, angle_le_pi _ _β© ?_
rw [cos_angle, cos_angle, h, β neg_sub, norm_neg, neg_sub, inner_sub_right, inner_sub_right,
real_inner_self_eq_norm_mul_norm, real_inner_self_eq_norm_mul_norm, h, real_inner_comm x y]
#align inner_product_geometry.angle_sub_eq_angle_sub_rev_of_norm_eq InnerProductGeometry.angle_sub_eq_angle_sub_rev_of_norm_eq
| Mathlib/Geometry/Euclidean/Triangle.lean | 79 | 104 | theorem norm_eq_of_angle_sub_eq_angle_sub_rev_of_angle_ne_pi {x y : V}
(h : angle x (x - y) = angle y (y - x)) (hpi : angle x y β Ο) : βxβ = βyβ := by |
replace h := Real.arccos_injOn (abs_le.mp (abs_real_inner_div_norm_mul_norm_le_one x (x - y)))
(abs_le.mp (abs_real_inner_div_norm_mul_norm_le_one y (y - x))) h
by_cases hxy : x = y
Β· rw [hxy]
Β· rw [β norm_neg (y - x), neg_sub, mul_comm, mul_comm βyβ, div_eq_mul_inv, div_eq_mul_inv,
mul_inv_rev, mul_inv_rev, β mul_assoc, β mul_assoc] at h
replace h :=
mul_right_cancelβ (inv_ne_zero fun hz => hxy (eq_of_sub_eq_zero (norm_eq_zero.1 hz))) h
rw [inner_sub_right, inner_sub_right, real_inner_comm x y, real_inner_self_eq_norm_mul_norm,
real_inner_self_eq_norm_mul_norm, mul_sub_right_distrib, mul_sub_right_distrib,
mul_self_mul_inv, mul_self_mul_inv, sub_eq_sub_iff_sub_eq_sub, β mul_sub_left_distrib] at h
by_cases hx0 : x = 0
Β· rw [hx0, norm_zero, inner_zero_left, zero_mul, zero_sub, neg_eq_zero] at h
rw [hx0, norm_zero, h]
Β· by_cases hy0 : y = 0
Β· rw [hy0, norm_zero, inner_zero_right, zero_mul, sub_zero] at h
rw [hy0, norm_zero, h]
Β· rw [inv_sub_inv (fun hz => hx0 (norm_eq_zero.1 hz)) fun hz => hy0 (norm_eq_zero.1 hz), β
neg_sub, β mul_div_assoc, mul_comm, mul_div_assoc, β mul_neg_one] at h
symm
by_contra hyx
replace h := (mul_left_cancelβ (sub_ne_zero_of_ne hyx) h).symm
rw [real_inner_div_norm_mul_norm_eq_neg_one_iff, β angle_eq_pi_iff] at h
exact hpi h
| [
" βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ - 2 * βxβ * βyβ * (angle x y).cos",
" 2 * βxβ * βyβ * (angle x y).cos = 2 * ((angle x y).cos * (βxβ * βyβ))",
" angle x (x - y) = angle y (y - x)",
" (angle x (x - y)).cos = (angle y (y - x)).cos",
" βxβ = βyβ",
" βyβ = βxβ",
" False"
] | [
" βx - yβ * βx - yβ = βxβ * βxβ + βyβ * βyβ - 2 * βxβ * βyβ * (angle x y).cos",
" 2 * βxβ * βyβ * (angle x y).cos = 2 * ((angle x y).cos * (βxβ * βyβ))",
" angle x (x - y) = angle y (y - x)",
" (angle x (x - y)).cos = (angle y (y - x)).cos",
" βxβ = βyβ"
] |
import Mathlib.Data.Set.Basic
#align_import order.well_founded from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592"
variable {Ξ± Ξ² Ξ³ : Type*}
namespace WellFounded
variable {r r' : Ξ± β Ξ± β Prop}
#align well_founded_relation.r WellFoundedRelation.rel
protected theorem isAsymm (h : WellFounded r) : IsAsymm Ξ± r := β¨h.asymmetricβ©
#align well_founded.is_asymm WellFounded.isAsymm
protected theorem isIrrefl (h : WellFounded r) : IsIrrefl Ξ± r := @IsAsymm.isIrrefl Ξ± r h.isAsymm
#align well_founded.is_irrefl WellFounded.isIrrefl
instance [WellFoundedRelation Ξ±] : IsAsymm Ξ± WellFoundedRelation.rel :=
WellFoundedRelation.wf.isAsymm
instance : IsIrrefl Ξ± WellFoundedRelation.rel := IsAsymm.isIrrefl
theorem mono (hr : WellFounded r) (h : β a b, r' a b β r a b) : WellFounded r' :=
Subrelation.wf (h _ _) hr
#align well_founded.mono WellFounded.mono
theorem onFun {Ξ± Ξ² : Sort*} {r : Ξ² β Ξ² β Prop} {f : Ξ± β Ξ²} :
WellFounded r β WellFounded (r on f) :=
InvImage.wf _
#align well_founded.on_fun WellFounded.onFun
theorem has_min {Ξ±} {r : Ξ± β Ξ± β Prop} (H : WellFounded r) (s : Set Ξ±) :
s.Nonempty β β a β s, β x β s, Β¬r x a
| β¨a, haβ© => show β b β s, β x β s, Β¬r x b from
Acc.recOn (H.apply a) (fun x _ IH =>
not_imp_not.1 fun hne hx => hne <| β¨x, hx, fun y hy hyx => hne <| IH y hyx hyβ©)
ha
#align well_founded.has_min WellFounded.has_min
noncomputable def min {r : Ξ± β Ξ± β Prop} (H : WellFounded r) (s : Set Ξ±) (h : s.Nonempty) : Ξ± :=
Classical.choose (H.has_min s h)
#align well_founded.min WellFounded.min
theorem min_mem {r : Ξ± β Ξ± β Prop} (H : WellFounded r) (s : Set Ξ±) (h : s.Nonempty) :
H.min s h β s :=
let β¨h, _β© := Classical.choose_spec (H.has_min s h)
h
#align well_founded.min_mem WellFounded.min_mem
theorem not_lt_min {r : Ξ± β Ξ± β Prop} (H : WellFounded r) (s : Set Ξ±) (h : s.Nonempty) {x}
(hx : x β s) : Β¬r x (H.min s h) :=
let β¨_, h'β© := Classical.choose_spec (H.has_min s h)
h' _ hx
#align well_founded.not_lt_min WellFounded.not_lt_min
| Mathlib/Order/WellFounded.lean | 82 | 89 | theorem wellFounded_iff_has_min {r : Ξ± β Ξ± β Prop} :
WellFounded r β β s : Set Ξ±, s.Nonempty β β m β s, β x β s, Β¬r x m := by |
refine β¨fun h => h.has_min, fun h => β¨fun x => ?_β©β©
by_contra hx
obtain β¨m, hm, hm'β© := h {x | Β¬Acc r x} β¨x, hxβ©
refine hm β¨_, fun y hy => ?_β©
by_contra hy'
exact hm' y hy' hy
| [
" WellFounded r β β (s : Set Ξ±), s.Nonempty β β m β s, β x β s, Β¬r x m",
" Acc r x",
" False",
" Acc r y"
] | [
" WellFounded r β β (s : Set Ξ±), s.Nonempty β β m β s, β x β s, Β¬r x m"
] |
import Mathlib.CategoryTheory.Abelian.Opposite
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels
import Mathlib.CategoryTheory.Preadditive.LeftExact
import Mathlib.CategoryTheory.Adjunction.Limits
import Mathlib.Algebra.Homology.Exact
import Mathlib.Tactic.TFAE
#align_import category_theory.abelian.exact from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe vβ vβ uβ uβ
noncomputable section
open CategoryTheory Limits Preadditive
variable {C : Type uβ} [Category.{vβ} C] [Abelian C]
namespace CategoryTheory
namespace Abelian
variable {X Y Z : C} (f : X βΆ Y) (g : Y βΆ Z)
attribute [local instance] hasEqualizers_of_hasKernels
theorem exact_iff_image_eq_kernel : Exact f g β imageSubobject f = kernelSubobject g := by
constructor
Β· intro h
have : IsIso (imageToKernel f g h.w) := have := h.epi; isIso_of_mono_of_epi _
refine Subobject.eq_of_comm (asIso (imageToKernel _ _ h.w)) ?_
simp
Β· apply exact_of_image_eq_kernel
#align category_theory.abelian.exact_iff_image_eq_kernel CategoryTheory.Abelian.exact_iff_image_eq_kernel
theorem exact_iff : Exact f g β f β« g = 0 β§ kernel.ΞΉ g β« cokernel.Ο f = 0 := by
constructor
Β· exact fun h β¦ β¨h.1, kernel_comp_cokernel f g hβ©
Β· refine fun h β¦ β¨h.1, ?_β©
suffices hl : IsLimit
(KernelFork.ofΞΉ (imageSubobject f).arrow (imageSubobject_arrow_comp_eq_zero h.1)) by
have : imageToKernel f g h.1 = (hl.conePointUniqueUpToIso (limit.isLimit _)).hom β«
(kernelSubobjectIso _).inv := by ext; simp
rw [this]
infer_instance
refine KernelFork.IsLimit.ofΞΉ _ _ (fun u hu β¦ ?_) ?_ (fun _ _ _ h β¦ ?_)
Β· refine kernel.lift (cokernel.Ο f) u ?_ β« (imageIsoImage f).hom β« (imageSubobjectIso _).inv
rw [β kernel.lift_ΞΉ g u hu, Category.assoc, h.2, comp_zero]
Β· aesop_cat
Β· rw [β cancel_mono (imageSubobject f).arrow, h]
simp
#align category_theory.abelian.exact_iff CategoryTheory.Abelian.exact_iff
theorem exact_iff' {cg : KernelFork g} (hg : IsLimit cg) {cf : CokernelCofork f}
(hf : IsColimit cf) : Exact f g β f β« g = 0 β§ cg.ΞΉ β« cf.Ο = 0 := by
constructor
Β· intro h
exact β¨h.1, fork_ΞΉ_comp_cofork_Ο f g h cg cfβ©
Β· rw [exact_iff]
refine fun h => β¨h.1, ?_β©
apply zero_of_epi_comp (IsLimit.conePointUniqueUpToIso hg (limit.isLimit _)).hom
apply zero_of_comp_mono (IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) hf).hom
simp [h.2]
#align category_theory.abelian.exact_iff' CategoryTheory.Abelian.exact_iff'
open List in
theorem exact_tfae :
TFAE [Exact f g, f β« g = 0 β§ kernel.ΞΉ g β« cokernel.Ο f = 0,
imageSubobject f = kernelSubobject g] := by
tfae_have 1 β 2; Β· apply exact_iff
tfae_have 1 β 3; Β· apply exact_iff_image_eq_kernel
tfae_finish
#align category_theory.abelian.exact_tfae CategoryTheory.Abelian.exact_tfae
nonrec theorem IsEquivalence.exact_iff {D : Type uβ} [Category.{vβ} D] [Abelian D] (F : C β₯€ D)
[F.IsEquivalence] : Exact (F.map f) (F.map g) β Exact f g := by
simp only [exact_iff, β F.map_eq_zero_iff, F.map_comp, Category.assoc, β
kernelComparison_comp_ΞΉ g F, β Ο_comp_cokernelComparison f F]
rw [IsIso.comp_left_eq_zero (kernelComparison g F), β Category.assoc,
IsIso.comp_right_eq_zero _ (cokernelComparison f F)]
#align category_theory.abelian.is_equivalence.exact_iff CategoryTheory.Abelian.IsEquivalence.exact_iff
| Mathlib/CategoryTheory/Abelian/Exact.lean | 115 | 120 | theorem exact_epi_comp_iff {W : C} (h : W βΆ X) [Epi h] : Exact (h β« f) g β Exact f g := by |
refine β¨fun hfg => ?_, fun h => exact_epi_comp hβ©
let hc := isCokernelOfComp _ _ (colimit.isColimit (parallelPair (h β« f) 0))
(by rw [β cancel_epi h, β Category.assoc, CokernelCofork.condition, comp_zero]) rfl
refine (exact_iff' _ _ (limit.isLimit _) hc).2 β¨?_, ((exact_iff _ _).1 hfg).2β©
exact zero_of_epi_comp h (by rw [β hfg.1, Category.assoc])
| [
" Exact f g β imageSubobject f = kernelSubobject g",
" Exact f g β imageSubobject f = kernelSubobject g",
" imageSubobject f = kernelSubobject g",
" (asIso (imageToKernel f g β―)).hom β« (kernelSubobject g).arrow = (imageSubobject f).arrow",
" imageSubobject f = kernelSubobject g β Exact f g",
" Exact f g β... | [
" Exact f g β imageSubobject f = kernelSubobject g",
" Exact f g β imageSubobject f = kernelSubobject g",
" imageSubobject f = kernelSubobject g",
" (asIso (imageToKernel f g β―)).hom β« (kernelSubobject g).arrow = (imageSubobject f).arrow",
" imageSubobject f = kernelSubobject g β Exact f g",
" Exact f g β... |
import Mathlib.Algebra.Lie.CartanSubalgebra
import Mathlib.Algebra.Lie.Weights.Basic
suppress_compilation
open Set
variable {R L : Type*} [CommRing R] [LieRing L] [LieAlgebra R L]
(H : LieSubalgebra R L) [LieAlgebra.IsNilpotent R H]
{M : Type*} [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
namespace LieAlgebra
open scoped TensorProduct
open TensorProduct.LieModule LieModule
abbrev rootSpace (Ο : H β R) : LieSubmodule R H L :=
weightSpace L Ο
#align lie_algebra.root_space LieAlgebra.rootSpace
theorem zero_rootSpace_eq_top_of_nilpotent [IsNilpotent R L] :
rootSpace (β€ : LieSubalgebra R L) 0 = β€ :=
zero_weightSpace_eq_top_of_nilpotent L
#align lie_algebra.zero_root_space_eq_top_of_nilpotent LieAlgebra.zero_rootSpace_eq_top_of_nilpotent
@[simp]
theorem rootSpace_comap_eq_weightSpace (Ο : H β R) :
(rootSpace H Ο).comap H.incl' = weightSpace H Ο :=
comap_weightSpace_eq_of_injective Subtype.coe_injective
#align lie_algebra.root_space_comap_eq_weight_space LieAlgebra.rootSpace_comap_eq_weightSpace
variable {H}
theorem lie_mem_weightSpace_of_mem_weightSpace {Οβ Οβ : H β R} {x : L} {m : M}
(hx : x β rootSpace H Οβ) (hm : m β weightSpace M Οβ) : β
x, mβ β weightSpace M (Οβ + Οβ) := by
rw [weightSpace, LieSubmodule.mem_iInf]
intro y
replace hx : x β weightSpaceOf L (Οβ y) y := by
rw [rootSpace, weightSpace, LieSubmodule.mem_iInf] at hx; exact hx y
replace hm : m β weightSpaceOf M (Οβ y) y := by
rw [weightSpace, LieSubmodule.mem_iInf] at hm; exact hm y
exact lie_mem_maxGenEigenspace_toEnd hx hm
#align lie_algebra.lie_mem_weight_space_of_mem_weight_space LieAlgebra.lie_mem_weightSpace_of_mem_weightSpace
lemma toEnd_pow_apply_mem {Οβ Οβ : H β R} {x : L} {m : M}
(hx : x β rootSpace H Οβ) (hm : m β weightSpace M Οβ) (n) :
(toEnd R L M x ^ n : Module.End R M) m β weightSpace M (n β’ Οβ + Οβ) := by
induction n
Β· simpa using hm
Β· next n IH =>
simp only [pow_succ', LinearMap.mul_apply, toEnd_apply_apply,
Nat.cast_add, Nat.cast_one, rootSpace]
convert lie_mem_weightSpace_of_mem_weightSpace hx IH using 2
rw [succ_nsmul, β add_assoc, add_comm (n β’ _)]
variable (R L H M)
def rootSpaceWeightSpaceProductAux {Οβ Οβ Οβ : H β R} (hΟ : Οβ + Οβ = Οβ) :
rootSpace H Οβ ββ[R] weightSpace M Οβ ββ[R] weightSpace M Οβ where
toFun x :=
{ toFun := fun m =>
β¨β
(x : L), (m : M)β, hΟ βΈ lie_mem_weightSpace_of_mem_weightSpace x.property m.propertyβ©
map_add' := fun m n => by simp only [LieSubmodule.coe_add, lie_add]; rfl
map_smul' := fun t m => by
dsimp only
conv_lhs =>
congr
rw [LieSubmodule.coe_smul, lie_smul]
rfl }
map_add' x y := by
ext m
simp only [AddSubmonoid.coe_add, Submodule.coe_toAddSubmonoid, add_lie, LinearMap.coe_mk,
AddHom.coe_mk, LinearMap.add_apply, AddSubmonoid.mk_add_mk]
map_smul' t x := by
simp only [RingHom.id_apply]
ext m
simp only [SetLike.val_smul, smul_lie, LinearMap.coe_mk, AddHom.coe_mk, LinearMap.smul_apply,
SetLike.mk_smul_mk]
#align lie_algebra.root_space_weight_space_product_aux LieAlgebra.rootSpaceWeightSpaceProductAux
-- Porting note (#11083): this def is _really_ slow
-- See https://github.com/leanprover-community/mathlib4/issues/5028
def rootSpaceWeightSpaceProduct (Οβ Οβ Οβ : H β R) (hΟ : Οβ + Οβ = Οβ) :
rootSpace H Οβ β[R] weightSpace M Οβ βββ
R,Hβ weightSpace M Οβ :=
liftLie R H (rootSpace H Οβ) (weightSpace M Οβ) (weightSpace M Οβ)
{ toLinearMap := rootSpaceWeightSpaceProductAux R L H M hΟ
map_lie' := fun {x y} => by
ext m
simp only [rootSpaceWeightSpaceProductAux, LieSubmodule.coe_bracket,
LieSubalgebra.coe_bracket_of_module, lie_lie, LinearMap.coe_mk, AddHom.coe_mk,
Subtype.coe_mk, LieHom.lie_apply, LieSubmodule.coe_sub] }
#align lie_algebra.root_space_weight_space_product LieAlgebra.rootSpaceWeightSpaceProduct
@[simp]
theorem coe_rootSpaceWeightSpaceProduct_tmul (Οβ Οβ Οβ : H β R) (hΟ : Οβ + Οβ = Οβ)
(x : rootSpace H Οβ) (m : weightSpace M Οβ) :
(rootSpaceWeightSpaceProduct R L H M Οβ Οβ Οβ hΟ (x ββ m) : M) = β
(x : L), (m : M)β := by
simp only [rootSpaceWeightSpaceProduct, rootSpaceWeightSpaceProductAux, coe_liftLie_eq_lift_coe,
AddHom.toFun_eq_coe, LinearMap.coe_toAddHom, lift_apply, LinearMap.coe_mk, AddHom.coe_mk,
Submodule.coe_mk]
#align lie_algebra.coe_root_space_weight_space_product_tmul LieAlgebra.coe_rootSpaceWeightSpaceProduct_tmul
| Mathlib/Algebra/Lie/Weights/Cartan.lean | 135 | 141 | theorem mapsTo_toEnd_weightSpace_add_of_mem_rootSpace (Ξ± Ο : H β R)
{x : L} (hx : x β rootSpace H Ξ±) :
MapsTo (toEnd R L M x) (weightSpace M Ο) (weightSpace M (Ξ± + Ο)) := by |
intro m hm
let x' : rootSpace H Ξ± := β¨x, hxβ©
let m' : weightSpace M Ο := β¨m, hmβ©
exact (rootSpaceWeightSpaceProduct R L H M Ξ± Ο (Ξ± + Ο) rfl (x' ββ m')).property
| [
" β
x, mβ β weightSpace M (Οβ + Οβ)",
" β (i : β₯H), β
x, mβ β weightSpaceOf M ((Οβ + Οβ) i) i",
" β
x, mβ β weightSpaceOf M ((Οβ + Οβ) y) y",
" x β weightSpaceOf L (Οβ y) y",
" m β weightSpaceOf M (Οβ y) y",
" ((toEnd R L M) x ^ n) m β weightSpace M (n β’ Οβ + Οβ)",
" ((toEnd R L M) x ^ 0) m β weightSpace M... | [
" β
x, mβ β weightSpace M (Οβ + Οβ)",
" β (i : β₯H), β
x, mβ β weightSpaceOf M ((Οβ + Οβ) i) i",
" β
x, mβ β weightSpaceOf M ((Οβ + Οβ) y) y",
" x β weightSpaceOf L (Οβ y) y",
" m β weightSpaceOf M (Οβ y) y",
" ((toEnd R L M) x ^ n) m β weightSpace M (n β’ Οβ + Οβ)",
" ((toEnd R L M) x ^ 0) m β weightSpace M... |
import Mathlib.GroupTheory.Coxeter.Length
import Mathlib.Data.ZMod.Parity
namespace CoxeterSystem
open List Matrix Function
variable {B : Type*}
variable {W : Type*} [Group W]
variable {M : CoxeterMatrix B} (cs : CoxeterSystem M W)
local prefix:100 "s" => cs.simple
local prefix:100 "Ο" => cs.wordProd
local prefix:100 "β" => cs.length
def IsReflection (t : W) : Prop := β w i, t = w * s i * wβ»ΒΉ
| Mathlib/GroupTheory/Coxeter/Inversion.lean | 61 | 61 | theorem isReflection_simple (i : B) : cs.IsReflection (s i) := by | use 1, i; simp
| [
" cs.IsReflection (cs.simple i)",
" cs.simple i = 1 * cs.simple i * 1β»ΒΉ"
] | [
" cs.IsReflection (cs.simple i)"
] |
import Mathlib.Topology.Baire.Lemmas
import Mathlib.Topology.Algebra.Group.Basic
open scoped Topology Pointwise
open MulAction Set Function
variable {G X : Type*} [TopologicalSpace G] [TopologicalSpace X]
[Group G] [TopologicalGroup G] [MulAction G X]
[SigmaCompactSpace G] [BaireSpace X] [T2Space X]
[ContinuousSMul G X] [IsPretransitive G X]
@[to_additive "Consider a sigma-compact additive group acting continuously and transitively on a
Baire space. Then the orbit map is open around zero. It follows in
`isOpenMap_vadd_of_sigmaCompact` that it is open around any point."]
| Mathlib/Topology/Algebra/Group/OpenMapping.lean | 37 | 88 | theorem smul_singleton_mem_nhds_of_sigmaCompact
{U : Set G} (hU : U β π 1) (x : X) : U β’ {x} β π x := by |
/- Consider a small closed neighborhood `V` of the identity. Then the group is covered by
countably many translates of `V`, say `gα΅’ V`. Let also `Kβ` be a sequence of compact sets covering
the space. Then the image of `Kβ β© gα΅’ V` in the orbit is compact, and their unions covers the
space. By Baire, one of them has nonempty interior. Then `gα΅’ V β’ x` has nonempty interior, and
so does `V β’ x`. Its interior contains a point `g' x` with `g' β V`. Then `g'β»ΒΉ β’ V β’ x` contains
a neighborhood of `x`, and it is included in `Vβ»ΒΉ β’ V β’ x`, which is itself contained in `U β’ x`
if `V` is small enough. -/
obtain β¨V, V_mem, V_closed, V_symm, VUβ© : β V β π (1 : G), IsClosed V β§ Vβ»ΒΉ = V β§ V * V β U :=
exists_closed_nhds_one_inv_eq_mul_subset hU
obtain β¨s, s_count, hsβ© : β (s : Set G), s.Countable β§ β g β s, g β’ V = univ := by
apply countable_cover_nhds_of_sigma_compact (fun g β¦ ?_)
convert smul_mem_nhds g V_mem
simp only [smul_eq_mul, mul_one]
let K : β β Set G := compactCovering G
let F : β Γ s β Set X := fun p β¦ (K p.1 β© (p.2 : G) β’ V) β’ ({x} : Set X)
obtain β¨β¨n, β¨g, hgβ©β©, hiβ© : β i, (interior (F i)).Nonempty := by
have : Nonempty X := β¨xβ©
have : Encodable s := Countable.toEncodable s_count
apply nonempty_interior_of_iUnion_of_closed
Β· rintro β¨n, β¨g, hgβ©β©
apply IsCompact.isClosed
suffices H : IsCompact ((fun (g : G) β¦ g β’ x) '' (K n β© g β’ V)) by
simpa only [F, smul_singleton] using H
apply IsCompact.image
Β· exact (isCompact_compactCovering G n).inter_right (V_closed.smul g)
Β· exact continuous_id.smul continuous_const
Β· apply eq_univ_iff_forall.2 (fun y β¦ ?_)
obtain β¨h, rflβ© : β h, h β’ x = y := exists_smul_eq G x y
obtain β¨n, hnβ© : β n, h β K n := exists_mem_compactCovering h
obtain β¨g, gs, hgβ© : β g β s, h β g β’ V := exists_set_mem_of_union_eq_top s _ hs _
simp only [F, smul_singleton, mem_iUnion, mem_image, mem_inter_iff, Prod.exists,
Subtype.exists, exists_prop]
exact β¨n, g, gs, h, β¨hn, hgβ©, rflβ©
have I : (interior ((g β’ V) β’ {x})).Nonempty := by
apply hi.mono
apply interior_mono
exact smul_subset_smul_right inter_subset_right
obtain β¨y, hyβ© : (interior (V β’ ({x} : Set X))).Nonempty := by
rw [smul_assoc, interior_smul] at I
exact smul_set_nonempty.1 I
obtain β¨g', hg', rflβ© : β g' β V, g' β’ x = y := by simpa using interior_subset hy
have J : (g' β»ΒΉ β’ V) β’ {x} β π x := by
apply mem_interior_iff_mem_nhds.1
rwa [smul_assoc, interior_smul, mem_inv_smul_set_iff]
have : (g'β»ΒΉ β’ V) β’ {x} β U β’ ({x} : Set X) := by
apply smul_subset_smul_right
apply Subset.trans (smul_set_subset_smul (inv_mem_inv.2 hg')) ?_
rw [V_symm]
exact VU
exact Filter.mem_of_superset J this
| [
" U β’ {x} β π x",
" β s, s.Countable β§ β g β s, g β’ V = univ",
" g β’ V β π g",
" g = g β’ 1",
" β i, (interior (F i)).Nonempty",
" β (i : β Γ βs), IsClosed (F i)",
" IsClosed (F (n, β¨g, hgβ©))",
" IsCompact (F (n, β¨g, hgβ©))",
" IsCompact ((fun g => g β’ x) '' (K n β© g β’ V))",
" IsCompact (K n β© g β’... | [
" U β’ {x} β π x"
] |
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
import Mathlib.MeasureTheory.Measure.Haar.Quotient
import Mathlib.MeasureTheory.Constructions.Polish
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Topology.Algebra.Order.Floor
#align_import measure_theory.integral.periodic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce"
open Set Function MeasureTheory MeasureTheory.Measure TopologicalSpace AddSubgroup intervalIntegral
open scoped MeasureTheory NNReal ENNReal
@[measurability]
protected theorem AddCircle.measurable_mk' {a : β} :
Measurable (Ξ² := AddCircle a) ((β) : β β AddCircle a) :=
Continuous.measurable <| AddCircle.continuous_mk' a
#align add_circle.measurable_mk' AddCircle.measurable_mk'
theorem isAddFundamentalDomain_Ioc {T : β} (hT : 0 < T) (t : β)
(ΞΌ : Measure β := by volume_tac) :
IsAddFundamentalDomain (AddSubgroup.zmultiples T) (Ioc t (t + T)) ΞΌ := by
refine IsAddFundamentalDomain.mk' measurableSet_Ioc.nullMeasurableSet fun x => ?_
have : Bijective (codRestrict (fun n : β€ => n β’ T) (AddSubgroup.zmultiples T) _) :=
(Equiv.ofInjective (fun n : β€ => n β’ T) (zsmul_strictMono_left hT).injective).bijective
refine this.existsUnique_iff.2 ?_
simpa only [add_comm x] using existsUnique_add_zsmul_mem_Ioc hT x t
#align is_add_fundamental_domain_Ioc isAddFundamentalDomain_Ioc
theorem isAddFundamentalDomain_Ioc' {T : β} (hT : 0 < T) (t : β) (ΞΌ : Measure β := by volume_tac) :
IsAddFundamentalDomain (AddSubgroup.op <| .zmultiples T) (Ioc t (t + T)) ΞΌ := by
refine IsAddFundamentalDomain.mk' measurableSet_Ioc.nullMeasurableSet fun x => ?_
have : Bijective (codRestrict (fun n : β€ => n β’ T) (AddSubgroup.zmultiples T) _) :=
(Equiv.ofInjective (fun n : β€ => n β’ T) (zsmul_strictMono_left hT).injective).bijective
refine (AddSubgroup.equivOp _).bijective.comp this |>.existsUnique_iff.2 ?_
simpa using existsUnique_add_zsmul_mem_Ioc hT x t
#align is_add_fundamental_domain_Ioc' isAddFundamentalDomain_Ioc'
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E]
namespace Function
namespace Periodic
variable {f : β β E} {T : β}
theorem intervalIntegral_add_eq_of_pos (hf : Periodic f T) (hT : 0 < T) (t s : β) :
β« x in t..t + T, f x = β« x in s..s + T, f x := by
simp only [integral_of_le, hT.le, le_add_iff_nonneg_right]
haveI : VAddInvariantMeasure (AddSubgroup.zmultiples T) β volume :=
β¨fun c s _ => measure_preimage_add _ _ _β©
apply IsAddFundamentalDomain.setIntegral_eq (G := AddSubgroup.zmultiples T)
exacts [isAddFundamentalDomain_Ioc hT t, isAddFundamentalDomain_Ioc hT s, hf.map_vadd_zmultiples]
#align function.periodic.interval_integral_add_eq_of_pos Function.Periodic.intervalIntegral_add_eq_of_pos
| Mathlib/MeasureTheory/Integral/Periodic.lean | 267 | 274 | theorem intervalIntegral_add_eq (hf : Periodic f T) (t s : β) :
β« x in t..t + T, f x = β« x in s..s + T, f x := by |
rcases lt_trichotomy (0 : β) T with (hT | rfl | hT)
Β· exact hf.intervalIntegral_add_eq_of_pos hT t s
Β· simp
Β· rw [β neg_inj, β integral_symm, β integral_symm]
simpa only [β sub_eq_add_neg, add_sub_cancel_right] using
hf.neg.intervalIntegral_add_eq_of_pos (neg_pos.2 hT) (t + T) (s + T)
| [
" IsAddFundamentalDomain (β₯(zmultiples T)) (Ioc t (t + T)) ΞΌ",
" β! g, g +α΅₯ x β Ioc t (t + T)",
" β! x_1, codRestrict (fun n => n β’ T) β(zmultiples T) β― x_1 +α΅₯ x β Ioc t (t + T)",
" IsAddFundamentalDomain (β₯(zmultiples T).op) (Ioc t (t + T)) ΞΌ",
" β! x_1, (β(zmultiples T).equivOp β codRestrict (fun n => n β’... | [
" IsAddFundamentalDomain (β₯(zmultiples T)) (Ioc t (t + T)) ΞΌ",
" β! g, g +α΅₯ x β Ioc t (t + T)",
" β! x_1, codRestrict (fun n => n β’ T) β(zmultiples T) β― x_1 +α΅₯ x β Ioc t (t + T)",
" IsAddFundamentalDomain (β₯(zmultiples T).op) (Ioc t (t + T)) ΞΌ",
" β! x_1, (β(zmultiples T).equivOp β codRestrict (fun n => n β’... |
import Mathlib.Analysis.Normed.Group.Hom
import Mathlib.Analysis.Normed.Group.Completion
#align_import analysis.normed.group.hom_completion from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3"
noncomputable section
open Set NormedAddGroupHom UniformSpace
section Completion
variable {G : Type*} [SeminormedAddCommGroup G] {H : Type*} [SeminormedAddCommGroup H]
{K : Type*} [SeminormedAddCommGroup K]
def NormedAddGroupHom.completion (f : NormedAddGroupHom G H) :
NormedAddGroupHom (Completion G) (Completion H) :=
.ofLipschitz (f.toAddMonoidHom.completion f.continuous) f.lipschitz.completion_map
#align normed_add_group_hom.completion NormedAddGroupHom.completion
theorem NormedAddGroupHom.completion_def (f : NormedAddGroupHom G H) (x : Completion G) :
f.completion x = Completion.map f x :=
rfl
#align normed_add_group_hom.completion_def NormedAddGroupHom.completion_def
@[simp]
theorem NormedAddGroupHom.completion_coe_to_fun (f : NormedAddGroupHom G H) :
(f.completion : Completion G β Completion H) = Completion.map f := rfl
#align normed_add_group_hom.completion_coe_to_fun NormedAddGroupHom.completion_coe_to_fun
-- Porting note: `@[simp]` moved to the next lemma
theorem NormedAddGroupHom.completion_coe (f : NormedAddGroupHom G H) (g : G) :
f.completion g = f g :=
Completion.map_coe f.uniformContinuous _
#align normed_add_group_hom.completion_coe NormedAddGroupHom.completion_coe
@[simp]
theorem NormedAddGroupHom.completion_coe' (f : NormedAddGroupHom G H) (g : G) :
Completion.map f g = f g :=
f.completion_coe g
@[simps]
def normedAddGroupHomCompletionHom :
NormedAddGroupHom G H β+ NormedAddGroupHom (Completion G) (Completion H) where
toFun := NormedAddGroupHom.completion
map_zero' := toAddMonoidHom_injective AddMonoidHom.completion_zero
map_add' f g := toAddMonoidHom_injective <|
f.toAddMonoidHom.completion_add g.toAddMonoidHom f.continuous g.continuous
#align normed_add_group_hom_completion_hom normedAddGroupHomCompletionHom
#align normed_add_group_hom_completion_hom_apply normedAddGroupHomCompletionHom_apply
@[simp]
theorem NormedAddGroupHom.completion_id :
(NormedAddGroupHom.id G).completion = NormedAddGroupHom.id (Completion G) := by
ext x
rw [NormedAddGroupHom.completion_def, NormedAddGroupHom.coe_id, Completion.map_id]
rfl
#align normed_add_group_hom.completion_id NormedAddGroupHom.completion_id
| Mathlib/Analysis/Normed/Group/HomCompletion.lean | 107 | 113 | theorem NormedAddGroupHom.completion_comp (f : NormedAddGroupHom G H) (g : NormedAddGroupHom H K) :
g.completion.comp f.completion = (g.comp f).completion := by |
ext x
rw [NormedAddGroupHom.coe_comp, NormedAddGroupHom.completion_def,
NormedAddGroupHom.completion_coe_to_fun, NormedAddGroupHom.completion_coe_to_fun,
Completion.map_comp g.uniformContinuous f.uniformContinuous]
rfl
| [
" (id G).completion = id (Completion G)",
" (id G).completion x = (id (Completion G)) x",
" _root_.id x = (id (Completion G)) x",
" g.completion.comp f.completion = (g.comp f).completion",
" (g.completion.comp f.completion) x = (g.comp f).completion x",
" Completion.map (βg β βf) x = Completion.map (β(g.c... | [
" (id G).completion = id (Completion G)",
" (id G).completion x = (id (Completion G)) x",
" _root_.id x = (id (Completion G)) x",
" g.completion.comp f.completion = (g.comp f).completion"
] |
import Mathlib.Combinatorics.SimpleGraph.Coloring
#align_import combinatorics.simple_graph.partition from "leanprover-community/mathlib"@"2303b3e299f1c75b07bceaaac130ce23044d1386"
universe u v
namespace SimpleGraph
variable {V : Type u} (G : SimpleGraph V)
structure Partition where
parts : Set (Set V)
isPartition : Setoid.IsPartition parts
independent : β s β parts, IsAntichain G.Adj s
#align simple_graph.partition SimpleGraph.Partition
def Partition.PartsCardLe {G : SimpleGraph V} (P : G.Partition) (n : β) : Prop :=
β h : P.parts.Finite, h.toFinset.card β€ n
#align simple_graph.partition.parts_card_le SimpleGraph.Partition.PartsCardLe
def Partitionable (n : β) : Prop := β P : G.Partition, P.PartsCardLe n
#align simple_graph.partitionable SimpleGraph.Partitionable
namespace Partition
variable {G} (P : G.Partition)
def partOfVertex (v : V) : Set V := Classical.choose (P.isPartition.2 v)
#align simple_graph.partition.part_of_vertex SimpleGraph.Partition.partOfVertex
theorem partOfVertex_mem (v : V) : P.partOfVertex v β P.parts := by
obtain β¨h, -β© := (P.isPartition.2 v).choose_spec.1
exact h
#align simple_graph.partition.part_of_vertex_mem SimpleGraph.Partition.partOfVertex_mem
| Mathlib/Combinatorics/SimpleGraph/Partition.lean | 93 | 95 | theorem mem_partOfVertex (v : V) : v β P.partOfVertex v := by |
obtain β¨β¨_, hβ©, _β© := (P.isPartition.2 v).choose_spec
exact h
| [
" P.partOfVertex v β P.parts",
" v β P.partOfVertex v"
] | [
" P.partOfVertex v β P.parts",
" v β P.partOfVertex v"
] |
import Mathlib.Algebra.GroupPower.IterateHom
import Mathlib.Algebra.Module.Defs
import Mathlib.Algebra.Order.Archimedean
import Mathlib.Algebra.Order.Group.Instances
import Mathlib.GroupTheory.GroupAction.Pi
open Function Set
structure AddConstMap (G H : Type*) [Add G] [Add H] (a : G) (b : H) where
protected toFun : G β H
map_add_const' (x : G) : toFun (x + a) = toFun x + b
@[inherit_doc]
scoped [AddConstMap] notation:25 G " β+c[" a ", " b "] " H => AddConstMap G H a b
class AddConstMapClass (F : Type*) (G H : outParam Type*) [Add G] [Add H]
(a : outParam G) (b : outParam H) extends DFunLike F G fun _ β¦ H where
map_add_const (f : F) (x : G) : f (x + a) = f x + b
namespace AddConstMapClass
attribute [simp] map_add_const
variable {F G H : Type*} {a : G} {b : H}
protected theorem semiconj [Add G] [Add H] [AddConstMapClass F G H a b] (f : F) :
Semiconj f (Β· + a) (Β· + b) :=
map_add_const f
@[simp]
theorem map_add_nsmul [AddMonoid G] [AddMonoid H] [AddConstMapClass F G H a b]
(f : F) (x : G) (n : β) : f (x + n β’ a) = f x + n β’ b := by
simpa using (AddConstMapClass.semiconj f).iterate_right n x
@[simp]
theorem map_add_nat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b]
(f : F) (x : G) (n : β) : f (x + n) = f x + n β’ b := by simp [β map_add_nsmul]
theorem map_add_one [AddMonoidWithOne G] [Add H] [AddConstMapClass F G H 1 b]
(f : F) (x : G) : f (x + 1) = f x + b := map_add_const f x
@[simp]
theorem map_add_ofNat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b]
(f : F) (x : G) (n : β) [n.AtLeastTwo] :
f (x + no_index (OfNat.ofNat n)) = f x + (OfNat.ofNat n : β) β’ b :=
map_add_nat' f x n
theorem map_add_nat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1]
(f : F) (x : G) (n : β) : f (x + n) = f x + n := by simp
theorem map_add_ofNat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1]
(f : F) (x : G) (n : β) [n.AtLeastTwo] :
f (x + OfNat.ofNat n) = f x + OfNat.ofNat n := map_add_nat f x n
@[simp]
theorem map_const [AddZeroClass G] [Add H] [AddConstMapClass F G H a b] (f : F) :
f a = f 0 + b := by
simpa using map_add_const f 0
theorem map_one [AddZeroClass G] [One G] [Add H] [AddConstMapClass F G H 1 b] (f : F) :
f 1 = f 0 + b :=
map_const f
@[simp]
theorem map_nsmul_const [AddMonoid G] [AddMonoid H] [AddConstMapClass F G H a b]
(f : F) (n : β) : f (n β’ a) = f 0 + n β’ b := by
simpa using map_add_nsmul f 0 n
@[simp]
| Mathlib/Algebra/AddConstMap/Basic.lean | 112 | 114 | theorem map_nat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b]
(f : F) (n : β) : f n = f 0 + n β’ b := by |
simpa using map_add_nat' f 0 n
| [
" f (x + n β’ a) = f x + n β’ b",
" f (x + βn) = f x + n β’ b",
" f (x + βn) = f x + βn",
" f a = f 0 + b",
" f (n β’ a) = f 0 + n β’ b",
" f βn = f 0 + n β’ b"
] | [
" f (x + n β’ a) = f x + n β’ b",
" f (x + βn) = f x + n β’ b",
" f (x + βn) = f x + βn",
" f a = f 0 + b",
" f (n β’ a) = f 0 + n β’ b",
" f βn = f 0 + n β’ b"
] |
import Mathlib.NumberTheory.Liouville.Basic
#align_import number_theory.liouville.liouville_number from "leanprover-community/mathlib"@"04e80bb7e8510958cd9aacd32fe2dc147af0b9f1"
noncomputable section
open scoped Nat
open Real Finset
def liouvilleNumber (m : β) : β :=
β' i : β, 1 / m ^ i !
#align liouville_number liouvilleNumber
namespace LiouvilleNumber
def partialSum (m : β) (k : β) : β :=
β i β range (k + 1), 1 / m ^ i !
#align liouville_number.partial_sum LiouvilleNumber.partialSum
def remainder (m : β) (k : β) : β :=
β' i, 1 / m ^ (i + (k + 1))!
#align liouville_number.remainder LiouvilleNumber.remainder
protected theorem summable {m : β} (hm : 1 < m) : Summable fun i : β => 1 / m ^ i ! :=
summable_one_div_pow_of_le hm Nat.self_le_factorial
#align liouville_number.summable LiouvilleNumber.summable
| Mathlib/NumberTheory/Liouville/LiouvilleNumber.lean | 84 | 86 | theorem remainder_summable {m : β} (hm : 1 < m) (k : β) :
Summable fun i : β => 1 / m ^ (i + (k + 1))! := by |
convert (summable_nat_add_iff (k + 1)).2 (LiouvilleNumber.summable hm)
| [
" Summable fun i => 1 / m ^ (i + (k + 1))!"
] | [
" Summable fun i => 1 / m ^ (i + (k + 1))!"
] |
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.RingTheory.Nilpotent.Lemmas
import Mathlib.Topology.Sheaves.SheafCondition.Sites
import Mathlib.Algebra.Category.Ring.Constructions
import Mathlib.RingTheory.LocalProperties
#align_import algebraic_geometry.properties from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
universe u
open TopologicalSpace Opposite CategoryTheory CategoryTheory.Limits TopCat
namespace AlgebraicGeometry
variable (X : Scheme)
instance : T0Space X.carrier := by
refine T0Space.of_open_cover fun x => ?_
obtain β¨U, R, β¨eβ©β© := X.local_affine x
let e' : U.1 ββ PrimeSpectrum R :=
homeoOfIso ((LocallyRingedSpace.forgetToSheafedSpace β SheafedSpace.forget _).mapIso e)
exact β¨U.1.1, U.2, U.1.2, e'.embedding.t0Spaceβ©
instance : QuasiSober X.carrier := by
apply (config := { allowSynthFailures := true })
quasiSober_of_open_cover (Set.range fun x => Set.range <| (X.affineCover.map x).1.base)
Β· rintro β¨_, i, rflβ©; exact (X.affineCover.IsOpen i).base_open.isOpen_range
Β· rintro β¨_, i, rflβ©
exact @OpenEmbedding.quasiSober _ _ _ _ _ (Homeomorph.ofEmbedding _
(X.affineCover.IsOpen i).base_open.toEmbedding).symm.openEmbedding PrimeSpectrum.quasiSober
Β· rw [Set.top_eq_univ, Set.sUnion_range, Set.eq_univ_iff_forall]
intro x; exact β¨_, β¨_, rflβ©, X.affineCover.Covers xβ©
class IsReduced : Prop where
component_reduced : β U, IsReduced (X.presheaf.obj (op U)) := by infer_instance
#align algebraic_geometry.is_reduced AlgebraicGeometry.IsReduced
attribute [instance] IsReduced.component_reduced
theorem isReducedOfStalkIsReduced [β x : X.carrier, _root_.IsReduced (X.presheaf.stalk x)] :
IsReduced X := by
refine β¨fun U => β¨fun s hs => ?_β©β©
apply Presheaf.section_ext X.sheaf U s 0
intro x
rw [RingHom.map_zero]
change X.presheaf.germ x s = 0
exact (hs.map _).eq_zero
#align algebraic_geometry.is_reduced_of_stalk_is_reduced AlgebraicGeometry.isReducedOfStalkIsReduced
instance stalk_isReduced_of_reduced [IsReduced X] (x : X.carrier) :
_root_.IsReduced (X.presheaf.stalk x) := by
constructor
rintro g β¨n, eβ©
obtain β¨U, hxU, s, rflβ© := X.presheaf.germ_exist x g
rw [β map_pow, β map_zero (X.presheaf.germ β¨x, hxUβ©)] at e
obtain β¨V, hxV, iU, iV, e'β© := X.presheaf.germ_eq x hxU hxU _ 0 e
rw [map_pow, map_zero] at e'
replace e' := (IsNilpotent.mk _ _ e').eq_zero (R := X.presheaf.obj <| op V)
erw [β ConcreteCategory.congr_hom (X.presheaf.germ_res iU β¨x, hxVβ©) s]
rw [comp_apply, e', map_zero]
#align algebraic_geometry.stalk_is_reduced_of_reduced AlgebraicGeometry.stalk_isReduced_of_reduced
| Mathlib/AlgebraicGeometry/Properties.lean | 84 | 93 | theorem isReducedOfOpenImmersion {X Y : Scheme} (f : X βΆ Y) [H : IsOpenImmersion f]
[IsReduced Y] : IsReduced X := by |
constructor
intro U
have : U = (Opens.map f.1.base).obj (H.base_open.isOpenMap.functor.obj U) := by
ext1; exact (Set.preimage_image_eq _ H.base_open.inj).symm
rw [this]
exact isReduced_of_injective (inv <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U))
(asIso <| f.1.c.app (op <| H.base_open.isOpenMap.functor.obj U) :
Y.presheaf.obj _ β
_).symm.commRingCatIsoToRingEquiv.injective
| [
" T0Space ββX.toPresheafedSpace",
" β s, x β s β§ IsOpen s β§ T0Space βs",
" QuasiSober ββX.toPresheafedSpace",
" β (s : β(Set.range fun x => Set.range β(X.affineCover.map x).val.base)), IsOpen βs",
" IsOpen ββ¨(fun x => Set.range β(X.affineCover.map x).val.base) i, β―β©",
" β (s : β(Set.range fun x => Set.ran... | [
" T0Space ββX.toPresheafedSpace",
" β s, x β s β§ IsOpen s β§ T0Space βs",
" QuasiSober ββX.toPresheafedSpace",
" β (s : β(Set.range fun x => Set.range β(X.affineCover.map x).val.base)), IsOpen βs",
" IsOpen ββ¨(fun x => Set.range β(X.affineCover.map x).val.base) i, β―β©",
" β (s : β(Set.range fun x => Set.ran... |
import Mathlib.Algebra.Star.Basic
import Mathlib.Algebra.Order.CauSeq.Completion
#align_import data.real.basic from "leanprover-community/mathlib"@"cb42593171ba005beaaf4549fcfe0dece9ada4c9"
assert_not_exists Finset
assert_not_exists Module
assert_not_exists Submonoid
assert_not_exists FloorRing
structure Real where ofCauchy ::
cauchy : CauSeq.Completion.Cauchy (abs : β β β)
#align real Real
@[inherit_doc]
notation "β" => Real
-- Porting note: unknown attribute
-- attribute [pp_using_anonymous_constructor] Real
namespace Real
open CauSeq CauSeq.Completion
variable {x y : β}
theorem ext_cauchy_iff : β {x y : Real}, x = y β x.cauchy = y.cauchy
| β¨aβ©, β¨bβ© => by rw [ofCauchy.injEq]
#align real.ext_cauchy_iff Real.ext_cauchy_iff
theorem ext_cauchy {x y : Real} : x.cauchy = y.cauchy β x = y :=
ext_cauchy_iff.2
#align real.ext_cauchy Real.ext_cauchy
def equivCauchy : β β CauSeq.Completion.Cauchy (abs : β β β) :=
β¨Real.cauchy, Real.ofCauchy, fun β¨_β© => rfl, fun _ => rflβ©
set_option linter.uppercaseLean3 false in
#align real.equiv_Cauchy Real.equivCauchy
-- irreducible doesn't work for instances: https://github.com/leanprover-community/lean/issues/511
private irreducible_def zero : β :=
β¨0β©
private irreducible_def one : β :=
β¨1β©
private irreducible_def add : β β β β β
| β¨aβ©, β¨bβ© => β¨a + bβ©
private irreducible_def neg : β β β
| β¨aβ© => β¨-aβ©
private irreducible_def mul : β β β β β
| β¨aβ©, β¨bβ© => β¨a * bβ©
private noncomputable irreducible_def inv' : β β β
| β¨aβ© => β¨aβ»ΒΉβ©
instance : Zero β :=
β¨zeroβ©
instance : One β :=
β¨oneβ©
instance : Add β :=
β¨addβ©
instance : Neg β :=
β¨negβ©
instance : Mul β :=
β¨mulβ©
instance : Sub β :=
β¨fun a b => a + -bβ©
noncomputable instance : Inv β :=
β¨inv'β©
theorem ofCauchy_zero : (β¨0β© : β) = 0 :=
zero_def.symm
#align real.of_cauchy_zero Real.ofCauchy_zero
theorem ofCauchy_one : (β¨1β© : β) = 1 :=
one_def.symm
#align real.of_cauchy_one Real.ofCauchy_one
theorem ofCauchy_add (a b) : (β¨a + bβ© : β) = β¨aβ© + β¨bβ© :=
(add_def _ _).symm
#align real.of_cauchy_add Real.ofCauchy_add
theorem ofCauchy_neg (a) : (β¨-aβ© : β) = -β¨aβ© :=
(neg_def _).symm
#align real.of_cauchy_neg Real.ofCauchy_neg
| Mathlib/Data/Real/Basic.lean | 130 | 132 | theorem ofCauchy_sub (a b) : (β¨a - bβ© : β) = β¨aβ© - β¨bβ© := by |
rw [sub_eq_add_neg, ofCauchy_add, ofCauchy_neg]
rfl
| [
" { cauchy := a } = { cauchy := b } β { cauchy := a }.cauchy = { cauchy := b }.cauchy",
" { cauchy := a - b } = { cauchy := a } - { cauchy := b }",
" { cauchy := a } + -{ cauchy := b } = { cauchy := a } - { cauchy := b }"
] | [
" { cauchy := a } = { cauchy := b } β { cauchy := a }.cauchy = { cauchy := b }.cauchy",
" { cauchy := a - b } = { cauchy := a } - { cauchy := b }"
] |
import Mathlib.Algebra.DirectSum.Internal
import Mathlib.Algebra.GradedMonoid
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Equiv
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous
import Mathlib.Algebra.Polynomial.Roots
#align_import ring_theory.mv_polynomial.homogeneous from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
namespace MvPolynomial
variable {Ο : Type*} {Ο : Type*} {R : Type*} {S : Type*}
def degree (d : Ο ββ β) := β i β d.support, d i
theorem weightedDegree_one (d : Ο ββ β) :
weightedDegree 1 d = degree d := by
simp [weightedDegree, degree, Finsupp.total, Finsupp.sum]
def IsHomogeneous [CommSemiring R] (Ο : MvPolynomial Ο R) (n : β) :=
IsWeightedHomogeneous 1 Ο n
#align mv_polynomial.is_homogeneous MvPolynomial.IsHomogeneous
variable [CommSemiring R]
| Mathlib/RingTheory/MvPolynomial/Homogeneous.lean | 57 | 61 | theorem weightedTotalDegree_one (Ο : MvPolynomial Ο R) :
weightedTotalDegree (1 : Ο β β) Ο = Ο.totalDegree := by |
simp only [totalDegree, weightedTotalDegree, weightedDegree, LinearMap.toAddMonoidHom_coe,
Finsupp.total, Pi.one_apply, Finsupp.coe_lsum, LinearMap.coe_smulRight, LinearMap.id_coe,
id, Algebra.id.smul_eq_mul, mul_one]
| [
" (weightedDegree 1) d = degree d",
" weightedTotalDegree 1 Ο = Ο.totalDegree"
] | [
" (weightedDegree 1) d = degree d",
" weightedTotalDegree 1 Ο = Ο.totalDegree"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.