Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.57k | proof stringlengths 5 7.36k | hint bool 2
classes |
|---|---|---|---|---|---|---|
import Mathlib.Data.List.Chain
#align_import data.list.destutter from "leanprover-community/mathlib"@"7b78d1776212a91ecc94cf601f83bdcc46b04213"
variable {Ξ± : Type*} (l : List Ξ±) (R : Ξ± β Ξ± β Prop) [DecidableRel R] {a b : Ξ±}
namespace List
@[simp]
theorem destutter'_nil : destutter' R a [] = [a] :=
rfl
#align list.destutter'_nil List.destutter'_nil
theorem destutter'_cons :
(b :: l).destutter' R a = if R a b then a :: destutter' R b l else destutter' R a l :=
rfl
#align list.destutter'_cons List.destutter'_cons
variable {R}
@[simp]
theorem destutter'_cons_pos (h : R b a) : (a :: l).destutter' R b = b :: l.destutter' R a := by
rw [destutter', if_pos h]
#align list.destutter'_cons_pos List.destutter'_cons_pos
@[simp]
theorem destutter'_cons_neg (h : Β¬R b a) : (a :: l).destutter' R b = l.destutter' R b := by
rw [destutter', if_neg h]
#align list.destutter'_cons_neg List.destutter'_cons_neg
variable (R)
@[simp]
theorem destutter'_singleton : [b].destutter' R a = if R a b then [a, b] else [a] := by
split_ifs with h <;> simp! [h]
#align list.destutter'_singleton List.destutter'_singleton
theorem destutter'_sublist (a) : l.destutter' R a <+ a :: l := by
induction' l with b l hl generalizing a
Β· simp
rw [destutter']
split_ifs
Β· exact Sublist.consβ a (hl b)
Β· exact (hl a).trans ((l.sublist_cons b).cons_cons a)
#align list.destutter'_sublist List.destutter'_sublist
theorem mem_destutter' (a) : a β l.destutter' R a := by
induction' l with b l hl
Β· simp
rw [destutter']
split_ifs
Β· simp
Β· assumption
#align list.mem_destutter' List.mem_destutter'
theorem destutter'_is_chain : β l : List Ξ±, β {a b}, R a b β (l.destutter' R b).Chain R a
| [], a, b, h => chain_singleton.mpr h
| c :: l, a, b, h => by
rw [destutter']
split_ifs with hbc
Β· rw [chain_cons]
exact β¨h, destutter'_is_chain l hbcβ©
Β· exact destutter'_is_chain l h
#align list.destutter'_is_chain List.destutter'_is_chain
theorem destutter'_is_chain' (a) : (l.destutter' R a).Chain' R := by
induction' l with b l hl generalizing a
Β· simp
rw [destutter']
split_ifs with h
Β· exact destutter'_is_chain R l h
Β· exact hl a
#align list.destutter'_is_chain' List.destutter'_is_chain'
| Mathlib/Data/List/Destutter.lean | 101 | 105 | theorem destutter'_of_chain (h : l.Chain R a) : l.destutter' R a = a :: l := by
induction' l with b l hb generalizing a |
induction' l with b l hb generalizing a
Β· simp
obtain β¨h, hcβ© := chain_cons.mp h
rw [l.destutter'_cons_pos h, hb hc]
| true |
import Mathlib.Data.List.Basic
#align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
-- Make sure we don't import algebra
assert_not_exists Monoid
variable {Ξ± Ξ² : Type*}
namespace List
attribute [simp] join
-- Porting note (#10618): simp can prove this
-- @[simp]
theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil]
#align list.join_singleton List.join_singleton
@[simp]
theorem join_eq_nil : β {L : List (List Ξ±)}, join L = [] β β l β L, l = []
| [] => iff_of_true rfl (forall_mem_nil _)
| l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons]
#align list.join_eq_nil List.join_eq_nil
@[simp]
theorem join_append (Lβ Lβ : List (List Ξ±)) : join (Lβ ++ Lβ) = join Lβ ++ join Lβ := by
induction Lβ
Β· rfl
Β· simp [*]
#align list.join_append List.join_append
| Mathlib/Data/List/Join.lean | 44 | 44 | theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by | simp
| true |
set_option autoImplicit true
namespace Array
@[simp]
theorem extract_eq_nil_of_start_eq_end {a : Array Ξ±} :
a.extract i i = #[] := by
refine extract_empty_of_stop_le_start a ?h
exact Nat.le_refl i
theorem extract_append_left {a b : Array Ξ±} {i j : Nat} (h : j β€ a.size) :
(a ++ b).extract i j = a.extract i j := by
apply ext
Β· simp only [size_extract, size_append]
omega
Β· intro h1 h2 h3
rw [get_extract, get_append_left, get_extract]
theorem extract_append_right {a b : Array Ξ±} {i j : Nat} (h : a.size β€ i) :
(a ++ b).extract i j = b.extract (i - a.size) (j - a.size) := by
apply ext
Β· rw [size_extract, size_extract, size_append]
omega
Β· intro k hi h2
rw [get_extract, get_extract,
get_append_right (show size a β€ i + k by omega)]
congr
omega
theorem extract_eq_of_size_le_end {a : Array Ξ±} (h : a.size β€ l) :
a.extract p l = a.extract p a.size := by
simp only [extract, Nat.min_eq_right h, Nat.sub_eq, mkEmpty_eq, Nat.min_self]
| Mathlib/Data/Array/ExtractLemmas.lean | 44 | 50 | theorem extract_extract {a : Array Ξ±} (h : s1 + e2 β€ e1) :
(a.extract s1 e1).extract s2 e2 = a.extract (s1 + s2) (s1 + e2) := by
apply ext |
apply ext
Β· simp only [size_extract]
omega
Β· intro i h1 h2
simp only [get_extract, Nat.add_assoc]
| true |
import Mathlib.Algebra.Module.Card
import Mathlib.SetTheory.Cardinal.CountableCover
import Mathlib.SetTheory.Cardinal.Continuum
import Mathlib.Analysis.SpecificLimits.Normed
import Mathlib.Topology.MetricSpace.Perfect
universe u v
open Filter Pointwise Set Function Cardinal
open scoped Cardinal Topology
theorem continuum_le_cardinal_of_nontriviallyNormedField
(π : Type*) [NontriviallyNormedField π] [CompleteSpace π] : π β€ #π := by
suffices β f : (β β Bool) β π, range f β univ β§ Continuous f β§ Injective f by
rcases this with β¨f, -, -, f_injβ©
simpa using lift_mk_le_lift_mk_of_injective f_inj
apply Perfect.exists_nat_bool_injection _ univ_nonempty
refine β¨isClosed_univ, preperfect_iff_nhds.2 (fun x _ U hU β¦ ?_)β©
rcases NormedField.exists_norm_lt_one π with β¨c, c_pos, hcβ©
have A : Tendsto (fun n β¦ x + c^n) atTop (π (x + 0)) :=
tendsto_const_nhds.add (tendsto_pow_atTop_nhds_zero_of_norm_lt_one hc)
rw [add_zero] at A
have B : βαΆ n in atTop, x + c^n β U := tendsto_def.1 A U hU
rcases B.exists with β¨n, hnβ©
refine β¨x + c^n, by simpa using hn, ?_β©
simp only [ne_eq, add_right_eq_self]
apply pow_ne_zero
simpa using c_pos
theorem continuum_le_cardinal_of_module
(π : Type u) (E : Type v) [NontriviallyNormedField π] [CompleteSpace π]
[AddCommGroup E] [Module π E] [Nontrivial E] : π β€ #E := by
have A : lift.{v} (π : Cardinal.{u}) β€ lift.{v} (#π) := by
simpa using continuum_le_cardinal_of_nontriviallyNormedField π
simpa using A.trans (Cardinal.mk_le_of_module π E)
lemma cardinal_eq_of_mem_nhds_zero
{E : Type*} (π : Type*) [NontriviallyNormedField π] [AddCommGroup E] [Module π E]
[TopologicalSpace E] [ContinuousSMul π E] {s : Set E} (hs : s β π (0 : E)) : #s = #E := by
obtain β¨c, hcβ© : β x : π , 1 < βxβ := NormedField.exists_lt_norm π 1
have cn_ne : β n, c^n β 0 := by
intro n
apply pow_ne_zero
rintro rfl
simp only [norm_zero] at hc
exact lt_irrefl _ (hc.trans zero_lt_one)
have A : β (x : E), βαΆ n in (atTop : Filter β), x β c^n β’ s := by
intro x
have : Tendsto (fun n β¦ (c^n) β»ΒΉ β’ x) atTop (π ((0 : π) β’ x)) := by
have : Tendsto (fun n β¦ (c^n)β»ΒΉ) atTop (π 0) := by
simp_rw [β inv_pow]
apply tendsto_pow_atTop_nhds_zero_of_norm_lt_one
rw [norm_inv]
exact inv_lt_one hc
exact Tendsto.smul_const this x
rw [zero_smul] at this
filter_upwards [this hs] with n (hn : (c ^ n)β»ΒΉ β’ x β s)
exact (mem_smul_set_iff_inv_smul_memβ (cn_ne n) _ _).2 hn
have B : β n, #(c^n β’ s :) = #s := by
intro n
have : (c^n β’ s :) β s :=
{ toFun := fun x β¦ β¨(c^n)β»ΒΉ β’ x.1, (mem_smul_set_iff_inv_smul_memβ (cn_ne n) _ _).1 x.2β©
invFun := fun x β¦ β¨(c^n) β’ x.1, smul_mem_smul_set x.2β©
left_inv := fun x β¦ by simp [smul_smul, mul_inv_cancel (cn_ne n)]
right_inv := fun x β¦ by simp [smul_smul, inv_mul_cancel (cn_ne n)] }
exact Cardinal.mk_congr this
apply (Cardinal.mk_of_countable_eventually_mem A B).symm
| Mathlib/Topology/Algebra/Module/Cardinality.lean | 97 | 106 | theorem cardinal_eq_of_mem_nhds
{E : Type*} (π : Type*) [NontriviallyNormedField π] [AddCommGroup E] [Module π E]
[TopologicalSpace E] [ContinuousAdd E] [ContinuousSMul π E]
{s : Set E} {x : E} (hs : s β π x) : #s = #E := by
let g := Homeomorph.addLeft x |
let g := Homeomorph.addLeft x
let t := g β»ΒΉ' s
have : t β π 0 := g.continuous.continuousAt.preimage_mem_nhds (by simpa [g] using hs)
have A : #t = #E := cardinal_eq_of_mem_nhds_zero π this
have B : #t = #s := Cardinal.mk_subtype_of_equiv s g.toEquiv
rwa [B] at A
| true |
import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.Data.Nat.Fib.Basic
import Mathlib.Tactic.Monotonicity
#align_import algebra.continued_fractions.computation.approximations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
namespace GeneralizedContinuedFraction
open GeneralizedContinuedFraction (of)
open Int
variable {K : Type*} {v : K} {n : β} [LinearOrderedField K] [FloorRing K]
namespace IntFractPair
theorem nth_stream_fr_nonneg_lt_one {ifp_n : IntFractPair K}
(nth_stream_eq : IntFractPair.stream v n = some ifp_n) : 0 β€ ifp_n.fr β§ ifp_n.fr < 1 := by
cases n with
| zero =>
have : IntFractPair.of v = ifp_n := by injection nth_stream_eq
rw [β this, IntFractPair.of]
exact β¨fract_nonneg _, fract_lt_one _β©
| succ =>
rcases succ_nth_stream_eq_some_iff.1 nth_stream_eq with β¨_, _, _, ifp_of_eq_ifp_nβ©
rw [β ifp_of_eq_ifp_n, IntFractPair.of]
exact β¨fract_nonneg _, fract_lt_one _β©
#align generalized_continued_fraction.int_fract_pair.nth_stream_fr_nonneg_lt_one GeneralizedContinuedFraction.IntFractPair.nth_stream_fr_nonneg_lt_one
theorem nth_stream_fr_nonneg {ifp_n : IntFractPair K}
(nth_stream_eq : IntFractPair.stream v n = some ifp_n) : 0 β€ ifp_n.fr :=
(nth_stream_fr_nonneg_lt_one nth_stream_eq).left
#align generalized_continued_fraction.int_fract_pair.nth_stream_fr_nonneg GeneralizedContinuedFraction.IntFractPair.nth_stream_fr_nonneg
theorem nth_stream_fr_lt_one {ifp_n : IntFractPair K}
(nth_stream_eq : IntFractPair.stream v n = some ifp_n) : ifp_n.fr < 1 :=
(nth_stream_fr_nonneg_lt_one nth_stream_eq).right
#align generalized_continued_fraction.int_fract_pair.nth_stream_fr_lt_one GeneralizedContinuedFraction.IntFractPair.nth_stream_fr_lt_one
| Mathlib/Algebra/ContinuedFractions/Computation/Approximations.lean | 96 | 107 | theorem one_le_succ_nth_stream_b {ifp_succ_n : IntFractPair K}
(succ_nth_stream_eq : IntFractPair.stream v (n + 1) = some ifp_succ_n) : 1 β€ ifp_succ_n.b := by
obtain β¨ifp_n, nth_stream_eq, stream_nth_fr_ne_zero, β¨-β©β© : |
obtain β¨ifp_n, nth_stream_eq, stream_nth_fr_ne_zero, β¨-β©β© :
β ifp_n, IntFractPair.stream v n = some ifp_n β§ ifp_n.fr β 0
β§ IntFractPair.of ifp_n.frβ»ΒΉ = ifp_succ_n :=
succ_nth_stream_eq_some_iff.1 succ_nth_stream_eq
suffices 1 β€ ifp_n.frβ»ΒΉ by rwa [IntFractPair.of, le_floor, cast_one]
suffices ifp_n.fr β€ 1 by
have h : 0 < ifp_n.fr :=
lt_of_le_of_ne (nth_stream_fr_nonneg nth_stream_eq) stream_nth_fr_ne_zero.symm
apply one_le_inv h this
simp only [le_of_lt (nth_stream_fr_lt_one nth_stream_eq)]
| true |
import Mathlib.Algebra.Group.Equiv.TypeTags
import Mathlib.GroupTheory.FreeAbelianGroup
import Mathlib.GroupTheory.FreeGroup.IsFreeGroup
import Mathlib.LinearAlgebra.Dimension.StrongRankCondition
#align_import group_theory.free_abelian_group_finsupp from "leanprover-community/mathlib"@"47b51515e69f59bca5cf34ef456e6000fe205a69"
noncomputable section
variable {X : Type*}
def FreeAbelianGroup.toFinsupp : FreeAbelianGroup X β+ X ββ β€ :=
FreeAbelianGroup.lift fun x => Finsupp.single x (1 : β€)
#align free_abelian_group.to_finsupp FreeAbelianGroup.toFinsupp
def Finsupp.toFreeAbelianGroup : (X ββ β€) β+ FreeAbelianGroup X :=
Finsupp.liftAddHom fun x => (smulAddHom β€ (FreeAbelianGroup X)).flip (FreeAbelianGroup.of x)
#align finsupp.to_free_abelian_group Finsupp.toFreeAbelianGroup
open Finsupp FreeAbelianGroup
@[simp]
| Mathlib/GroupTheory/FreeAbelianGroupFinsupp.lean | 45 | 50 | theorem Finsupp.toFreeAbelianGroup_comp_singleAddHom (x : X) :
Finsupp.toFreeAbelianGroup.comp (Finsupp.singleAddHom x) =
(smulAddHom β€ (FreeAbelianGroup X)).flip (of x) := by
ext |
ext
simp only [AddMonoidHom.coe_comp, Finsupp.singleAddHom_apply, Function.comp_apply, one_smul,
toFreeAbelianGroup, Finsupp.liftAddHom_apply_single]
| true |
import Mathlib.Analysis.SpecialFunctions.Complex.Arg
import Mathlib.Analysis.SpecialFunctions.Log.Basic
#align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
namespace Complex
open Set Filter Bornology
open scoped Real Topology ComplexConjugate
-- Porting note: @[pp_nodot] does not exist in mathlib4
noncomputable def log (x : β) : β :=
x.abs.log + arg x * I
#align complex.log Complex.log
theorem log_re (x : β) : x.log.re = x.abs.log := by simp [log]
#align complex.log_re Complex.log_re
theorem log_im (x : β) : x.log.im = x.arg := by simp [log]
#align complex.log_im Complex.log_im
theorem neg_pi_lt_log_im (x : β) : -Ο < (log x).im := by simp only [log_im, neg_pi_lt_arg]
#align complex.neg_pi_lt_log_im Complex.neg_pi_lt_log_im
theorem log_im_le_pi (x : β) : (log x).im β€ Ο := by simp only [log_im, arg_le_pi]
#align complex.log_im_le_pi Complex.log_im_le_pi
theorem exp_log {x : β} (hx : x β 0) : exp (log x) = x := by
rw [log, exp_add_mul_I, β ofReal_sin, sin_arg, β ofReal_cos, cos_arg hx, β ofReal_exp,
Real.exp_log (abs.pos hx), mul_add, ofReal_div, ofReal_div,
mul_div_cancelβ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), β mul_assoc,
mul_div_cancelβ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), re_add_im]
#align complex.exp_log Complex.exp_log
@[simp]
theorem range_exp : Set.range exp = {0}αΆ :=
Set.ext fun x =>
β¨by
rintro β¨x, rflβ©
exact exp_ne_zero x, fun hx => β¨log x, exp_log hxβ©β©
#align complex.range_exp Complex.range_exp
theorem log_exp {x : β} (hxβ : -Ο < x.im) (hxβ : x.im β€ Ο) : log (exp x) = x := by
rw [log, abs_exp, Real.log_exp, exp_eq_exp_re_mul_sin_add_cos, β ofReal_exp,
arg_mul_cos_add_sin_mul_I (Real.exp_pos _) β¨hxβ, hxββ©, re_add_im]
#align complex.log_exp Complex.log_exp
theorem exp_inj_of_neg_pi_lt_of_le_pi {x y : β} (hxβ : -Ο < x.im) (hxβ : x.im β€ Ο) (hyβ : -Ο < y.im)
(hyβ : y.im β€ Ο) (hxy : exp x = exp y) : x = y := by
rw [β log_exp hxβ hxβ, β log_exp hyβ hyβ, hxy]
#align complex.exp_inj_of_neg_pi_lt_of_le_pi Complex.exp_inj_of_neg_pi_lt_of_le_pi
theorem ofReal_log {x : β} (hx : 0 β€ x) : (x.log : β) = log x :=
Complex.ext (by rw [log_re, ofReal_re, abs_of_nonneg hx])
(by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx])
#align complex.of_real_log Complex.ofReal_log
@[simp, norm_cast]
lemma natCast_log {n : β} : Real.log n = log n := ofReal_natCast n βΈ ofReal_log n.cast_nonneg
@[simp]
lemma ofNat_log {n : β} [n.AtLeastTwo] :
Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n) :=
natCast_log
theorem log_ofReal_re (x : β) : (log (x : β)).re = Real.log x := by simp [log_re]
#align complex.log_of_real_re Complex.log_ofReal_re
theorem log_ofReal_mul {r : β} (hr : 0 < r) {x : β} (hx : x β 0) :
log (r * x) = Real.log r + log x := by
replace hx := Complex.abs.ne_zero_iff.mpr hx
simp_rw [log, map_mul, abs_ofReal, arg_real_mul _ hr, abs_of_pos hr, Real.log_mul hr.ne' hx,
ofReal_add, add_assoc]
#align complex.log_of_real_mul Complex.log_ofReal_mul
| Mathlib/Analysis/SpecialFunctions/Complex/Log.lean | 93 | 94 | theorem log_mul_ofReal (r : β) (hr : 0 < r) (x : β) (hx : x β 0) :
log (x * r) = Real.log r + log x := by | rw [mul_comm, log_ofReal_mul hr hx]
| true |
import Mathlib.Algebra.Polynomial.BigOperators
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic
import Mathlib.Tactic.ComputeDegree
#align_import linear_algebra.matrix.polynomial from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
set_option linter.uppercaseLean3 false
open Matrix Polynomial
variable {n Ξ± : Type*} [DecidableEq n] [Fintype n] [CommRing Ξ±]
open Polynomial Matrix Equiv.Perm
namespace Polynomial
theorem natDegree_det_X_add_C_le (A B : Matrix n n Ξ±) :
natDegree (det ((X : Ξ±[X]) β’ A.map C + B.map C : Matrix n n Ξ±[X])) β€ Fintype.card n := by
rw [det_apply]
refine (natDegree_sum_le _ _).trans ?_
refine Multiset.max_le_of_forall_le _ _ ?_
simp only [forall_apply_eq_imp_iff, true_and_iff, Function.comp_apply, Multiset.map_map,
Multiset.mem_map, exists_imp, Finset.mem_univ_val]
intro g
calc
natDegree (sign g β’ β i : n, (X β’ A.map C + B.map C : Matrix n n Ξ±[X]) (g i) i) β€
natDegree (β i : n, (X β’ A.map C + B.map C : Matrix n n Ξ±[X]) (g i) i) := by
cases' Int.units_eq_one_or (sign g) with sg sg
Β· rw [sg, one_smul]
Β· rw [sg, Units.neg_smul, one_smul, natDegree_neg]
_ β€ β i : n, natDegree (((X : Ξ±[X]) β’ A.map C + B.map C : Matrix n n Ξ±[X]) (g i) i) :=
(natDegree_prod_le (Finset.univ : Finset n) fun i : n =>
(X β’ A.map C + B.map C : Matrix n n Ξ±[X]) (g i) i)
_ β€ Finset.univ.card β’ 1 := (Finset.sum_le_card_nsmul _ _ 1 fun (i : n) _ => ?_)
_ β€ Fintype.card n := by simp [mul_one, Algebra.id.smul_eq_mul, Finset.card_univ]
dsimp only [add_apply, smul_apply, map_apply, smul_eq_mul]
compute_degree
#align polynomial.nat_degree_det_X_add_C_le Polynomial.natDegree_det_X_add_C_le
| Mathlib/LinearAlgebra/Matrix/Polynomial.lean | 62 | 70 | theorem coeff_det_X_add_C_zero (A B : Matrix n n Ξ±) :
coeff (det ((X : Ξ±[X]) β’ A.map C + B.map C)) 0 = det B := by
rw [det_apply, finset_sum_coeff, det_apply] |
rw [det_apply, finset_sum_coeff, det_apply]
refine Finset.sum_congr rfl ?_
rintro g -
convert coeff_smul (R := Ξ±) (sign g) _ 0
rw [coeff_zero_prod]
refine Finset.prod_congr rfl ?_
simp
| true |
import Mathlib.CategoryTheory.Abelian.Basic
import Mathlib.CategoryTheory.Preadditive.Opposite
import Mathlib.CategoryTheory.Limits.Opposites
#align_import category_theory.abelian.opposite from "leanprover-community/mathlib"@"a5ff45a1c92c278b03b52459a620cfd9c49ebc80"
noncomputable section
namespace CategoryTheory
open CategoryTheory.Limits
variable (C : Type*) [Category C] [Abelian C]
-- Porting note: these local instances do not seem to be necessary
--attribute [local instance]
-- hasFiniteLimits_of_hasEqualizers_and_finite_products
-- hasFiniteColimits_of_hasCoequalizers_and_finite_coproducts
-- Abelian.hasFiniteBiproducts
instance : Abelian Cα΅α΅ := by
-- Porting note: priorities of `Abelian.has_kernels` and `Abelian.has_cokernels` have
-- been set to 90 in `Abelian.Basic` in order to prevent a timeout here
exact {
normalMonoOfMono := fun f => normalMonoOfNormalEpiUnop _ (normalEpiOfEpi f.unop)
normalEpiOfEpi := fun f => normalEpiOfNormalMonoUnop _ (normalMonoOfMono f.unop) }
section
variable {C}
variable {X Y : C} (f : X βΆ Y) {A B : Cα΅α΅} (g : A βΆ B)
-- TODO: Generalize (this will work whenever f has a cokernel)
-- (The abelian case is probably sufficient for most applications.)
@[simps]
def kernelOpUnop : (kernel f.op).unop β
cokernel f where
hom := (kernel.lift f.op (cokernel.Ο f).op <| by simp [β op_comp]).unop
inv :=
cokernel.desc f (kernel.ΞΉ f.op).unop <| by
rw [β f.unop_op, β unop_comp, f.unop_op]
simp
hom_inv_id := by
rw [β unop_id, β (cokernel.desc f _ _).unop_op, β unop_comp]
congr 1
ext
simp [β op_comp]
inv_hom_id := by
ext
simp [β unop_comp]
#align category_theory.kernel_op_unop CategoryTheory.kernelOpUnop
-- TODO: Generalize (this will work whenever f has a kernel)
-- (The abelian case is probably sufficient for most applications.)
@[simps]
def cokernelOpUnop : (cokernel f.op).unop β
kernel f where
hom :=
kernel.lift f (cokernel.Ο f.op).unop <| by
rw [β f.unop_op, β unop_comp, f.unop_op]
simp
inv := (cokernel.desc f.op (kernel.ΞΉ f).op <| by simp [β op_comp]).unop
hom_inv_id := by
rw [β unop_id, β (kernel.lift f _ _).unop_op, β unop_comp]
congr 1
ext
simp [β op_comp]
inv_hom_id := by
ext
simp [β unop_comp]
#align category_theory.cokernel_op_unop CategoryTheory.cokernelOpUnop
@[simps!]
def kernelUnopOp : Opposite.op (kernel g.unop) β
cokernel g :=
(cokernelOpUnop g.unop).op
#align category_theory.kernel_unop_op CategoryTheory.kernelUnopOp
@[simps!]
def cokernelUnopOp : Opposite.op (cokernel g.unop) β
kernel g :=
(kernelOpUnop g.unop).op
#align category_theory.cokernel_unop_op CategoryTheory.cokernelUnopOp
theorem cokernel.Ο_op :
(cokernel.Ο f.op).unop =
(cokernelOpUnop f).hom β« kernel.ΞΉ f β« eqToHom (Opposite.unop_op _).symm := by
simp [cokernelOpUnop]
#align category_theory.cokernel.Ο_op CategoryTheory.cokernel.Ο_op
| Mathlib/CategoryTheory/Abelian/Opposite.lean | 101 | 103 | theorem kernel.ΞΉ_op :
(kernel.ΞΉ f.op).unop = eqToHom (Opposite.unop_op _) β« cokernel.Ο f β« (kernelOpUnop f).inv := by |
simp [kernelOpUnop]
| true |
import Mathlib.Analysis.Calculus.FormalMultilinearSeries
import Mathlib.Analysis.SpecificLimits.Normed
import Mathlib.Logic.Equiv.Fin
import Mathlib.Topology.Algebra.InfiniteSum.Module
#align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
noncomputable section
variable {π E F G : Type*}
open scoped Classical
open Topology NNReal Filter ENNReal
open Set Filter Asymptotics
variable [NontriviallyNormedField π] [NormedAddCommGroup E] [NormedSpace π E] [NormedAddCommGroup F]
[NormedSpace π F] [NormedAddCommGroup G] [NormedSpace π G]
namespace FormalMultilinearSeries
variable (p : FormalMultilinearSeries π E F) {r : ββ₯0}
def radius (p : FormalMultilinearSeries π E F) : ββ₯0β :=
β¨ (r : ββ₯0) (C : β) (_ : β n, βp nβ * (r : β) ^ n β€ C), (r : ββ₯0β)
#align formal_multilinear_series.radius FormalMultilinearSeries.radius
theorem le_radius_of_bound (C : β) {r : ββ₯0} (h : β n : β, βp nβ * (r : β) ^ n β€ C) :
(r : ββ₯0β) β€ p.radius :=
le_iSup_of_le r <| le_iSup_of_le C <| le_iSup (fun _ => (r : ββ₯0β)) h
#align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound
theorem le_radius_of_bound_nnreal (C : ββ₯0) {r : ββ₯0} (h : β n : β, βp nββ * r ^ n β€ C) :
(r : ββ₯0β) β€ p.radius :=
p.le_radius_of_bound C fun n => mod_cast h n
#align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal
theorem le_radius_of_isBigO (h : (fun n => βp nβ * (r : β) ^ n) =O[atTop] fun _ => (1 : β)) :
βr β€ p.radius :=
Exists.elim (isBigO_one_nat_atTop_iff.1 h) fun C hC =>
p.le_radius_of_bound C fun n => (le_abs_self _).trans (hC n)
set_option linter.uppercaseLean3 false in
#align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO
theorem le_radius_of_eventually_le (C) (h : βαΆ n in atTop, βp nβ * (r : β) ^ n β€ C) :
βr β€ p.radius :=
p.le_radius_of_isBigO <| IsBigO.of_bound C <| h.mono fun n hn => by simpa
#align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le
theorem le_radius_of_summable_nnnorm (h : Summable fun n => βp nββ * r ^ n) : βr β€ p.radius :=
p.le_radius_of_bound_nnreal (β' n, βp nββ * r ^ n) fun _ => le_tsum' h _
#align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm
theorem le_radius_of_summable (h : Summable fun n => βp nβ * (r : β) ^ n) : βr β€ p.radius :=
p.le_radius_of_summable_nnnorm <| by
simp only [β coe_nnnorm] at h
exact mod_cast h
#align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable
theorem radius_eq_top_of_forall_nnreal_isBigO
(h : β r : ββ₯0, (fun n => βp nβ * (r : β) ^ n) =O[atTop] fun _ => (1 : β)) : p.radius = β :=
ENNReal.eq_top_of_forall_nnreal_le fun r => p.le_radius_of_isBigO (h r)
set_option linter.uppercaseLean3 false in
#align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO
theorem radius_eq_top_of_eventually_eq_zero (h : βαΆ n in atTop, p n = 0) : p.radius = β :=
p.radius_eq_top_of_forall_nnreal_isBigO fun r =>
(isBigO_zero _ _).congr' (h.mono fun n hn => by simp [hn]) EventuallyEq.rfl
#align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero
theorem radius_eq_top_of_forall_image_add_eq_zero (n : β) (hn : β m, p (m + n) = 0) :
p.radius = β :=
p.radius_eq_top_of_eventually_eq_zero <|
mem_atTop_sets.2 β¨n, fun _ hk => tsub_add_cancel_of_le hk βΈ hn _β©
#align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero
@[simp]
theorem constFormalMultilinearSeries_radius {v : F} :
(constFormalMultilinearSeries π E v).radius = β€ :=
(constFormalMultilinearSeries π E v).radius_eq_top_of_forall_image_add_eq_zero 1
(by simp [constFormalMultilinearSeries])
#align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius
| Mathlib/Analysis/Analytic/Basic.lean | 187 | 202 | theorem isLittleO_of_lt_radius (h : βr < p.radius) :
β a β Ioo (0 : β) 1, (fun n => βp nβ * (r : β) ^ n) =o[atTop] (a ^ Β·) := by
have := (TFAE_exists_lt_isLittleO_pow (fun n => βp nβ * (r : β) ^ n) 1).out 1 4 |
have := (TFAE_exists_lt_isLittleO_pow (fun n => βp nβ * (r : β) ^ n) 1).out 1 4
rw [this]
-- Porting note: was
-- rw [(TFAE_exists_lt_isLittleO_pow (fun n => βp nβ * (r : β) ^ n) 1).out 1 4]
simp only [radius, lt_iSup_iff] at h
rcases h with β¨t, C, hC, rtβ©
rw [ENNReal.coe_lt_coe, β NNReal.coe_lt_coe] at rt
have : 0 < (t : β) := r.coe_nonneg.trans_lt rt
rw [β div_lt_one this] at rt
refine β¨_, rt, C, Or.inr zero_lt_one, fun n => ?_β©
calc
|βp nβ * (r : β) ^ n| = βp nβ * (t : β) ^ n * (r / t : β) ^ n := by
field_simp [mul_right_comm, abs_mul]
_ β€ C * (r / t : β) ^ n := by gcongr; apply hC
| true |
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
| Mathlib/RingTheory/MvPowerSeries/Basic.lean | 127 | 131 | theorem monomial_def [DecidableEq Ο] (n : Ο ββ β) :
(monomial R n) = LinearMap.stdBasis R (fun _ β¦ R) n := by
rw [monomial] |
rw [monomial]
-- unify the `Decidable` arguments
convert rfl
| true |
import Mathlib.Algebra.Algebra.Tower
import Mathlib.Algebra.MvPolynomial.Basic
#align_import ring_theory.mv_polynomial.tower from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496"
variable (R A B : Type*) {Ο : Type*}
namespace MvPolynomial
section CommSemiring
variable [CommSemiring R] [CommSemiring A] [CommSemiring B]
variable [Algebra R A] [Algebra A B] [Algebra R B] [IsScalarTower R A B]
variable {R A}
theorem aeval_algebraMap_apply (x : Ο β A) (p : MvPolynomial Ο R) :
aeval (algebraMap A B β x) p = algebraMap A B (MvPolynomial.aeval x p) := by
rw [aeval_def, aeval_def, β coe_evalβHom, β coe_evalβHom, map_evalβHom, β
IsScalarTower.algebraMap_eq]
-- Porting note: added
simp only [Function.comp]
#align mv_polynomial.aeval_algebra_map_apply MvPolynomial.aeval_algebraMap_apply
theorem aeval_algebraMap_eq_zero_iff [NoZeroSMulDivisors A B] [Nontrivial B] (x : Ο β A)
(p : MvPolynomial Ο R) : aeval (algebraMap A B β x) p = 0 β aeval x p = 0 := by
rw [aeval_algebraMap_apply, Algebra.algebraMap_eq_smul_one, smul_eq_zero,
iff_false_intro (one_ne_zero' B), or_false_iff]
#align mv_polynomial.aeval_algebra_map_eq_zero_iff MvPolynomial.aeval_algebraMap_eq_zero_iff
| Mathlib/RingTheory/MvPolynomial/Tower.lean | 62 | 65 | theorem aeval_algebraMap_eq_zero_iff_of_injective {x : Ο β A} {p : MvPolynomial Ο R}
(h : Function.Injective (algebraMap A B)) :
aeval (algebraMap A B β x) p = 0 β aeval x p = 0 := by |
rw [aeval_algebraMap_apply, β (algebraMap A B).map_zero, h.eq_iff]
| true |
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.Algebra.Polynomial.Degree.Lemmas
import Mathlib.Algebra.Polynomial.Monic
#align_import data.polynomial.integral_normalization from "leanprover-community/mathlib"@"6f401acf4faec3ab9ab13a42789c4f68064a61cd"
open Polynomial
namespace Polynomial
universe u v y
variable {R : Type u} {S : Type v} {a b : R} {m n : β} {ΞΉ : Type y}
section IntegralNormalization
section Semiring
variable [Semiring R]
noncomputable def integralNormalization (f : R[X]) : R[X] :=
β i β f.support,
monomial i (if f.degree = i then 1 else coeff f i * f.leadingCoeff ^ (f.natDegree - 1 - i))
#align polynomial.integral_normalization Polynomial.integralNormalization
@[simp]
theorem integralNormalization_zero : integralNormalization (0 : R[X]) = 0 := by
simp [integralNormalization]
#align polynomial.integral_normalization_zero Polynomial.integralNormalization_zero
theorem integralNormalization_coeff {f : R[X]} {i : β} :
(integralNormalization f).coeff i =
if f.degree = i then 1 else coeff f i * f.leadingCoeff ^ (f.natDegree - 1 - i) := by
have : f.coeff i = 0 β f.degree β i := fun hc hd => coeff_ne_zero_of_eq_degree hd hc
simp (config := { contextual := true }) [integralNormalization, coeff_monomial, this,
mem_support_iff]
#align polynomial.integral_normalization_coeff Polynomial.integralNormalization_coeff
| Mathlib/RingTheory/Polynomial/IntegralNormalization.lean | 56 | 59 | theorem integralNormalization_support {f : R[X]} :
(integralNormalization f).support β f.support := by
intro |
intro
simp (config := { contextual := true }) [integralNormalization, coeff_monomial, mem_support_iff]
| true |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.GeomSum
import Mathlib.Data.Fintype.BigOperators
import Mathlib.RingTheory.PowerSeries.Inverse
import Mathlib.RingTheory.PowerSeries.WellKnown
import Mathlib.Tactic.FieldSimp
#align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Nat Finset Finset.Nat PowerSeries
variable (A : Type*) [CommRing A] [Algebra β A]
def bernoulli' : β β β :=
WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' =>
1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2
#align bernoulli' bernoulli'
theorem bernoulli'_def' (n : β) :
bernoulli' n = 1 - β k : Fin n, n.choose k / (n - k + 1) * bernoulli' k :=
WellFounded.fix_eq _ _ _
#align bernoulli'_def' bernoulli'_def'
theorem bernoulli'_def (n : β) :
bernoulli' n = 1 - β k β range n, n.choose k / (n - k + 1) * bernoulli' k := by
rw [bernoulli'_def', β Fin.sum_univ_eq_sum_range]
#align bernoulli'_def bernoulli'_def
theorem bernoulli'_spec (n : β) :
(β k β range n.succ, (n.choose (n - k) : β) / (n - k + 1) * bernoulli' k) = 1 := by
rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add,
div_one, cast_one, one_mul, sub_add, β sum_sub_distrib, β sub_eq_zero, sub_sub_cancel_left,
neg_eq_zero]
exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self])
#align bernoulli'_spec bernoulli'_spec
theorem bernoulli'_spec' (n : β) :
(β k β antidiagonal n, ((k.1 + k.2).choose k.2 : β) / (k.2 + 1) * bernoulli' k.1) = 1 := by
refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n)
refine sum_congr rfl fun x hx => ?_
simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub]
#align bernoulli'_spec' bernoulli'_spec'
@[simp]
theorem sum_bernoulli' (n : β) : (β k β range n, (n.choose k : β) * bernoulli' k) = n := by
cases' n with n
Β· simp
suffices
((n + 1 : β) * β k β range n, β(n.choose k) / (n - k + 1) * bernoulli' k) =
β x β range n, β(n.succ.choose x) * bernoulli' x by
rw_mod_cast [sum_range_succ, bernoulli'_def, β this, choose_succ_self_right]
ring
simp_rw [mul_sum, β mul_assoc]
refine sum_congr rfl fun k hk => ?_
congr
have : ((n - k : β) : β) + 1 β 0 := by norm_cast
field_simp [β cast_sub (mem_range.1 hk).le, mul_comm]
rw_mod_cast [tsub_add_eq_add_tsub (mem_range.1 hk).le, choose_mul_succ_eq]
#align sum_bernoulli' sum_bernoulli'
def bernoulli'PowerSeries :=
mk fun n => algebraMap β A (bernoulli' n / n !)
#align bernoulli'_power_series bernoulli'PowerSeries
theorem bernoulli'PowerSeries_mul_exp_sub_one :
bernoulli'PowerSeries A * (exp A - 1) = X * exp A := by
ext n
-- constant coefficient is a special case
cases' n with n
Β· simp
rw [bernoulli'PowerSeries, coeff_mul, mul_comm X, sum_antidiagonal_succ']
suffices (β p β antidiagonal n,
bernoulli' p.1 / p.1! * ((p.2 + 1) * p.2! : β)β»ΒΉ) = (n ! : β)β»ΒΉ by
simpa [map_sum, Nat.factorial] using congr_arg (algebraMap β A) this
apply eq_inv_of_mul_eq_one_left
rw [sum_mul]
convert bernoulli'_spec' n using 1
apply sum_congr rfl
simp_rw [mem_antidiagonal]
rintro β¨i, jβ© rfl
have := factorial_mul_factorial_dvd_factorial_add i j
field_simp [mul_comm _ (bernoulli' i), mul_assoc, add_choose]
norm_cast
simp [mul_comm (j + 1)]
#align bernoulli'_power_series_mul_exp_sub_one bernoulli'PowerSeries_mul_exp_sub_one
| Mathlib/NumberTheory/Bernoulli.lean | 181 | 196 | theorem bernoulli'_odd_eq_zero {n : β} (h_odd : Odd n) (hlt : 1 < n) : bernoulli' n = 0 := by
let B := mk fun n => bernoulli' n / (n ! : β) |
let B := mk fun n => bernoulli' n / (n ! : β)
suffices (B - evalNegHom B) * (exp β - 1) = X * (exp β - 1) by
cases' mul_eq_mul_right_iff.mp this with h h <;>
simp only [PowerSeries.ext_iff, evalNegHom, coeff_X] at h
Β· apply eq_zero_of_neg_eq
specialize h n
split_ifs at h <;> simp_all [B, h_odd.neg_one_pow, factorial_ne_zero]
Β· simpa (config := {decide := true}) [Nat.factorial] using h 1
have h : B * (exp β - 1) = X * exp β := by
simpa [bernoulli'PowerSeries] using bernoulli'PowerSeries_mul_exp_sub_one β
rw [sub_mul, h, mul_sub X, sub_right_inj, β neg_sub, mul_neg, neg_eq_iff_eq_neg]
suffices evalNegHom (B * (exp β - 1)) * exp β = evalNegHom (X * exp β) * exp β by
rw [map_mul, map_mul] at this -- Porting note: Why doesn't simp do this?
simpa [mul_assoc, sub_mul, mul_comm (evalNegHom (exp β)), exp_mul_exp_neg_eq_one]
congr
| true |
import Mathlib.Combinatorics.Quiver.Basic
import Mathlib.Combinatorics.Quiver.Path
#align_import combinatorics.quiver.cast from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e"
universe v vβ vβ u uβ uβ
variable {U : Type*} [Quiver.{u + 1} U]
namespace Quiver
def Hom.cast {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u βΆ v) : u' βΆ v' :=
Eq.ndrec (motive := (Β· βΆ v')) (Eq.ndrec e hv) hu
#align quiver.hom.cast Quiver.Hom.cast
theorem Hom.cast_eq_cast {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u βΆ v) :
e.cast hu hv = _root_.cast (by {rw [hu, hv]}) e := by
subst_vars
rfl
#align quiver.hom.cast_eq_cast Quiver.Hom.cast_eq_cast
@[simp]
theorem Hom.cast_rfl_rfl {u v : U} (e : u βΆ v) : e.cast rfl rfl = e :=
rfl
#align quiver.hom.cast_rfl_rfl Quiver.Hom.cast_rfl_rfl
@[simp]
theorem Hom.cast_cast {u v u' v' u'' v'' : U} (e : u βΆ v) (hu : u = u') (hv : v = v')
(hu' : u' = u'') (hv' : v' = v'') :
(e.cast hu hv).cast hu' hv' = e.cast (hu.trans hu') (hv.trans hv') := by
subst_vars
rfl
#align quiver.hom.cast_cast Quiver.Hom.cast_cast
theorem Hom.cast_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u βΆ v) :
HEq (e.cast hu hv) e := by
subst_vars
rfl
#align quiver.hom.cast_heq Quiver.Hom.cast_heq
theorem Hom.cast_eq_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u βΆ v) (e' : u' βΆ v') :
e.cast hu hv = e' β HEq e e' := by
rw [Hom.cast_eq_cast]
exact _root_.cast_eq_iff_heq
#align quiver.hom.cast_eq_iff_heq Quiver.Hom.cast_eq_iff_heq
theorem Hom.eq_cast_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u βΆ v) (e' : u' βΆ v') :
e' = e.cast hu hv β HEq e' e := by
rw [eq_comm, Hom.cast_eq_iff_heq]
exact β¨HEq.symm, HEq.symmβ©
#align quiver.hom.eq_cast_iff_heq Quiver.Hom.eq_cast_iff_heq
open Path
def Path.cast {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) : Path u' v' :=
Eq.ndrec (motive := (Path Β· v')) (Eq.ndrec p hv) hu
#align quiver.path.cast Quiver.Path.cast
theorem Path.cast_eq_cast {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) :
p.cast hu hv = _root_.cast (by rw [hu, hv]) p := by
subst_vars
rfl
#align quiver.path.cast_eq_cast Quiver.Path.cast_eq_cast
@[simp]
theorem Path.cast_rfl_rfl {u v : U} (p : Path u v) : p.cast rfl rfl = p :=
rfl
#align quiver.path.cast_rfl_rfl Quiver.Path.cast_rfl_rfl
@[simp]
| Mathlib/Combinatorics/Quiver/Cast.lean | 99 | 103 | theorem Path.cast_cast {u v u' v' u'' v'' : U} (p : Path u v) (hu : u = u') (hv : v = v')
(hu' : u' = u'') (hv' : v' = v'') :
(p.cast hu hv).cast hu' hv' = p.cast (hu.trans hu') (hv.trans hv') := by
subst_vars |
subst_vars
rfl
| true |
import Mathlib.Geometry.RingedSpace.PresheafedSpace.Gluing
import Mathlib.AlgebraicGeometry.OpenImmersion
#align_import algebraic_geometry.gluing from "leanprover-community/mathlib"@"533f62f4dd62a5aad24a04326e6e787c8f7e98b1"
set_option linter.uppercaseLean3 false
noncomputable section
universe u
open TopologicalSpace CategoryTheory Opposite
open CategoryTheory.Limits AlgebraicGeometry.PresheafedSpace
open CategoryTheory.GlueData
namespace AlgebraicGeometry
namespace Scheme
-- Porting note(#5171): @[nolint has_nonempty_instance]; linter not ported yet
structure GlueData extends CategoryTheory.GlueData Scheme where
f_open : β i j, IsOpenImmersion (f i j)
#align algebraic_geometry.Scheme.glue_data AlgebraicGeometry.Scheme.GlueData
attribute [instance] GlueData.f_open
namespace OpenCover
variable {X : Scheme.{u}} (π° : OpenCover.{u} X)
def gluedCoverT' (x y z : π°.J) :
pullback (pullback.fst : pullback (π°.map x) (π°.map y) βΆ _)
(pullback.fst : pullback (π°.map x) (π°.map z) βΆ _) βΆ
pullback (pullback.fst : pullback (π°.map y) (π°.map z) βΆ _)
(pullback.fst : pullback (π°.map y) (π°.map x) βΆ _) := by
refine (pullbackRightPullbackFstIso _ _ _).hom β« ?_
refine ?_ β« (pullbackSymmetry _ _).hom
refine ?_ β« (pullbackRightPullbackFstIso _ _ _).inv
refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (π _) (π _) ?_ ?_
Β· simp [pullback.condition]
Β· simp
#align algebraic_geometry.Scheme.open_cover.glued_cover_t' AlgebraicGeometry.Scheme.OpenCover.gluedCoverT'
@[simp, reassoc]
theorem gluedCoverT'_fst_fst (x y z : π°.J) :
π°.gluedCoverT' x y z β« pullback.fst β« pullback.fst = pullback.fst β« pullback.snd := by
delta gluedCoverT'; simp
#align algebraic_geometry.Scheme.open_cover.glued_cover_t'_fst_fst AlgebraicGeometry.Scheme.OpenCover.gluedCoverT'_fst_fst
@[simp, reassoc]
theorem gluedCoverT'_fst_snd (x y z : π°.J) :
gluedCoverT' π° x y z β« pullback.fst β« pullback.snd = pullback.snd β« pullback.snd := by
delta gluedCoverT'; simp
#align algebraic_geometry.Scheme.open_cover.glued_cover_t'_fst_snd AlgebraicGeometry.Scheme.OpenCover.gluedCoverT'_fst_snd
@[simp, reassoc]
theorem gluedCoverT'_snd_fst (x y z : π°.J) :
gluedCoverT' π° x y z β« pullback.snd β« pullback.fst = pullback.fst β« pullback.snd := by
delta gluedCoverT'; simp
#align algebraic_geometry.Scheme.open_cover.glued_cover_t'_snd_fst AlgebraicGeometry.Scheme.OpenCover.gluedCoverT'_snd_fst
@[simp, reassoc]
theorem gluedCoverT'_snd_snd (x y z : π°.J) :
gluedCoverT' π° x y z β« pullback.snd β« pullback.snd = pullback.fst β« pullback.fst := by
delta gluedCoverT'; simp
#align algebraic_geometry.Scheme.open_cover.glued_cover_t'_snd_snd AlgebraicGeometry.Scheme.OpenCover.gluedCoverT'_snd_snd
| Mathlib/AlgebraicGeometry/Gluing.lean | 319 | 322 | theorem glued_cover_cocycle_fst (x y z : π°.J) :
gluedCoverT' π° x y z β« gluedCoverT' π° y z x β« gluedCoverT' π° z x y β« pullback.fst =
pullback.fst := by |
apply pullback.hom_ext <;> simp
| true |
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]
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)
#align minpoly.is_integrally_closed_dvd minpoly.isIntegrallyClosed_dvd
theorem isIntegrallyClosed_dvd_iff {s : S} (hs : IsIntegral R s) (p : R[X]) :
Polynomial.aeval s p = 0 β minpoly R s β£ p :=
β¨fun hp => isIntegrallyClosed_dvd hs hp, fun hp => by
simpa only [RingHom.mem_ker, RingHom.coe_comp, coe_evalRingHom, coe_mapRingHom,
Function.comp_apply, eval_map, β aeval_def] using
aeval_eq_zero_of_dvd_aeval_eq_zero hp (minpoly.aeval R s)β©
#align minpoly.is_integrally_closed_dvd_iff minpoly.isIntegrallyClosed_dvd_iff
theorem ker_eval {s : S} (hs : IsIntegral R s) :
RingHom.ker ((Polynomial.aeval s).toRingHom : R[X] β+* S) =
Ideal.span ({minpoly R s} : Set R[X]) := by
ext p
simp_rw [RingHom.mem_ker, AlgHom.toRingHom_eq_coe, AlgHom.coe_toRingHom,
isIntegrallyClosed_dvd_iff hs, β Ideal.mem_span_singleton]
#align minpoly.ker_eval minpoly.ker_eval
| Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean | 114 | 118 | theorem IsIntegrallyClosed.degree_le_of_ne_zero {s : S} (hs : IsIntegral R s) {p : R[X]}
(hp0 : p β 0) (hp : Polynomial.aeval s p = 0) : degree (minpoly R s) β€ degree p := by
rw [degree_eq_natDegree (minpoly.ne_zero hs), degree_eq_natDegree hp0] |
rw [degree_eq_natDegree (minpoly.ne_zero hs), degree_eq_natDegree hp0]
norm_cast
exact natDegree_le_of_dvd ((isIntegrallyClosed_dvd_iff hs _).mp hp) hp0
| true |
import Mathlib.LinearAlgebra.LinearPMap
import Mathlib.Topology.Algebra.Module.Basic
#align_import topology.algebra.module.linear_pmap from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Topology
variable {R E F : Type*}
variable [CommRing R] [AddCommGroup E] [AddCommGroup F]
variable [Module R E] [Module R F]
variable [TopologicalSpace E] [TopologicalSpace F]
namespace LinearPMap
def IsClosed (f : E ββ.[R] F) : Prop :=
_root_.IsClosed (f.graph : Set (E Γ F))
#align linear_pmap.is_closed LinearPMap.IsClosed
variable [ContinuousAdd E] [ContinuousAdd F]
variable [TopologicalSpace R] [ContinuousSMul R E] [ContinuousSMul R F]
def IsClosable (f : E ββ.[R] F) : Prop :=
β f' : LinearPMap R E F, f.graph.topologicalClosure = f'.graph
#align linear_pmap.is_closable LinearPMap.IsClosable
theorem IsClosed.isClosable {f : E ββ.[R] F} (hf : f.IsClosed) : f.IsClosable :=
β¨f, hf.submodule_topologicalClosure_eqβ©
#align linear_pmap.is_closed.is_closable LinearPMap.IsClosed.isClosable
theorem IsClosable.leIsClosable {f g : E ββ.[R] F} (hf : f.IsClosable) (hfg : g β€ f) :
g.IsClosable := by
cases' hf with f' hf
have : g.graph.topologicalClosure β€ f'.graph := by
rw [β hf]
exact Submodule.topologicalClosure_mono (le_graph_of_le hfg)
use g.graph.topologicalClosure.toLinearPMap
rw [Submodule.toLinearPMap_graph_eq]
exact fun _ hx hx' => f'.graph_fst_eq_zero_snd (this hx) hx'
#align linear_pmap.is_closable.le_is_closable LinearPMap.IsClosable.leIsClosable
theorem IsClosable.existsUnique {f : E ββ.[R] F} (hf : f.IsClosable) :
β! f' : E ββ.[R] F, f.graph.topologicalClosure = f'.graph := by
refine exists_unique_of_exists_of_unique hf fun _ _ hyβ hyβ => eq_of_eq_graph ?_
rw [β hyβ, β hyβ]
#align linear_pmap.is_closable.exists_unique LinearPMap.IsClosable.existsUnique
open scoped Classical
noncomputable def closure (f : E ββ.[R] F) : E ββ.[R] F :=
if hf : f.IsClosable then hf.choose else f
#align linear_pmap.closure LinearPMap.closure
theorem closure_def {f : E ββ.[R] F} (hf : f.IsClosable) : f.closure = hf.choose := by
simp [closure, hf]
#align linear_pmap.closure_def LinearPMap.closure_def
theorem closure_def' {f : E ββ.[R] F} (hf : Β¬f.IsClosable) : f.closure = f := by simp [closure, hf]
#align linear_pmap.closure_def' LinearPMap.closure_def'
theorem IsClosable.graph_closure_eq_closure_graph {f : E ββ.[R] F} (hf : f.IsClosable) :
f.graph.topologicalClosure = f.closure.graph := by
rw [closure_def hf]
exact hf.choose_spec
#align linear_pmap.is_closable.graph_closure_eq_closure_graph LinearPMap.IsClosable.graph_closure_eq_closure_graph
| Mathlib/Topology/Algebra/Module/LinearPMap.lean | 119 | 124 | theorem le_closure (f : E ββ.[R] F) : f β€ f.closure := by
by_cases hf : f.IsClosable |
by_cases hf : f.IsClosable
Β· refine le_of_le_graph ?_
rw [β hf.graph_closure_eq_closure_graph]
exact (graph f).le_topologicalClosure
rw [closure_def' hf]
| true |
import Mathlib.Algebra.CharZero.Defs
import Mathlib.Algebra.Group.Hom.Defs
import Mathlib.Algebra.Order.Monoid.Canonical.Defs
import Mathlib.Algebra.Order.Monoid.OrderDual
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Defs
import Mathlib.Order.WithBot
#align_import algebra.order.monoid.with_top from "leanprover-community/mathlib"@"0111834459f5d7400215223ea95ae38a1265a907"
universe u v
variable {Ξ± : Type u} {Ξ² : Type v}
open Function
namespace WithTop
section Add
variable [Add Ξ±] {a b c d : WithTop Ξ±} {x y : Ξ±}
instance add : Add (WithTop Ξ±) :=
β¨Option.mapβ (Β· + Β·)β©
#align with_top.has_add WithTop.add
@[simp, norm_cast] lemma coe_add (a b : Ξ±) : β(a + b) = (a + b : WithTop Ξ±) := rfl
#align with_top.coe_add WithTop.coe_add
#noalign with_top.coe_bit0
#noalign with_top.coe_bit1
@[simp]
theorem top_add (a : WithTop Ξ±) : β€ + a = β€ :=
rfl
#align with_top.top_add WithTop.top_add
@[simp]
theorem add_top (a : WithTop Ξ±) : a + β€ = β€ := by cases a <;> rfl
#align with_top.add_top WithTop.add_top
@[simp]
theorem add_eq_top : a + b = β€ β a = β€ β¨ b = β€ := by
match a, b with
| β€, _ => simp
| _, β€ => simp
| (a : Ξ±), (b : Ξ±) => simp only [β coe_add, coe_ne_top, or_false]
#align with_top.add_eq_top WithTop.add_eq_top
theorem add_ne_top : a + b β β€ β a β β€ β§ b β β€ :=
add_eq_top.not.trans not_or
#align with_top.add_ne_top WithTop.add_ne_top
| Mathlib/Algebra/Order/Monoid/WithTop.lean | 143 | 144 | theorem add_lt_top [LT Ξ±] {a b : WithTop Ξ±} : a + b < β€ β a < β€ β§ b < β€ := by |
simp_rw [WithTop.lt_top_iff_ne_top, add_ne_top]
| true |
import Mathlib.MeasureTheory.PiSystem
import Mathlib.Order.OmegaCompletePartialOrder
import Mathlib.Topology.Constructions
import Mathlib.MeasureTheory.MeasurableSpace.Basic
open Set
namespace MeasureTheory
variable {ΞΉ : Type _} {Ξ± : ΞΉ β Type _}
section squareCylinders
def squareCylinders (C : β i, Set (Set (Ξ± i))) : Set (Set (β i, Ξ± i)) :=
{S | β s : Finset ΞΉ, β t β univ.pi C, S = (s : Set ΞΉ).pi t}
theorem squareCylinders_eq_iUnion_image (C : β i, Set (Set (Ξ± i))) :
squareCylinders C = β s : Finset ΞΉ, (fun t β¦ (s : Set ΞΉ).pi t) '' univ.pi C := by
ext1 f
simp only [squareCylinders, mem_iUnion, mem_image, mem_univ_pi, exists_prop, mem_setOf_eq,
eq_comm (a := f)]
theorem isPiSystem_squareCylinders {C : β i, Set (Set (Ξ± i))} (hC : β i, IsPiSystem (C i))
(hC_univ : β i, univ β C i) :
IsPiSystem (squareCylinders C) := by
rintro Sβ β¨sβ, tβ, hβ, rflβ© Sβ β¨sβ, tβ, hβ, rflβ© hst_nonempty
classical
let tβ' := sβ.piecewise tβ (fun i β¦ univ)
let tβ' := sβ.piecewise tβ (fun i β¦ univ)
have h1 : β i β (sβ : Set ΞΉ), tβ i = tβ' i :=
fun i hi β¦ (Finset.piecewise_eq_of_mem _ _ _ hi).symm
have h1' : β i β (sβ : Set ΞΉ), tβ' i = univ :=
fun i hi β¦ Finset.piecewise_eq_of_not_mem _ _ _ hi
have h2 : β i β (sβ : Set ΞΉ), tβ i = tβ' i :=
fun i hi β¦ (Finset.piecewise_eq_of_mem _ _ _ hi).symm
have h2' : β i β (sβ : Set ΞΉ), tβ' i = univ :=
fun i hi β¦ Finset.piecewise_eq_of_not_mem _ _ _ hi
rw [Set.pi_congr rfl h1, Set.pi_congr rfl h2, β union_pi_inter h1' h2']
refine β¨sβ βͺ sβ, fun i β¦ tβ' i β© tβ' i, ?_, ?_β©
Β· rw [mem_univ_pi]
intro i
have : (tβ' i β© tβ' i).Nonempty := by
obtain β¨f, hfβ© := hst_nonempty
rw [Set.pi_congr rfl h1, Set.pi_congr rfl h2, mem_inter_iff, mem_pi, mem_pi] at hf
refine β¨f i, β¨?_, ?_β©β©
Β· by_cases hiβ : i β sβ
Β· exact hf.1 i hiβ
Β· rw [h1' i hiβ]
exact mem_univ _
Β· by_cases hiβ : i β sβ
Β· exact hf.2 i hiβ
Β· rw [h2' i hiβ]
exact mem_univ _
refine hC i _ ?_ _ ?_ this
Β· by_cases hiβ : i β sβ
Β· rw [β h1 i hiβ]
exact hβ i (mem_univ _)
Β· rw [h1' i hiβ]
exact hC_univ i
Β· by_cases hiβ : i β sβ
Β· rw [β h2 i hiβ]
exact hβ i (mem_univ _)
Β· rw [h2' i hiβ]
exact hC_univ i
Β· rw [Finset.coe_union]
theorem comap_eval_le_generateFrom_squareCylinders_singleton
(Ξ± : ΞΉ β Type*) [m : β i, MeasurableSpace (Ξ± i)] (i : ΞΉ) :
MeasurableSpace.comap (Function.eval i) (m i) β€
MeasurableSpace.generateFrom
((fun t β¦ ({i} : Set ΞΉ).pi t) '' univ.pi fun i β¦ {s : Set (Ξ± i) | MeasurableSet s}) := by
simp only [Function.eval, singleton_pi, ge_iff_le]
rw [MeasurableSpace.comap_eq_generateFrom]
refine MeasurableSpace.generateFrom_mono fun S β¦ ?_
simp only [mem_setOf_eq, mem_image, mem_univ_pi, forall_exists_index, and_imp]
intro t ht h
classical
refine β¨fun j β¦ if hji : j = i then by convert t else univ, fun j β¦ ?_, ?_β©
Β· by_cases hji : j = i
Β· simp only [hji, eq_self_iff_true, eq_mpr_eq_cast, dif_pos]
convert ht
simp only [id_eq, cast_heq]
Β· simp only [hji, not_false_iff, dif_neg, MeasurableSet.univ]
Β· simp only [id_eq, eq_mpr_eq_cast, β h]
ext1 x
simp only [singleton_pi, Function.eval, cast_eq, dite_eq_ite, ite_true, mem_preimage]
| Mathlib/MeasureTheory/Constructions/Cylinders.lean | 129 | 144 | theorem generateFrom_squareCylinders [β i, MeasurableSpace (Ξ± i)] :
MeasurableSpace.generateFrom (squareCylinders fun i β¦ {s : Set (Ξ± i) | MeasurableSet s}) =
MeasurableSpace.pi := by
apply le_antisymm |
apply le_antisymm
Β· rw [MeasurableSpace.generateFrom_le_iff]
rintro S β¨s, t, h, rflβ©
simp only [mem_univ_pi, mem_setOf_eq] at h
exact MeasurableSet.pi (Finset.countable_toSet _) (fun i _ β¦ h i)
Β· refine iSup_le fun i β¦ ?_
refine (comap_eval_le_generateFrom_squareCylinders_singleton Ξ± i).trans ?_
refine MeasurableSpace.generateFrom_mono ?_
rw [β Finset.coe_singleton, squareCylinders_eq_iUnion_image]
exact subset_iUnion
(fun (s : Finset ΞΉ) β¦
(fun t : β i, Set (Ξ± i) β¦ (s : Set ΞΉ).pi t) '' univ.pi (fun i β¦ setOf MeasurableSet))
({i} : Finset ΞΉ)
| true |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Mul
import Mathlib.Analysis.Calculus.FDeriv.Add
#align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
noncomputable section
open scoped Classical Topology Filter ENNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π G]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
section Prod
section HasDeriv
variable {ΞΉ : Type*} [DecidableEq ΞΉ] {πΈ' : Type*} [NormedCommRing πΈ'] [NormedAlgebra π πΈ']
{u : Finset ΞΉ} {f : ΞΉ β π β πΈ'} {f' : ΞΉ β πΈ'}
theorem HasDerivAt.finset_prod (hf : β i β u, HasDerivAt (f i) (f' i) x) :
HasDerivAt (β i β u, f i Β·) (β i β u, (β j β u.erase i, f j x) β’ f' i) x := by
simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
(HasFDerivAt.finset_prod (fun i hi β¦ (hf i hi).hasFDerivAt)).hasDerivAt
theorem HasDerivWithinAt.finset_prod (hf : β i β u, HasDerivWithinAt (f i) (f' i) s x) :
HasDerivWithinAt (β i β u, f i Β·) (β i β u, (β j β u.erase i, f j x) β’ f' i) s x := by
simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
(HasFDerivWithinAt.finset_prod (fun i hi β¦ (hf i hi).hasFDerivWithinAt)).hasDerivWithinAt
| Mathlib/Analysis/Calculus/Deriv/Mul.lean | 346 | 349 | theorem HasStrictDerivAt.finset_prod (hf : β i β u, HasStrictDerivAt (f i) (f' i) x) :
HasStrictDerivAt (β i β u, f i Β·) (β i β u, (β j β u.erase i, f j x) β’ f' i) x := by
simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using |
simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
(HasStrictFDerivAt.finset_prod (fun i hi β¦ (hf i hi).hasStrictFDerivAt)).hasStrictDerivAt
| true |
import Mathlib.Algebra.Order.Sub.Defs
import Mathlib.Algebra.Order.Monoid.WithTop
#align_import algebra.order.sub.with_top from "leanprover-community/mathlib"@"afdb4fa3b32d41106a4a09b371ce549ad7958abd"
variable {Ξ± Ξ² : Type*}
namespace WithTop
section
variable [Sub Ξ±] [Bot Ξ±]
protected def sub : β _ _ : WithTop Ξ±, WithTop Ξ±
| _, β€ => (β₯ : Ξ±)
| β€, (x : Ξ±) => β€
| (x : Ξ±), (y : Ξ±) => (x - y : Ξ±)
#align with_top.sub WithTop.sub
instance : Sub (WithTop Ξ±) :=
β¨WithTop.subβ©
@[simp, norm_cast]
theorem coe_sub {a b : Ξ±} : (β(a - b) : WithTop Ξ±) = βa - βb :=
rfl
#align with_top.coe_sub WithTop.coe_sub
@[simp]
theorem top_sub_coe {a : Ξ±} : (β€ : WithTop Ξ±) - a = β€ :=
rfl
#align with_top.top_sub_coe WithTop.top_sub_coe
@[simp]
| Mathlib/Algebra/Order/Sub/WithTop.lean | 55 | 55 | theorem sub_top {a : WithTop Ξ±} : a - β€ = (β₯ : Ξ±) := by | cases a <;> rfl
| true |
import Mathlib.Computability.Halting
import Mathlib.Computability.TuringMachine
import Mathlib.Data.Num.Lemmas
import Mathlib.Tactic.DeriveFintype
#align_import computability.tm_to_partrec from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8"
open Function (update)
open Relation
namespace Turing
namespace ToPartrec
inductive Code
| zero'
| succ
| tail
| cons : Code β Code β Code
| comp : Code β Code β Code
| case : Code β Code β Code
| fix : Code β Code
deriving DecidableEq, Inhabited
#align turing.to_partrec.code Turing.ToPartrec.Code
#align turing.to_partrec.code.zero' Turing.ToPartrec.Code.zero'
#align turing.to_partrec.code.succ Turing.ToPartrec.Code.succ
#align turing.to_partrec.code.tail Turing.ToPartrec.Code.tail
#align turing.to_partrec.code.cons Turing.ToPartrec.Code.cons
#align turing.to_partrec.code.comp Turing.ToPartrec.Code.comp
#align turing.to_partrec.code.case Turing.ToPartrec.Code.case
#align turing.to_partrec.code.fix Turing.ToPartrec.Code.fix
def Code.eval : Code β List β β. List β
| Code.zero' => fun v => pure (0 :: v)
| Code.succ => fun v => pure [v.headI.succ]
| Code.tail => fun v => pure v.tail
| Code.cons f fs => fun v => do
let n β Code.eval f v
let ns β Code.eval fs v
pure (n.headI :: ns)
| Code.comp f g => fun v => g.eval v >>= f.eval
| Code.case f g => fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail)
| Code.fix f =>
PFun.fix fun v => (f.eval v).map fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail
#align turing.to_partrec.code.eval Turing.ToPartrec.Code.eval
namespace Code
@[simp]
theorem zero'_eval : zero'.eval = fun v => pure (0 :: v) := by simp [eval]
@[simp]
theorem succ_eval : succ.eval = fun v => pure [v.headI.succ] := by simp [eval]
@[simp]
theorem tail_eval : tail.eval = fun v => pure v.tail := by simp [eval]
@[simp]
theorem cons_eval (f fs) : (cons f fs).eval = fun v => do {
let n β Code.eval f v
let ns β Code.eval fs v
pure (n.headI :: ns) } := by simp [eval]
@[simp]
theorem comp_eval (f g) : (comp f g).eval = fun v => g.eval v >>= f.eval := by simp [eval]
@[simp]
theorem case_eval (f g) :
(case f g).eval = fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) := by
simp [eval]
@[simp]
theorem fix_eval (f) : (fix f).eval =
PFun.fix fun v => (f.eval v).map fun v =>
if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail := by
simp [eval]
def nil : Code :=
tail.comp succ
#align turing.to_partrec.code.nil Turing.ToPartrec.Code.nil
@[simp]
theorem nil_eval (v) : nil.eval v = pure [] := by simp [nil]
#align turing.to_partrec.code.nil_eval Turing.ToPartrec.Code.nil_eval
def id : Code :=
tail.comp zero'
#align turing.to_partrec.code.id Turing.ToPartrec.Code.id
@[simp]
theorem id_eval (v) : id.eval v = pure v := by simp [id]
#align turing.to_partrec.code.id_eval Turing.ToPartrec.Code.id_eval
def head : Code :=
cons id nil
#align turing.to_partrec.code.head Turing.ToPartrec.Code.head
@[simp]
theorem head_eval (v) : head.eval v = pure [v.headI] := by simp [head]
#align turing.to_partrec.code.head_eval Turing.ToPartrec.Code.head_eval
def zero : Code :=
cons zero' nil
#align turing.to_partrec.code.zero Turing.ToPartrec.Code.zero
@[simp]
theorem zero_eval (v) : zero.eval v = pure [0] := by simp [zero]
#align turing.to_partrec.code.zero_eval Turing.ToPartrec.Code.zero_eval
def pred : Code :=
case zero head
#align turing.to_partrec.code.pred Turing.ToPartrec.Code.pred
@[simp]
theorem pred_eval (v) : pred.eval v = pure [v.headI.pred] := by
simp [pred]; cases v.headI <;> simp
#align turing.to_partrec.code.pred_eval Turing.ToPartrec.Code.pred_eval
def rfind (f : Code) : Code :=
comp pred <| comp (fix <| cons f <| cons succ tail) zero'
#align turing.to_partrec.code.rfind Turing.ToPartrec.Code.rfind
def prec (f g : Code) : Code :=
let G :=
cons tail <|
cons succ <|
cons (comp pred tail) <|
cons (comp g <| cons id <| comp tail tail) <| comp tail <| comp tail tail
let F := case id <| comp (comp (comp tail tail) (fix G)) zero'
cons (comp F (cons head <| cons (comp f tail) tail)) nil
#align turing.to_partrec.code.prec Turing.ToPartrec.Code.prec
attribute [-simp] Part.bind_eq_bind Part.map_eq_map Part.pure_eq_some
| Mathlib/Computability/TMToPartrec.lean | 264 | 282 | theorem exists_code.comp {m n} {f : Vector β n β. β} {g : Fin n β Vector β m β. β}
(hf : β c : Code, β v : Vector β n, c.eval v.1 = pure <$> f v)
(hg : β i, β c : Code, β v : Vector β m, c.eval v.1 = pure <$> g i v) :
β c : Code, β v : Vector β m, c.eval v.1 = pure <$> ((Vector.mOfFn fun i => g i v) >>= f) := by
rsuffices β¨cg, hgβ© : |
rsuffices β¨cg, hgβ© :
β c : Code, β v : Vector β m, c.eval v.1 = Subtype.val <$> Vector.mOfFn fun i => g i v
Β· obtain β¨cf, hfβ© := hf
exact
β¨cf.comp cg, fun v => by
simp [hg, hf, map_bind, seq_bind_eq, Function.comp]
rflβ©
clear hf f; induction' n with n IH
Β· exact β¨nil, fun v => by simp [Vector.mOfFn, Bind.bind]; rflβ©
Β· obtain β¨cg, hgββ© := hg 0
obtain β¨cl, hlβ© := IH fun i => hg i.succ
exact
β¨cons cg cl, fun v => by
simp [Vector.mOfFn, hgβ, map_bind, seq_bind_eq, bind_assoc, (Β· β Β·), hl]
rflβ©
| true |
import Mathlib.Data.DFinsupp.Basic
import Mathlib.Data.Finset.Pointwise
import Mathlib.LinearAlgebra.Basis.VectorSpace
#align_import algebra.group.unique_prods from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
@[to_additive
"Let `G` be a Type with addition, let `A B : Finset G` be finite subsets and
let `a0 b0 : G` be two elements. `UniqueAdd A B a0 b0` asserts `a0 + b0` can be written in at
most one way as a sum of an element from `A` and an element from `B`."]
def UniqueMul {G} [Mul G] (A B : Finset G) (a0 b0 : G) : Prop :=
β β¦a bβ¦, a β A β b β B β a * b = a0 * b0 β a = a0 β§ b = b0
#align unique_mul UniqueMul
#align unique_add UniqueAdd
namespace UniqueMul
variable {G H : Type*} [Mul G] [Mul H] {A B : Finset G} {a0 b0 : G}
@[to_additive (attr := nontriviality, simp)]
theorem of_subsingleton [Subsingleton G] : UniqueMul A B a0 b0 := by
simp [UniqueMul, eq_iff_true_of_subsingleton]
@[to_additive]
theorem of_card_le_one (hA : A.Nonempty) (hB : B.Nonempty) (hA1 : A.card β€ 1) (hB1 : B.card β€ 1) :
β a β A, β b β B, UniqueMul A B a b := by
rw [Finset.card_le_one_iff] at hA1 hB1
obtain β¨a, haβ© := hA; obtain β¨b, hbβ© := hB
exact β¨a, ha, b, hb, fun _ _ ha' hb' _ β¦ β¨hA1 ha' ha, hB1 hb' hbβ©β©
@[to_additive]
theorem mt (h : UniqueMul A B a0 b0) :
β β¦a bβ¦, a β A β b β B β a β a0 β¨ b β b0 β a * b β a0 * b0 := fun _ _ ha hb k β¦ by
contrapose! k
exact h ha hb k
#align unique_mul.mt UniqueMul.mt
@[to_additive]
theorem subsingleton (h : UniqueMul A B a0 b0) :
Subsingleton { ab : G Γ G // ab.1 β A β§ ab.2 β B β§ ab.1 * ab.2 = a0 * b0 } :=
β¨fun β¨β¨_a, _bβ©, ha, hb, abβ© β¨β¨_a', _b'β©, ha', hb', ab'β© β¦
Subtype.ext <|
Prod.ext ((h ha hb ab).1.trans (h ha' hb' ab').1.symm) <|
(h ha hb ab).2.trans (h ha' hb' ab').2.symmβ©
#align unique_mul.subsingleton UniqueMul.subsingleton
#align unique_add.subsingleton UniqueAdd.subsingleton
@[to_additive]
| Mathlib/Algebra/Group/UniqueProds.lean | 95 | 101 | theorem set_subsingleton (h : UniqueMul A B a0 b0) :
Set.Subsingleton { ab : G Γ G | ab.1 β A β§ ab.2 β B β§ ab.1 * ab.2 = a0 * b0 } := by
rintro β¨x1, y1β© (hx : x1 β A β§ y1 β B β§ x1 * y1 = a0 * b0) β¨x2, y2β© |
rintro β¨x1, y1β© (hx : x1 β A β§ y1 β B β§ x1 * y1 = a0 * b0) β¨x2, y2β©
(hy : x2 β A β§ y2 β B β§ x2 * y2 = a0 * b0)
rcases h hx.1 hx.2.1 hx.2.2 with β¨rfl, rflβ©
rcases h hy.1 hy.2.1 hy.2.2 with β¨rfl, rflβ©
rfl
| true |
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Group.Units
import Mathlib.Algebra.Regular.Basic
import Mathlib.GroupTheory.Congruence.Basic
import Mathlib.Init.Data.Prod
import Mathlib.RingTheory.OreLocalization.Basic
#align_import group_theory.monoid_localization from "leanprover-community/mathlib"@"10ee941346c27bdb5e87bb3535100c0b1f08ac41"
open Function
section CommMonoid
variable {M : Type*} [CommMonoid M] (S : Submonoid M) (N : Type*) [CommMonoid N] {P : Type*}
[CommMonoid P]
namespace Localization
-- Porting note: this does not work so it is done explicitly instead
-- run_cmd to_additive.map_namespace `Localization `AddLocalization
-- run_cmd Elab.Command.liftCoreM <| ToAdditive.insertTranslation `Localization `AddLocalization
@[to_additive AddLocalization.r
"The congruence relation on `M Γ S`, `M` an `AddCommMonoid` and `S` an `AddSubmonoid` of `M`,
whose quotient is the localization of `M` at `S`, defined as the unique congruence relation on
`M Γ S` such that for any other congruence relation `s` on `M Γ S` where for all `y β S`,
`(0, 0) βΌ (y, y)` under `s`, we have that `(xβ, yβ) βΌ (xβ, yβ)` by `r` implies
`(xβ, yβ) βΌ (xβ, yβ)` by `s`."]
def r (S : Submonoid M) : Con (M Γ S) :=
sInf { c | β y : S, c 1 (y, y) }
#align localization.r Localization.r
#align add_localization.r AddLocalization.r
@[to_additive AddLocalization.r'
"An alternate form of the congruence relation on `M Γ S`, `M` a `CommMonoid` and `S` a
submonoid of `M`, whose quotient is the localization of `M` at `S`."]
def r' : Con (M Γ S) := by
-- note we multiply by `c` on the left so that we can later generalize to `β’`
refine
{ r := fun a b : M Γ S β¦ β c : S, βc * (βb.2 * a.1) = c * (a.2 * b.1)
iseqv := β¨fun a β¦ β¨1, rflβ©, fun β¨c, hcβ© β¦ β¨c, hc.symmβ©, ?_β©
mul' := ?_ }
Β· rintro a b c β¨tβ, htββ© β¨tβ, htββ©
use tβ * tβ * b.2
simp only [Submonoid.coe_mul]
calc
(tβ * tβ * b.2 : M) * (c.2 * a.1) = tβ * c.2 * (tβ * (b.2 * a.1)) := by ac_rfl
_ = tβ * a.2 * (tβ * (c.2 * b.1)) := by rw [htβ]; ac_rfl
_ = tβ * tβ * b.2 * (a.2 * c.1) := by rw [htβ]; ac_rfl
Β· rintro a b c d β¨tβ, htββ© β¨tβ, htββ©
use tβ * tβ
calc
(tβ * tβ : M) * (b.2 * d.2 * (a.1 * c.1)) = tβ * (d.2 * c.1) * (tβ * (b.2 * a.1)) := by ac_rfl
_ = (tβ * tβ : M) * (a.2 * c.2 * (b.1 * d.1)) := by rw [htβ, htβ]; ac_rfl
#align localization.r' Localization.r'
#align add_localization.r' AddLocalization.r'
@[to_additive AddLocalization.r_eq_r'
"The additive congruence relation used to localize an `AddCommMonoid` at a submonoid can be
expressed equivalently as an infimum (see `AddLocalization.r`) or explicitly
(see `AddLocalization.r'`)."]
theorem r_eq_r' : r S = r' S :=
le_antisymm (sInf_le fun _ β¦ β¨1, by simpβ©) <|
le_sInf fun b H β¨p, qβ© β¨x, yβ© β¨t, htβ© β¦ by
rw [β one_mul (p, q), β one_mul (x, y)]
refine b.trans (b.mul (H (t * y)) (b.refl _)) ?_
convert b.symm (b.mul (H (t * q)) (b.refl (x, y))) using 1
dsimp only [Prod.mk_mul_mk, Submonoid.coe_mul] at ht β’
simp_rw [mul_assoc, ht, mul_comm y q]
#align localization.r_eq_r' Localization.r_eq_r'
#align add_localization.r_eq_r' AddLocalization.r_eq_r'
variable {S}
@[to_additive AddLocalization.r_iff_exists]
| Mathlib/GroupTheory/MonoidLocalization.lean | 206 | 207 | theorem r_iff_exists {x y : M Γ S} : r S x y β β c : S, βc * (βy.2 * x.1) = c * (x.2 * y.1) := by |
rw [r_eq_r' S]; rfl
| true |
import Mathlib.SetTheory.Ordinal.Arithmetic
namespace OrdinalApprox
universe u
variable {Ξ± : Type u}
variable [CompleteLattice Ξ±] (f : Ξ± βo Ξ±) (x : Ξ±)
open Function fixedPoints Cardinal Order OrderHom
set_option linter.unusedVariables false in
def lfpApprox (a : Ordinal.{u}) : Ξ± :=
sSup ({ f (lfpApprox b) | (b : Ordinal) (h : b < a) } βͺ {x})
termination_by a
decreasing_by exact h
theorem lfpApprox_monotone : Monotone (lfpApprox f x) := by
unfold Monotone; intros a b h; unfold lfpApprox
refine sSup_le_sSup ?h
apply sup_le_sup_right
simp only [exists_prop, Set.le_eq_subset, Set.setOf_subset_setOf, forall_exists_index, and_imp,
forall_apply_eq_imp_iffβ]
intros a' h'
use a'
exact β¨lt_of_lt_of_le h' h, rflβ©
theorem le_lfpApprox {a : Ordinal} : x β€ lfpApprox f x a := by
unfold lfpApprox
apply le_sSup
simp only [exists_prop, Set.union_singleton, Set.mem_insert_iff, Set.mem_setOf_eq, true_or]
| Mathlib/SetTheory/Ordinal/FixedPointApproximants.lean | 92 | 112 | theorem lfpApprox_add_one (h : x β€ f x) (a : Ordinal) :
lfpApprox f x (a+1) = f (lfpApprox f x a) := by
apply le_antisymm |
apply le_antisymm
Β· conv => left; unfold lfpApprox
apply sSup_le
simp only [Ordinal.add_one_eq_succ, lt_succ_iff, exists_prop, Set.union_singleton,
Set.mem_insert_iff, Set.mem_setOf_eq, forall_eq_or_imp, forall_exists_index, and_imp,
forall_apply_eq_imp_iffβ]
apply And.intro
Β· apply le_trans h
apply Monotone.imp f.monotone
exact le_lfpApprox f x
Β· intros a' h
apply f.2; apply lfpApprox_monotone; exact h
Β· conv => right; unfold lfpApprox
apply le_sSup
simp only [Ordinal.add_one_eq_succ, lt_succ_iff, exists_prop]
rw [Set.mem_union]
apply Or.inl
simp only [Set.mem_setOf_eq]
use a
| true |
import Mathlib.Data.TypeMax
import Mathlib.Logic.UnivLE
import Mathlib.CategoryTheory.Limits.Shapes.Images
#align_import category_theory.limits.types from "leanprover-community/mathlib"@"4aa2a2e17940311e47007f087c9df229e7f12942"
open CategoryTheory CategoryTheory.Limits
universe v u w
namespace CategoryTheory.Limits
namespace Types
section limit_characterization
variable {J : Type v} [Category.{w} J] {F : J β₯€ Type u}
def coneOfSection {s} (hs : s β F.sections) : Cone F where
pt := PUnit
Ο :=
{ app := fun j _ β¦ s j,
naturality := fun i j f β¦ by ext; exact (hs f).symm }
def sectionOfCone (c : Cone F) (x : c.pt) : F.sections :=
β¨fun j β¦ c.Ο.app j x, fun f β¦ congr_fun (c.Ο.naturality f).symm xβ©
theorem isLimit_iff (c : Cone F) :
Nonempty (IsLimit c) β β s β F.sections, β! x : c.pt, β j, c.Ο.app j x = s j := by
refine β¨fun β¨tβ© s hs β¦ ?_, fun h β¦ β¨?_β©β©
Β· let cs := coneOfSection hs
exact β¨t.lift cs β¨β©, fun j β¦ congr_fun (t.fac cs j) β¨β©,
fun x hx β¦ congr_fun (t.uniq cs (fun _ β¦ x) fun j β¦ funext fun _ β¦ hx j) β¨β©β©
Β· choose x hx using fun c y β¦ h _ (sectionOfCone c y).2
exact β¨x, fun c j β¦ funext fun y β¦ (hx c y).1 j,
fun c f hf β¦ funext fun y β¦ (hx c y).2 (f y) (fun j β¦ congr_fun (hf j) y)β©
theorem isLimit_iff_bijective_sectionOfCone (c : Cone F) :
Nonempty (IsLimit c) β (Types.sectionOfCone c).Bijective := by
simp_rw [isLimit_iff, Function.bijective_iff_existsUnique, Subtype.forall, F.sections_ext_iff,
sectionOfCone]
noncomputable def isLimitEquivSections {c : Cone F} (t : IsLimit c) :
c.pt β F.sections where
toFun := sectionOfCone c
invFun s := t.lift (coneOfSection s.2) β¨β©
left_inv x := (congr_fun (t.uniq (coneOfSection _) (fun _ β¦ x) fun _ β¦ rfl) β¨β©).symm
right_inv s := Subtype.ext (funext fun j β¦ congr_fun (t.fac (coneOfSection s.2) j) β¨β©)
#align category_theory.limits.types.is_limit_equiv_sections CategoryTheory.Limits.Types.isLimitEquivSections
@[simp]
theorem isLimitEquivSections_apply {c : Cone F} (t : IsLimit c) (j : J)
(x : c.pt) : (isLimitEquivSections t x : β j, F.obj j) j = c.Ο.app j x := rfl
#align category_theory.limits.types.is_limit_equiv_sections_apply CategoryTheory.Limits.Types.isLimitEquivSections_apply
@[simp]
| Mathlib/CategoryTheory/Limits/Types.lean | 83 | 87 | theorem isLimitEquivSections_symm_apply {c : Cone F} (t : IsLimit c)
(x : F.sections) (j : J) :
c.Ο.app j ((isLimitEquivSections t).symm x) = (x : β j, F.obj j) j := by
conv_rhs => rw [β (isLimitEquivSections t).right_inv x] |
conv_rhs => rw [β (isLimitEquivSections t).right_inv x]
rfl
| true |
import Mathlib.Topology.Category.Profinite.Basic
universe u
namespace Profinite
variable {ΞΉ : Type u} {X : ΞΉ β Type} [β i, TopologicalSpace (X i)] (C : Set ((i : ΞΉ) β X i))
(J K : ΞΉ β Prop)
namespace IndexFunctor
open ContinuousMap
def obj : Set ((i : {i : ΞΉ // J i}) β X i) := ContinuousMap.precomp (Subtype.val (p := J)) '' C
def Ο_app : C(C, obj C J) :=
β¨Set.MapsTo.restrict (precomp (Subtype.val (p := J))) _ _ (Set.mapsTo_image _ _),
Continuous.restrict _ (Pi.continuous_precomp' _)β©
variable {J K}
def map (h : β i, J i β K i) : C(obj C K, obj C J) :=
β¨Set.MapsTo.restrict (precomp (Set.inclusion h)) _ _ (fun _ hx β¦ by
obtain β¨y, hyβ© := hx
rw [β hy.2]
exact β¨y, hy.1, rflβ©), Continuous.restrict _ (Pi.continuous_precomp' _)β©
| Mathlib/Topology/Category/Profinite/Product.lean | 58 | 62 | theorem surjective_Ο_app :
Function.Surjective (Ο_app C J) := by
intro x |
intro x
obtain β¨y, hyβ© := x.prop
exact β¨β¨y, hy.1β©, Subtype.ext hy.2β©
| true |
import Mathlib.Analysis.Normed.Group.Pointwise
import Mathlib.Analysis.NormedSpace.Real
#align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
open Metric Set
open Pointwise Topology
variable {π E : Type*}
variable [NormedField π]
section SeminormedAddCommGroup
variable [SeminormedAddCommGroup E] [NormedSpace π E]
theorem smul_ball {c : π} (hc : c β 0) (x : E) (r : β) : c β’ ball x r = ball (c β’ x) (βcβ * r) := by
ext y
rw [mem_smul_set_iff_inv_smul_memβ hc]
conv_lhs => rw [β inv_smul_smulβ hc x]
simp [β div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smulβ]
#align smul_ball smul_ball
theorem smul_unitBall {c : π} (hc : c β 0) : c β’ ball (0 : E) (1 : β) = ball (0 : E) βcβ := by
rw [_root_.smul_ball hc, smul_zero, mul_one]
#align smul_unit_ball smul_unitBall
| Mathlib/Analysis/NormedSpace/Pointwise.lean | 95 | 101 | theorem smul_sphere' {c : π} (hc : c β 0) (x : E) (r : β) :
c β’ sphere x r = sphere (c β’ x) (βcβ * r) := by
ext y |
ext y
rw [mem_smul_set_iff_inv_smul_memβ hc]
conv_lhs => rw [β inv_smul_smulβ hc x]
simp only [mem_sphere, dist_smulβ, norm_inv, β div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne',
mul_comm r]
| true |
import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic
suppress_compilation
open Bornology
open Filter hiding map_smul
open scoped Classical NNReal Topology Uniformity
-- the `β` subscript variables are for special cases about linear (as opposed to semilinear) maps
variable {π πβ πβ E Eβ F Fβ G Gβ π : Type*}
section SemiNormed
open Metric ContinuousLinearMap
variable [SeminormedAddCommGroup E] [SeminormedAddCommGroup Eβ] [SeminormedAddCommGroup F]
[SeminormedAddCommGroup Fβ] [SeminormedAddCommGroup G] [SeminormedAddCommGroup Gβ]
variable [NontriviallyNormedField π] [NontriviallyNormedField πβ] [NontriviallyNormedField πβ]
[NormedSpace π E] [NormedSpace π Eβ] [NormedSpace πβ F] [NormedSpace π Fβ] [NormedSpace πβ G]
[NormedSpace π Gβ] {Οββ : π β+* πβ} {Οββ : πβ β+* πβ} {Οββ : π β+* πβ}
[RingHomCompTriple Οββ Οββ Οββ]
variable [FunLike π E F]
namespace ContinuousLinearMap
section OpNorm
open Set Real
section
variable [RingHomIsometric Οββ] [RingHomIsometric Οββ] (f g : E βSL[Οββ] F) (h : F βSL[Οββ] G)
(x : E)
| Mathlib/Analysis/NormedSpace/OperatorNorm/NNNorm.lean | 49 | 53 | theorem nnnorm_def (f : E βSL[Οββ] F) : βfββ = sInf { c | β x, βf xββ β€ c * βxββ } := by
ext |
ext
rw [NNReal.coe_sInf, coe_nnnorm, norm_def, NNReal.coe_image]
simp_rw [β NNReal.coe_le_coe, NNReal.coe_mul, coe_nnnorm, mem_setOf_eq, NNReal.coe_mk,
exists_prop]
| true |
import Mathlib.Analysis.Calculus.BumpFunction.Basic
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
#align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open Function Filter Set Metric MeasureTheory FiniteDimensional Measure
open scoped Topology
namespace ContDiffBump
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [HasContDiffBump E]
[MeasurableSpace E] {c : E} (f : ContDiffBump c) {x : E} {n : ββ} {ΞΌ : Measure E}
protected def normed (ΞΌ : Measure E) : E β β := fun x => f x / β« x, f x βΞΌ
#align cont_diff_bump.normed ContDiffBump.normed
theorem normed_def {ΞΌ : Measure E} (x : E) : f.normed ΞΌ x = f x / β« x, f x βΞΌ :=
rfl
#align cont_diff_bump.normed_def ContDiffBump.normed_def
theorem nonneg_normed (x : E) : 0 β€ f.normed ΞΌ x :=
div_nonneg f.nonneg <| integral_nonneg f.nonneg'
#align cont_diff_bump.nonneg_normed ContDiffBump.nonneg_normed
theorem contDiff_normed {n : ββ} : ContDiff β n (f.normed ΞΌ) :=
f.contDiff.div_const _
#align cont_diff_bump.cont_diff_normed ContDiffBump.contDiff_normed
theorem continuous_normed : Continuous (f.normed ΞΌ) :=
f.continuous.div_const _
#align cont_diff_bump.continuous_normed ContDiffBump.continuous_normed
| Mathlib/Analysis/Calculus/BumpFunction/Normed.lean | 49 | 50 | theorem normed_sub (x : E) : f.normed ΞΌ (c - x) = f.normed ΞΌ (c + x) := by |
simp_rw [f.normed_def, f.sub]
| true |
import Mathlib.Algebra.Order.Floor
import Mathlib.Algebra.Order.Field.Power
import Mathlib.Data.Nat.Log
#align_import data.int.log from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58"
variable {R : Type*} [LinearOrderedSemifield R] [FloorSemiring R]
namespace Int
def log (b : β) (r : R) : β€ :=
if 1 β€ r then Nat.log b βrββ else -Nat.clog b βrβ»ΒΉββ
#align int.log Int.log
theorem log_of_one_le_right (b : β) {r : R} (hr : 1 β€ r) : log b r = Nat.log b βrββ :=
if_pos hr
#align int.log_of_one_le_right Int.log_of_one_le_right
theorem log_of_right_le_one (b : β) {r : R} (hr : r β€ 1) : log b r = -Nat.clog b βrβ»ΒΉββ := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [log, if_pos hr, inv_one, Nat.ceil_one, Nat.floor_one, Nat.log_one_right, Nat.clog_one_right,
Int.ofNat_zero, neg_zero]
Β· exact if_neg hr.not_le
#align int.log_of_right_le_one Int.log_of_right_le_one
@[simp, norm_cast]
theorem log_natCast (b : β) (n : β) : log b (n : R) = Nat.log b n := by
cases n
Β· simp [log_of_right_le_one]
Β· rw [log_of_one_le_right, Nat.floor_natCast]
simp
#align int.log_nat_cast Int.log_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem log_ofNat (b : β) (n : β) [n.AtLeastTwo] :
log b (no_index (OfNat.ofNat n : R)) = Nat.log b (OfNat.ofNat n) :=
log_natCast b n
| Mathlib/Data/Int/Log.lean | 87 | 90 | theorem log_of_left_le_one {b : β} (hb : b β€ 1) (r : R) : log b r = 0 := by
rcases le_total 1 r with h | h |
rcases le_total 1 r with h | h
Β· rw [log_of_one_le_right _ h, Nat.log_of_left_le_one hb, Int.ofNat_zero]
Β· rw [log_of_right_le_one _ h, Nat.clog_of_left_le_one hb, Int.ofNat_zero, neg_zero]
| true |
import Mathlib.CategoryTheory.ConcreteCategory.Basic
import Mathlib.CategoryTheory.Limits.Preserves.Basic
import Mathlib.CategoryTheory.Limits.TypesFiltered
import Mathlib.CategoryTheory.Limits.Yoneda
import Mathlib.Tactic.ApplyFun
#align_import category_theory.limits.concrete_category from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
universe t w v u r
open CategoryTheory
namespace CategoryTheory.Limits
attribute [local instance] ConcreteCategory.instFunLike ConcreteCategory.hasCoeToSort
section Colimits
section
variable {C : Type u} [Category.{v} C] [ConcreteCategory.{t} C] {J : Type w} [Category.{r} J]
(F : J β₯€ C) [PreservesColimit F (forget C)]
theorem Concrete.from_union_surjective_of_isColimit {D : Cocone F} (hD : IsColimit D) :
let ff : (Ξ£j : J, F.obj j) β D.pt := fun a => D.ΞΉ.app a.1 a.2
Function.Surjective ff := by
intro ff x
let E : Cocone (F β forget C) := (forget C).mapCocone D
let hE : IsColimit E := isColimitOfPreserves (forget C) hD
obtain β¨j, y, hyβ© := Types.jointly_surjective_of_isColimit hE x
exact β¨β¨j, yβ©, hyβ©
#align category_theory.limits.concrete.from_union_surjective_of_is_colimit CategoryTheory.Limits.Concrete.from_union_surjective_of_isColimit
theorem Concrete.isColimit_exists_rep {D : Cocone F} (hD : IsColimit D) (x : D.pt) :
β (j : J) (y : F.obj j), D.ΞΉ.app j y = x := by
obtain β¨a, rflβ© := Concrete.from_union_surjective_of_isColimit F hD x
exact β¨a.1, a.2, rflβ©
#align category_theory.limits.concrete.is_colimit_exists_rep CategoryTheory.Limits.Concrete.isColimit_exists_rep
theorem Concrete.colimit_exists_rep [HasColimit F] (x : β(colimit F)) :
β (j : J) (y : F.obj j), colimit.ΞΉ F j y = x :=
Concrete.isColimit_exists_rep F (colimit.isColimit _) x
#align category_theory.limits.concrete.colimit_exists_rep CategoryTheory.Limits.Concrete.colimit_exists_rep
theorem Concrete.isColimit_rep_eq_of_exists {D : Cocone F} {i j : J} (x : F.obj i) (y : F.obj j)
(h : β (k : _) (f : i βΆ k) (g : j βΆ k), F.map f x = F.map g y) :
D.ΞΉ.app i x = D.ΞΉ.app j y := by
let E := (forget C).mapCocone D
obtain β¨k, f, g, (hfg : (F β forget C).map f x = F.map g y)β© := h
let h1 : (F β forget C).map f β« E.ΞΉ.app k = E.ΞΉ.app i := E.ΞΉ.naturality f
let h2 : (F β forget C).map g β« E.ΞΉ.app k = E.ΞΉ.app j := E.ΞΉ.naturality g
show E.ΞΉ.app i x = E.ΞΉ.app j y
rw [β h1, types_comp_apply, hfg]
exact congrFun h2 y
#align category_theory.limits.concrete.is_colimit_rep_eq_of_exists CategoryTheory.Limits.Concrete.isColimit_rep_eq_of_exists
theorem Concrete.colimit_rep_eq_of_exists [HasColimit F] {i j : J} (x : F.obj i) (y : F.obj j)
(h : β (k : _) (f : i βΆ k) (g : j βΆ k), F.map f x = F.map g y) :
colimit.ΞΉ F i x = colimit.ΞΉ F j y :=
Concrete.isColimit_rep_eq_of_exists F x y h
#align category_theory.limits.concrete.colimit_rep_eq_of_exists CategoryTheory.Limits.Concrete.colimit_rep_eq_of_exists
end
section FilteredColimits
variable {C : Type u} [Category.{v} C] [ConcreteCategory.{max t w} C] {J : Type w} [Category.{r} J]
(F : J β₯€ C) [PreservesColimit F (forget C)] [IsFiltered J]
| Mathlib/CategoryTheory/Limits/ConcreteCategory.lean | 122 | 127 | theorem Concrete.isColimit_exists_of_rep_eq {D : Cocone F} {i j : J} (hD : IsColimit D)
(x : F.obj i) (y : F.obj j) (h : D.ΞΉ.app _ x = D.ΞΉ.app _ y) :
β (k : _) (f : i βΆ k) (g : j βΆ k), F.map f x = F.map g y := by
let E := (forget C).mapCocone D |
let E := (forget C).mapCocone D
let hE : IsColimit E := isColimitOfPreserves _ hD
exact (Types.FilteredColimit.isColimit_eq_iff (F β forget C) hE).mp h
| true |
import Mathlib.Algebra.Ring.Int
import Mathlib.Data.Nat.Bitwise
import Mathlib.Data.Nat.Size
#align_import data.int.bitwise from "leanprover-community/mathlib"@"0743cc5d9d86bcd1bba10f480e948a257d65056f"
#align_import init.data.int.bitwise from "leanprover-community/lean"@"855e5b74e3a52a40552e8f067169d747d48743fd"
namespace Int
def div2 : β€ β β€
| (n : β) => n.div2
| -[n +1] => negSucc n.div2
#align int.div2 Int.div2
def bodd : β€ β Bool
| (n : β) => n.bodd
| -[n +1] => not (n.bodd)
#align int.bodd Int.bodd
-- Porting note: `bit0, bit1` deprecated, do we need to adapt `bit`?
set_option linter.deprecated false in
def bit (b : Bool) : β€ β β€ :=
cond b bit1 bit0
#align int.bit Int.bit
def testBit : β€ β β β Bool
| (m : β), n => Nat.testBit m n
| -[m +1], n => !(Nat.testBit m n)
#align int.test_bit Int.testBit
def natBitwise (f : Bool β Bool β Bool) (m n : β) : β€ :=
cond (f false false) -[ Nat.bitwise (fun x y => not (f x y)) m n +1] (Nat.bitwise f m n)
#align int.nat_bitwise Int.natBitwise
def bitwise (f : Bool β Bool β Bool) : β€ β β€ β β€
| (m : β), (n : β) => natBitwise f m n
| (m : β), -[n +1] => natBitwise (fun x y => f x (not y)) m n
| -[m +1], (n : β) => natBitwise (fun x y => f (not x) y) m n
| -[m +1], -[n +1] => natBitwise (fun x y => f (not x) (not y)) m n
#align int.bitwise Int.bitwise
def lnot : β€ β β€
| (m : β) => -[m +1]
| -[m +1] => m
#align int.lnot Int.lnot
def lor : β€ β β€ β β€
| (m : β), (n : β) => m ||| n
| (m : β), -[n +1] => -[Nat.ldiff n m +1]
| -[m +1], (n : β) => -[Nat.ldiff m n +1]
| -[m +1], -[n +1] => -[m &&& n +1]
#align int.lor Int.lor
def land : β€ β β€ β β€
| (m : β), (n : β) => m &&& n
| (m : β), -[n +1] => Nat.ldiff m n
| -[m +1], (n : β) => Nat.ldiff n m
| -[m +1], -[n +1] => -[m ||| n +1]
#align int.land Int.land
-- Porting note: I don't know why `Nat.ldiff` got the prime, but I'm matching this change here
def ldiff : β€ β β€ β β€
| (m : β), (n : β) => Nat.ldiff m n
| (m : β), -[n +1] => m &&& n
| -[m +1], (n : β) => -[m ||| n +1]
| -[m +1], -[n +1] => Nat.ldiff n m
#align int.ldiff Int.ldiff
-- Porting note: I don't know why `Nat.xor'` got the prime, but I'm matching this change here
protected def xor : β€ β β€ β β€
| (m : β), (n : β) => (m ^^^ n)
| (m : β), -[n +1] => -[(m ^^^ n) +1]
| -[m +1], (n : β) => -[(m ^^^ n) +1]
| -[m +1], -[n +1] => (m ^^^ n)
#align int.lxor Int.xor
instance : ShiftLeft β€ where
shiftLeft
| (m : β), (n : β) => Nat.shiftLeft' false m n
| (m : β), -[n +1] => m >>> (Nat.succ n)
| -[m +1], (n : β) => -[Nat.shiftLeft' true m n +1]
| -[m +1], -[n +1] => -[m >>> (Nat.succ n) +1]
#align int.shiftl ShiftLeft.shiftLeft
instance : ShiftRight β€ where
shiftRight m n := m <<< (-n)
#align int.shiftr ShiftRight.shiftRight
@[simp]
theorem bodd_zero : bodd 0 = false :=
rfl
#align int.bodd_zero Int.bodd_zero
@[simp]
theorem bodd_one : bodd 1 = true :=
rfl
#align int.bodd_one Int.bodd_one
theorem bodd_two : bodd 2 = false :=
rfl
#align int.bodd_two Int.bodd_two
@[simp, norm_cast]
theorem bodd_coe (n : β) : Int.bodd n = Nat.bodd n :=
rfl
#align int.bodd_coe Int.bodd_coe
@[simp]
| Mathlib/Data/Int/Bitwise.lean | 145 | 149 | theorem bodd_subNatNat (m n : β) : bodd (subNatNat m n) = xor m.bodd n.bodd := by
apply subNatNat_elim m n fun m n i => bodd i = xor m.bodd n.bodd <;> |
apply subNatNat_elim m n fun m n i => bodd i = xor m.bodd n.bodd <;>
intros i j <;>
simp only [Int.bodd, Int.bodd_coe, Nat.bodd_add] <;>
cases Nat.bodd i <;> simp
| true |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
#align linear_independent_iff' linearIndependent_iff'
theorem linearIndependent_iff'' :
LinearIndependent R v β
β (s : Finset ΞΉ) (g : ΞΉ β R), (β i β s, g i = 0) β
β i β s, g i β’ v i = 0 β β i, g i = 0 := by
classical
exact linearIndependent_iff'.trans
β¨fun H s g hg hv i => if his : i β s then H s g hv i his else hg i his, fun H s g hg i hi => by
convert
H s (fun j => if j β s then g j else 0) (fun j hj => if_neg hj)
(by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i
exact (if_pos hi).symmβ©
#align linear_independent_iff'' linearIndependent_iff''
theorem not_linearIndependent_iff :
Β¬LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β§ β i β s, g i β 0 := by
rw [linearIndependent_iff']
simp only [exists_prop, not_forall]
#align not_linear_independent_iff not_linearIndependent_iff
theorem Fintype.linearIndependent_iff [Fintype ΞΉ] :
LinearIndependent R v β β g : ΞΉ β R, β i, g i β’ v i = 0 β β i, g i = 0 := by
refine
β¨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H =>
linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _β©
rw [β hs]
refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm
rw [hg i hi, zero_smul]
#align fintype.linear_independent_iff Fintype.linearIndependent_iff
| Mathlib/LinearAlgebra/LinearIndependent.lean | 186 | 189 | theorem Fintype.linearIndependent_iff' [Fintype ΞΉ] [DecidableEq ΞΉ] :
LinearIndependent R v β
LinearMap.ker (LinearMap.lsum R (fun _ β¦ R) β fun i β¦ LinearMap.id.smulRight (v i)) = β₯ := by |
simp [Fintype.linearIndependent_iff, LinearMap.ker_eq_bot', funext_iff]
| true |
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fin
import Mathlib.Tactic.NormNum.Ineq
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} [DecidableEq Ξ±] {Ξ² : Type v}
namespace Equiv.Perm
def modSwap (i j : Ξ±) : Setoid (Perm Ξ±) :=
β¨fun Ο Ο => Ο = Ο β¨ Ο = swap i j * Ο, fun Ο => Or.inl (refl Ο), fun {Ο Ο} h =>
Or.casesOn h (fun h => Or.inl h.symm) fun h => Or.inr (by rw [h, swap_mul_self_mul]),
fun {Ο Ο Ο
} hΟΟ hΟΟ
=> by
cases' hΟΟ with hΟΟ hΟΟ <;> cases' hΟΟ
with hΟΟ
hΟΟ
<;> try rw [hΟΟ, hΟΟ
, swap_mul_self_mul] <;>
simp [hΟΟ, hΟΟ
] -- Porting note: should close goals, but doesn't
Β· simp [hΟΟ, hΟΟ
]
Β· simp [hΟΟ, hΟΟ
]
Β· simp [hΟΟ, hΟΟ
]β©
#align equiv.perm.mod_swap Equiv.Perm.modSwap
noncomputable instance {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] (i j : Ξ±) :
DecidableRel (modSwap i j).r :=
fun _ _ => Or.decidable
def swapFactorsAux :
β (l : List Ξ±) (f : Perm Ξ±),
(β {x}, f x β x β x β l) β { l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g }
| [] => fun f h =>
β¨[],
Equiv.ext fun x => by
rw [List.prod_nil]
exact (Classical.not_not.1 (mt h (List.not_mem_nil _))).symm,
by simpβ©
| x::l => fun f h =>
if hfx : x = f x then
swapFactorsAux l f fun {y} hy =>
List.mem_of_ne_of_mem (fun h : y = x => by simp [h, hfx.symm] at hy) (h hy)
else
let m :=
swapFactorsAux l (swap x (f x) * f) fun {y} hy =>
have : f y β y β§ y β x := ne_and_ne_of_swap_mul_apply_ne_self hy
List.mem_of_ne_of_mem this.2 (h this.1)
β¨swap x (f x)::m.1, by
rw [List.prod_cons, m.2.1, β mul_assoc, mul_def (swap x (f x)), swap_swap, β one_def,
one_mul],
fun {g} hg => ((List.mem_cons).1 hg).elim (fun h => β¨x, f x, hfx, hβ©) (m.2.2 _)β©
#align equiv.perm.swap_factors_aux Equiv.Perm.swapFactorsAux
def swapFactors [Fintype Ξ±] [LinearOrder Ξ±] (f : Perm Ξ±) :
{ l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g } :=
swapFactorsAux ((@univ Ξ± _).sort (Β· β€ Β·)) f fun {_ _} => (mem_sort _).2 (mem_univ _)
#align equiv.perm.swap_factors Equiv.Perm.swapFactors
def truncSwapFactors [Fintype Ξ±] (f : Perm Ξ±) :
Trunc { l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g } :=
Quotient.recOnSubsingleton (@univ Ξ± _).1 (fun l h => Trunc.mk (swapFactorsAux l f (h _)))
(show β x, f x β x β x β (@univ Ξ± _).1 from fun _ _ => mem_univ _)
#align equiv.perm.trunc_swap_factors Equiv.Perm.truncSwapFactors
@[elab_as_elim]
| Mathlib/GroupTheory/Perm/Sign.lean | 99 | 110 | theorem swap_induction_on [Finite Ξ±] {P : Perm Ξ± β Prop} (f : Perm Ξ±) :
P 1 β (β f x y, x β y β P f β P (swap x y * f)) β P f := by
cases nonempty_fintype Ξ± |
cases nonempty_fintype Ξ±
cases' (truncSwapFactors f).out with l hl
induction' l with g l ih generalizing f
Β· simp (config := { contextual := true }) only [hl.left.symm, List.prod_nil, forall_true_iff]
Β· intro h1 hmul_swap
rcases hl.2 g (by simp) with β¨x, y, hxyβ©
rw [β hl.1, List.prod_cons, hxy.2]
exact
hmul_swap _ _ _ hxy.1
(ih _ β¨rfl, fun v hv => hl.2 _ (List.mem_cons_of_mem _ hv)β© h1 hmul_swap)
| true |
def SatisfiesM {m : Type u β Type v} [Functor m] (p : Ξ± β Prop) (x : m Ξ±) : Prop :=
β x' : m {a // p a}, Subtype.val <$> x' = x
@[simp] theorem SatisfiesM_Id_eq : SatisfiesM (m := Id) p x β p x :=
β¨fun β¨y, eqβ© => eq βΈ y.2, fun h => β¨β¨_, hβ©, rflβ©β©
@[simp] theorem SatisfiesM_Option_eq : SatisfiesM (m := Option) p x β β a, x = some a β p a :=
β¨by revert x; intro | some _, β¨some β¨_, hβ©, rflβ©, _, rfl => exact h,
fun h => match x with | some a => β¨some β¨a, h _ rflβ©, rflβ© | none => β¨none, rflβ©β©
@[simp] theorem SatisfiesM_Except_eq : SatisfiesM (m := Except Ξ΅) p x β β a, x = .ok a β p a :=
β¨by revert x; intro | .ok _, β¨.ok β¨_, hβ©, rflβ©, _, rfl => exact h,
fun h => match x with | .ok a => β¨.ok β¨a, h _ rflβ©, rflβ© | .error e => β¨.error e, rflβ©β©
@[simp] theorem SatisfiesM_ReaderT_eq [Monad m] :
SatisfiesM (m := ReaderT Ο m) p x β β s, SatisfiesM p (x s) :=
(exists_congr fun a => by exact β¨fun eq _ => eq βΈ rfl, funextβ©).trans Classical.skolem.symm
| .lake/packages/batteries/Batteries/Classes/SatisfiesM.lean | 165 | 166 | theorem SatisfiesM_StateRefT_eq [Monad m] :
SatisfiesM (m := StateRefT' Ο Ο m) p x β β s, SatisfiesM p (x s) := by | simp
| true |
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
#align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9"
namespace MeasureTheory
open Filter
open scoped ENNReal
variable {Ξ± E : Type*} {m m0 : MeasurableSpace Ξ±} {p : ββ₯0β} {q : β} {ΞΌ : Measure Ξ±}
[NormedAddCommGroup E]
theorem snorm'_trim (hm : m β€ m0) {f : Ξ± β E} (hf : StronglyMeasurable[m] f) :
snorm' f q (ΞΌ.trim hm) = snorm' f q ΞΌ := by
simp_rw [snorm']
congr 1
refine lintegral_trim hm ?_
refine @Measurable.pow_const _ _ _ _ _ _ _ m _ (@Measurable.coe_nnreal_ennreal _ m _ ?_) q
apply @StronglyMeasurable.measurable
exact @StronglyMeasurable.nnnorm Ξ± m _ _ _ hf
#align measure_theory.snorm'_trim MeasureTheory.snorm'_trim
theorem limsup_trim (hm : m β€ m0) {f : Ξ± β ββ₯0β} (hf : Measurable[m] f) :
limsup f (ae (ΞΌ.trim hm)) = limsup f (ae ΞΌ) := by
simp_rw [limsup_eq]
suffices h_set_eq : { a : ββ₯0β | βα΅ n βΞΌ.trim hm, f n β€ a } = { a : ββ₯0β | βα΅ n βΞΌ, f n β€ a } by
rw [h_set_eq]
ext1 a
suffices h_meas_eq : ΞΌ { x | Β¬f x β€ a } = ΞΌ.trim hm { x | Β¬f x β€ a } by
simp_rw [Set.mem_setOf_eq, ae_iff, h_meas_eq]
refine (trim_measurableSet_eq hm ?_).symm
refine @MeasurableSet.compl _ _ m (@measurableSet_le ββ₯0β _ _ _ _ m _ _ _ _ _ hf ?_)
exact @measurable_const _ _ _ m _
#align measure_theory.limsup_trim MeasureTheory.limsup_trim
| Mathlib/MeasureTheory/Function/LpSeminorm/Trim.lean | 48 | 51 | theorem essSup_trim (hm : m β€ m0) {f : Ξ± β ββ₯0β} (hf : Measurable[m] f) :
essSup f (ΞΌ.trim hm) = essSup f ΞΌ := by
simp_rw [essSup] |
simp_rw [essSup]
exact limsup_trim hm hf
| true |
import Mathlib.Data.Int.Bitwise
import Mathlib.Data.Int.Order.Lemmas
import Mathlib.Data.Set.Function
import Mathlib.Order.Interval.Set.Basic
#align_import data.int.lemmas from "leanprover-community/mathlib"@"09597669f02422ed388036273d8848119699c22f"
open Nat
namespace Int
theorem le_natCast_sub (m n : β) : (m - n : β€) β€ β(m - n : β) := by
by_cases h : m β₯ n
Β· exact le_of_eq (Int.ofNat_sub h).symm
Β· simp [le_of_not_ge h, ofNat_le]
#align int.le_coe_nat_sub Int.le_natCast_sub
-- Porting note (#10618): simp can prove this @[simp]
theorem succ_natCast_pos (n : β) : 0 < (n : β€) + 1 :=
lt_add_one_iff.mpr (by simp)
#align int.succ_coe_nat_pos Int.succ_natCast_pos
variable {a b : β€} {n : β}
theorem natAbs_eq_iff_sq_eq {a b : β€} : a.natAbs = b.natAbs β a ^ 2 = b ^ 2 := by
rw [sq, sq]
exact natAbs_eq_iff_mul_self_eq
#align int.nat_abs_eq_iff_sq_eq Int.natAbs_eq_iff_sq_eq
theorem natAbs_lt_iff_sq_lt {a b : β€} : a.natAbs < b.natAbs β a ^ 2 < b ^ 2 := by
rw [sq, sq]
exact natAbs_lt_iff_mul_self_lt
#align int.nat_abs_lt_iff_sq_lt Int.natAbs_lt_iff_sq_lt
theorem natAbs_le_iff_sq_le {a b : β€} : a.natAbs β€ b.natAbs β a ^ 2 β€ b ^ 2 := by
rw [sq, sq]
exact natAbs_le_iff_mul_self_le
#align int.nat_abs_le_iff_sq_le Int.natAbs_le_iff_sq_le
theorem natAbs_inj_of_nonneg_of_nonneg {a b : β€} (ha : 0 β€ a) (hb : 0 β€ b) :
natAbs a = natAbs b β a = b := by rw [β sq_eq_sq ha hb, β natAbs_eq_iff_sq_eq]
#align int.nat_abs_inj_of_nonneg_of_nonneg Int.natAbs_inj_of_nonneg_of_nonneg
theorem natAbs_inj_of_nonpos_of_nonpos {a b : β€} (ha : a β€ 0) (hb : b β€ 0) :
natAbs a = natAbs b β a = b := by
simpa only [Int.natAbs_neg, neg_inj] using
natAbs_inj_of_nonneg_of_nonneg (neg_nonneg_of_nonpos ha) (neg_nonneg_of_nonpos hb)
#align int.nat_abs_inj_of_nonpos_of_nonpos Int.natAbs_inj_of_nonpos_of_nonpos
theorem natAbs_inj_of_nonneg_of_nonpos {a b : β€} (ha : 0 β€ a) (hb : b β€ 0) :
natAbs a = natAbs b β a = -b := by
simpa only [Int.natAbs_neg] using natAbs_inj_of_nonneg_of_nonneg ha (neg_nonneg_of_nonpos hb)
#align int.nat_abs_inj_of_nonneg_of_nonpos Int.natAbs_inj_of_nonneg_of_nonpos
| Mathlib/Data/Int/Lemmas.lean | 75 | 77 | theorem natAbs_inj_of_nonpos_of_nonneg {a b : β€} (ha : a β€ 0) (hb : 0 β€ b) :
natAbs a = natAbs b β -a = b := by |
simpa only [Int.natAbs_neg] using natAbs_inj_of_nonneg_of_nonneg (neg_nonneg_of_nonpos ha) hb
| true |
import Mathlib.Data.Nat.Totient
import Mathlib.Data.Nat.Nth
import Mathlib.NumberTheory.SmoothNumbers
#align_import number_theory.prime_counting from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0"
namespace Nat
open Finset
def primeCounting' : β β β :=
Nat.count Prime
#align nat.prime_counting' Nat.primeCounting'
def primeCounting (n : β) : β :=
primeCounting' (n + 1)
#align nat.prime_counting Nat.primeCounting
@[inherit_doc] scoped notation "Ο" => Nat.primeCounting
@[inherit_doc] scoped notation "Ο'" => Nat.primeCounting'
theorem monotone_primeCounting' : Monotone primeCounting' :=
count_monotone Prime
#align nat.monotone_prime_counting' Nat.monotone_primeCounting'
theorem monotone_primeCounting : Monotone primeCounting :=
monotone_primeCounting'.comp (monotone_id.add_const _)
#align nat.monotone_prime_counting Nat.monotone_primeCounting
@[simp]
theorem primeCounting'_nth_eq (n : β) : Ο' (nth Prime n) = n :=
count_nth_of_infinite infinite_setOf_prime _
#align nat.prime_counting'_nth_eq Nat.primeCounting'_nth_eq
@[simp]
theorem prime_nth_prime (n : β) : Prime (nth Prime n) :=
nth_mem_of_infinite infinite_setOf_prime _
#align nat.prime_nth_prime Nat.prime_nth_prime
lemma primesBelow_card_eq_primeCounting' (n : β) : n.primesBelow.card = primeCounting' n := by
simp only [primesBelow, primeCounting']
exact (count_eq_card_filter_range Prime n).symm
| Mathlib/NumberTheory/PrimeCounting.lean | 83 | 102 | theorem primeCounting'_add_le {a k : β} (h0 : 0 < a) (h1 : a < k) (n : β) :
Ο' (k + n) β€ Ο' k + Nat.totient a * (n / a + 1) :=
calc
Ο' (k + n) β€ ((range k).filter Prime).card + ((Ico k (k + n)).filter Prime).card := by
rw [primeCounting', count_eq_card_filter_range, range_eq_Ico, β |
rw [primeCounting', count_eq_card_filter_range, range_eq_Ico, β
Ico_union_Ico_eq_Ico (zero_le k) le_self_add, filter_union]
apply card_union_le
_ β€ Ο' k + ((Ico k (k + n)).filter Prime).card := by
rw [primeCounting', count_eq_card_filter_range]
_ β€ Ο' k + ((Ico k (k + n)).filter (Coprime a)).card := by
refine add_le_add_left (card_le_card ?_) k.primeCounting'
simp only [subset_iff, and_imp, mem_filter, mem_Ico]
intro p succ_k_le_p p_lt_n p_prime
constructor
Β· exact β¨succ_k_le_p, p_lt_nβ©
Β· rw [coprime_comm]
exact coprime_of_lt_prime h0 (gt_of_ge_of_gt succ_k_le_p h1) p_prime
_ β€ Ο' k + totient a * (n / a + 1) := by
rw [add_le_add_iff_left]
exact Ico_filter_coprime_le k n h0
| true |
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Data.Set.MulAntidiagonal
#align_import data.finset.mul_antidiagonal from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
namespace Finset
open Pointwise
variable {Ξ± : Type*}
variable [OrderedCancelCommMonoid Ξ±] {s t : Set Ξ±} (hs : s.IsPWO) (ht : t.IsPWO) (a : Ξ±)
@[to_additive "`Finset.addAntidiagonal hs ht a` is the set of all pairs of an element in
`s` and an element in `t` that add to `a`, but its construction requires proofs that `s` and `t` are
well-ordered."]
noncomputable def mulAntidiagonal : Finset (Ξ± Γ Ξ±) :=
(Set.MulAntidiagonal.finite_of_isPWO hs ht a).toFinset
#align finset.mul_antidiagonal Finset.mulAntidiagonal
#align finset.add_antidiagonal Finset.addAntidiagonal
variable {hs ht a} {u : Set Ξ±} {hu : u.IsPWO} {x : Ξ± Γ Ξ±}
@[to_additive (attr := simp)]
| Mathlib/Data/Finset/MulAntidiagonal.lean | 72 | 73 | theorem mem_mulAntidiagonal : x β mulAntidiagonal hs ht a β x.1 β s β§ x.2 β t β§ x.1 * x.2 = a := by |
simp only [mulAntidiagonal, Set.Finite.mem_toFinset, Set.mem_mulAntidiagonal]
| true |
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals
import Mathlib.Analysis.Calculus.ParametricIntegral
import Mathlib.MeasureTheory.Measure.Haar.NormedSpace
#align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb"
open MeasureTheory Set Filter Asymptotics TopologicalSpace
open Real
open Complex hiding exp log abs_of_nonneg
open scoped Topology
noncomputable section
section Defs
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E]
def MellinConvergent (f : β β E) (s : β) : Prop :=
IntegrableOn (fun t : β => (t : β) ^ (s - 1) β’ f t) (Ioi 0)
#align mellin_convergent MellinConvergent
theorem MellinConvergent.const_smul {f : β β E} {s : β} (hf : MellinConvergent f s) {π : Type*}
[NontriviallyNormedField π] [NormedSpace π E] [SMulCommClass β π E] (c : π) :
MellinConvergent (fun t => c β’ f t) s := by
simpa only [MellinConvergent, smul_comm] using hf.smul c
#align mellin_convergent.const_smul MellinConvergent.const_smul
theorem MellinConvergent.cpow_smul {f : β β E} {s a : β} :
MellinConvergent (fun t => (t : β) ^ a β’ f t) s β MellinConvergent f (s + a) := by
refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi
simp_rw [β sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul]
#align mellin_convergent.cpow_smul MellinConvergent.cpow_smul
nonrec theorem MellinConvergent.div_const {f : β β β} {s : β} (hf : MellinConvergent f s) (a : β) :
MellinConvergent (fun t => f t / a) s := by
simpa only [MellinConvergent, smul_eq_mul, β mul_div_assoc] using hf.div_const a
#align mellin_convergent.div_const MellinConvergent.div_const
| Mathlib/Analysis/MellinTransform.lean | 64 | 75 | theorem MellinConvergent.comp_mul_left {f : β β E} {s : β} {a : β} (ha : 0 < a) :
MellinConvergent (fun t => f (a * t)) s β MellinConvergent f s := by
have := integrableOn_Ioi_comp_mul_left_iff (fun t : β => (t : β) ^ (s - 1) β’ f t) 0 ha |
have := integrableOn_Ioi_comp_mul_left_iff (fun t : β => (t : β) ^ (s - 1) β’ f t) 0 ha
rw [mul_zero] at this
have h1 : EqOn (fun t : β => (β(a * t) : β) ^ (s - 1) β’ f (a * t))
((a : β) ^ (s - 1) β’ fun t : β => (t : β) ^ (s - 1) β’ f (a * t)) (Ioi 0) := fun t ht β¦ by
simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply]
have h2 : (a : β) ^ (s - 1) β 0 := by
rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero]
exact Or.inl ha.ne'
rw [MellinConvergent, MellinConvergent, β this, integrableOn_congr_fun h1 measurableSet_Ioi,
IntegrableOn, IntegrableOn, integrable_smul_iff h2]
| true |
import Mathlib.RingTheory.HahnSeries.Multiplication
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.Data.Finsupp.PWO
#align_import ring_theory.hahn_series from "leanprover-community/mathlib"@"a484a7d0eade4e1268f4fb402859b6686037f965"
set_option linter.uppercaseLean3 false
open Finset Function
open scoped Classical
open Pointwise Polynomial
noncomputable section
variable {Ξ : Type*} {R : Type*}
namespace HahnSeries
section Semiring
variable [Semiring R]
@[simps]
def toPowerSeries : HahnSeries β R β+* PowerSeries R where
toFun f := PowerSeries.mk f.coeff
invFun f := β¨fun n => PowerSeries.coeff R n f, (Nat.lt_wfRel.wf.isWF _).isPWOβ©
left_inv f := by
ext
simp
right_inv f := by
ext
simp
map_add' f g := by
ext
simp
map_mul' f g := by
ext n
simp only [PowerSeries.coeff_mul, PowerSeries.coeff_mk, mul_coeff, isPWO_support]
classical
refine (sum_filter_ne_zero _).symm.trans <| (sum_congr ?_ fun _ _ β¦ rfl).trans <|
sum_filter_ne_zero _
ext m
simp only [mem_antidiagonal, mem_addAntidiagonal, and_congr_left_iff, mem_filter,
mem_support]
rintro h
rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)]
#align hahn_series.to_power_series HahnSeries.toPowerSeries
theorem coeff_toPowerSeries {f : HahnSeries β R} {n : β} :
PowerSeries.coeff R n (toPowerSeries f) = f.coeff n :=
PowerSeries.coeff_mk _ _
#align hahn_series.coeff_to_power_series HahnSeries.coeff_toPowerSeries
theorem coeff_toPowerSeries_symm {f : PowerSeries R} {n : β} :
(HahnSeries.toPowerSeries.symm f).coeff n = PowerSeries.coeff R n f :=
rfl
#align hahn_series.coeff_to_power_series_symm HahnSeries.coeff_toPowerSeries_symm
variable (Ξ R) [StrictOrderedSemiring Ξ]
def ofPowerSeries : PowerSeries R β+* HahnSeries Ξ R :=
(HahnSeries.embDomainRingHom (Nat.castAddMonoidHom Ξ) Nat.strictMono_cast.injective fun _ _ =>
Nat.cast_le).comp
(RingEquiv.toRingHom toPowerSeries.symm)
#align hahn_series.of_power_series HahnSeries.ofPowerSeries
variable {Ξ} {R}
theorem ofPowerSeries_injective : Function.Injective (ofPowerSeries Ξ R) :=
embDomain_injective.comp toPowerSeries.symm.injective
#align hahn_series.of_power_series_injective HahnSeries.ofPowerSeries_injective
theorem ofPowerSeries_apply (x : PowerSeries R) :
ofPowerSeries Ξ R x =
HahnSeries.embDomain
β¨β¨((β) : β β Ξ), Nat.strictMono_cast.injectiveβ©, by
simp only [Function.Embedding.coeFn_mk]
exact Nat.cast_leβ©
(toPowerSeries.symm x) :=
rfl
#align hahn_series.of_power_series_apply HahnSeries.ofPowerSeries_apply
theorem ofPowerSeries_apply_coeff (x : PowerSeries R) (n : β) :
(ofPowerSeries Ξ R x).coeff n = PowerSeries.coeff R n x := by simp [ofPowerSeries_apply]
#align hahn_series.of_power_series_apply_coeff HahnSeries.ofPowerSeries_apply_coeff
@[simp]
theorem ofPowerSeries_C (r : R) : ofPowerSeries Ξ R (PowerSeries.C R r) = HahnSeries.C r := by
ext n
simp only [ofPowerSeries_apply, C, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, ne_eq,
single_coeff]
split_ifs with hn
Β· subst hn
convert @embDomain_coeff β R _ _ Ξ _ _ _ 0 <;> simp
Β· rw [embDomain_notin_image_support]
simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support,
PowerSeries.coeff_C]
intro
simp (config := { contextual := true }) [Ne.symm hn]
#align hahn_series.of_power_series_C HahnSeries.ofPowerSeries_C
@[simp]
| Mathlib/RingTheory/HahnSeries/PowerSeries.lean | 132 | 142 | theorem ofPowerSeries_X : ofPowerSeries Ξ R PowerSeries.X = single 1 1 := by
ext n |
ext n
simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk]
split_ifs with hn
Β· rw [hn]
convert @embDomain_coeff β R _ _ Ξ _ _ _ 1 <;> simp
Β· rw [embDomain_notin_image_support]
simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support,
PowerSeries.coeff_X]
intro
simp (config := { contextual := true }) [Ne.symm hn]
| true |
import Mathlib.Analysis.Complex.Basic
import Mathlib.FieldTheory.IntermediateField
import Mathlib.Topology.Algebra.Field
import Mathlib.Topology.Algebra.UniformRing
#align_import topology.instances.complex from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
section ComplexSubfield
open Complex Set
open ComplexConjugate
theorem Complex.subfield_eq_of_closed {K : Subfield β} (hc : IsClosed (K : Set β)) :
K = ofReal.fieldRange β¨ K = β€ := by
suffices range (ofReal' : β β β) β K by
rw [range_subset_iff, β coe_algebraMap] at this
have :=
(Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
(Subfield.toIntermediateField K this).toSubalgebra
simp_rw [β SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this β’
exact this
suffices range (ofReal' : β β β) β closure (Set.range ((ofReal' : β β β) β ((β) : β β β))) by
refine subset_trans this ?_
rw [β IsClosed.closure_eq hc]
apply closure_mono
rintro _ β¨_, rflβ©
simp only [Function.comp_apply, ofReal_ratCast, SetLike.mem_coe, SubfieldClass.ratCast_mem]
nth_rw 1 [range_comp]
refine subset_trans ?_ (image_closure_subset_closure_image continuous_ofReal)
rw [DenseRange.closure_range Rat.denseEmbedding_coe_real.dense]
simp only [image_univ]
rfl
#align complex.subfield_eq_of_closed Complex.subfield_eq_of_closed
| Mathlib/Topology/Instances/Complex.lean | 50 | 116 | theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield β) {Ο : K β+* β}
(hc : UniformContinuous Ο) : Ο.toFun = K.subtype β¨ Ο.toFun = conj β K.subtype := by
letI : TopologicalDivisionRing β := TopologicalDivisionRing.mk |
letI : TopologicalDivisionRing β := TopologicalDivisionRing.mk
letI : TopologicalRing K.topologicalClosure :=
Subring.instTopologicalRing K.topologicalClosure.toSubring
set ΞΉ : K β K.topologicalClosure := β(Subfield.inclusion K.le_topologicalClosure)
have ui : UniformInducing ΞΉ :=
β¨by
erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
congr β©
let di := ui.denseInducing (?_ : DenseRange ΞΉ)
Β· -- extΟ : closure(K) β+* β is the extension of Ο : K β+* β
let extΟ := DenseInducing.extendRingHom ui di.dense hc
haveI hΟ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
Β· left
let j := RingEquiv.subfieldCongr h
-- Οβ is the continuous ring hom `β β+* β` constructed from `j : closure (K) β+* β`
-- and `extΟ : closure (K) β+* β`
let Οβ := RingHom.comp extΟ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
-- Porting note: was `by continuity!` and was used inline
have hΟβ : Continuous Οβ := by
simpa only [RingHom.coe_comp] using hΟ.comp ((continuous_algebraMap β β).subtype_mk _)
ext1 x
rsuffices β¨r, hrβ© : β r : β, ofReal.rangeRestrict r = j (ΞΉ x)
Β· have :=
RingHom.congr_fun (ringHom_eq_ofReal_of_continuous hΟβ) r
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [RingHom.comp_apply, RingHom.comp_apply, hr, RingEquiv.toRingHom_eq_coe] at this
convert this using 1
Β· exact (DenseInducing.extend_eq di hc.continuous _).symm
Β· rw [β ofReal.coe_rangeRestrict, hr]
rfl
obtain β¨r, hrβ© := SetLike.coe_mem (j (ΞΉ x))
exact β¨r, Subtype.ext hrβ©
Β· -- Οβ is the continuous ring hom `β β+* β` constructed from `closure (K) β+* β`
-- and `extΟ : closure (K) β+* β`
let Οβ :=
RingHom.comp extΟ
(RingHom.comp (RingEquiv.subfieldCongr h).symm.toRingHom
(@Subfield.topEquiv β _).symm.toRingHom)
-- Porting note: was `by continuity!` and was used inline
have hΟβ : Continuous Οβ := by
simpa only [RingHom.coe_comp] using hΟ.comp (continuous_id.subtype_mk _)
cases' ringHom_eq_id_or_conj_of_continuous hΟβ with h h
Β· left
ext1 z
convert RingHom.congr_fun h z using 1
exact (DenseInducing.extend_eq di hc.continuous z).symm
Β· right
ext1 z
convert RingHom.congr_fun h z using 1
exact (DenseInducing.extend_eq di hc.continuous z).symm
Β· let j : { x // x β closure (id '' { x | (K : Set β) x }) } β (K.topologicalClosure : Set β) :=
fun x =>
β¨x, by
convert x.prop
simp only [id, Set.image_id']
rfl β©
convert DenseRange.comp (Function.Surjective.denseRange _)
(DenseEmbedding.subtype denseEmbedding_id (K : Set β)).dense (by continuity : Continuous j)
rintro β¨y, hyβ©
use
β¨y, by
convert hy
simp only [id, Set.image_id']
rfl β©
| true |
import Mathlib.Analysis.Convex.Side
import Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation
import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine
#align_import geometry.euclidean.angle.oriented.affine from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open FiniteDimensional Complex
open scoped Affine EuclideanGeometry Real RealInnerProductSpace ComplexConjugate
namespace EuclideanGeometry
variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace P]
[NormedAddTorsor V P] [hd2 : Fact (finrank β V = 2)] [Module.Oriented β V (Fin 2)]
abbrev o := @Module.Oriented.positiveOrientation
def oangle (pβ pβ pβ : P) : Real.Angle :=
o.oangle (pβ -α΅₯ pβ) (pβ -α΅₯ pβ)
#align euclidean_geometry.oangle EuclideanGeometry.oangle
@[inherit_doc] scoped notation "β‘" => EuclideanGeometry.oangle
theorem continuousAt_oangle {x : P Γ P Γ P} (hx12 : x.1 β x.2.1) (hx32 : x.2.2 β x.2.1) :
ContinuousAt (fun y : P Γ P Γ P => β‘ y.1 y.2.1 y.2.2) x := by
let f : P Γ P Γ P β V Γ V := fun y => (y.1 -α΅₯ y.2.1, y.2.2 -α΅₯ y.2.1)
have hf1 : (f x).1 β 0 := by simp [hx12]
have hf2 : (f x).2 β 0 := by simp [hx32]
exact (o.continuousAt_oangle hf1 hf2).comp ((continuous_fst.vsub continuous_snd.fst).prod_mk
(continuous_snd.snd.vsub continuous_snd.fst)).continuousAt
#align euclidean_geometry.continuous_at_oangle EuclideanGeometry.continuousAt_oangle
@[simp]
theorem oangle_self_left (pβ pβ : P) : β‘ pβ pβ pβ = 0 := by simp [oangle]
#align euclidean_geometry.oangle_self_left EuclideanGeometry.oangle_self_left
@[simp]
| Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean | 65 | 65 | theorem oangle_self_right (pβ pβ : P) : β‘ pβ pβ pβ = 0 := by | simp [oangle]
| true |
import Mathlib.Algebra.MvPolynomial.Derivation
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
universe u v
namespace MvPolynomial
open Set Function Finsupp
variable {R : Type u} {Ο : Type v} {a a' aβ aβ : R} {s : Ο ββ β}
section PDeriv
variable [CommSemiring R]
def pderiv (i : Ο) : Derivation R (MvPolynomial Ο R) (MvPolynomial Ο R) :=
letI := Classical.decEq Ο
mkDerivation R <| Pi.single i 1
#align mv_polynomial.pderiv MvPolynomial.pderiv
theorem pderiv_def [DecidableEq Ο] (i : Ο) : pderiv i = mkDerivation R (Pi.single i 1) := by
unfold pderiv; congr!
#align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
@[simp]
theorem pderiv_monomial {i : Ο} :
pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) := by
classical
simp only [pderiv_def, mkDerivation_monomial, Finsupp.smul_sum, smul_eq_mul, β smul_mul_assoc,
β (monomial _).map_smul]
refine (Finset.sum_eq_single i (fun j _ hne => ?_) fun hi => ?_).trans ?_
Β· simp [Pi.single_eq_of_ne hne]
Β· rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
Β· simp
#align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
theorem pderiv_C {i : Ο} : pderiv i (C a) = 0 :=
derivation_C _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_C MvPolynomial.pderiv_C
theorem pderiv_one {i : Ο} : pderiv i (1 : MvPolynomial Ο R) = 0 := pderiv_C
#align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
@[simp]
theorem pderiv_X [DecidableEq Ο] (i j : Ο) :
pderiv i (X j : MvPolynomial Ο R) = Pi.single (f := fun j => _) i 1 j := by
rw [pderiv_def, mkDerivation_X]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X MvPolynomial.pderiv_X
@[simp]
theorem pderiv_X_self (i : Ο) : pderiv i (X i : MvPolynomial Ο R) = 1 := by classical simp
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
@[simp]
theorem pderiv_X_of_ne {i j : Ο} (h : j β i) : pderiv i (X j : MvPolynomial Ο R) = 0 := by
classical simp [h]
set_option linter.uppercaseLean3 false in
#align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
theorem pderiv_eq_zero_of_not_mem_vars {i : Ο} {f : MvPolynomial Ο R} (h : i β f.vars) :
pderiv i f = 0 :=
derivation_eq_zero_of_forall_mem_vars fun _ hj => pderiv_X_of_ne <| ne_of_mem_of_not_mem hj h
#align mv_polynomial.pderiv_eq_zero_of_not_mem_vars MvPolynomial.pderiv_eq_zero_of_not_mem_vars
| Mathlib/Algebra/MvPolynomial/PDeriv.lean | 111 | 112 | theorem pderiv_monomial_single {i : Ο} {n : β} : pderiv i (monomial (single i n) a) =
monomial (single i (n - 1)) (a * n) := by | simp
| true |
import Mathlib.Data.Set.Prod
import Mathlib.Logic.Function.Conjugate
#align_import data.set.function from "leanprover-community/mathlib"@"996b0ff959da753a555053a480f36e5f264d4207"
variable {Ξ± Ξ² Ξ³ : Type*} {ΞΉ : Sort*} {Ο : Ξ± β Type*}
open Equiv Equiv.Perm Function
namespace Set
section Order
variable {s : Set Ξ±} {fβ fβ : Ξ± β Ξ²} [Preorder Ξ±] [Preorder Ξ²]
| Mathlib/Data/Set/Function.lean | 264 | 267 | theorem _root_.MonotoneOn.congr (hβ : MonotoneOn fβ s) (h : s.EqOn fβ fβ) : MonotoneOn fβ s := by
intro a ha b hb hab |
intro a ha b hb hab
rw [β h ha, β h hb]
exact hβ ha hb hab
| true |
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fintype
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} {Ξ² : Type v}
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
namespace Equiv.Perm
theorem perm_inv_on_of_perm_on_finset {s : Finset Ξ±} {f : Perm Ξ±} (h : β x β s, f x β s) {y : Ξ±}
(hy : y β s) : fβ»ΒΉ y β s := by
have h0 : β y β s, β (x : _) (hx : x β s), y = (fun i (_ : i β s) => f i) x hx :=
Finset.surj_on_of_inj_on_of_card_le (fun x hx => (fun i _ => f i) x hx) (fun a ha => h a ha)
(fun aβ aβ haβ haβ heq => (Equiv.apply_eq_iff_eq f).mp heq) rfl.ge
obtain β¨y2, hy2, heqβ© := h0 y hy
convert hy2
rw [heq]
simp only [inv_apply_self]
#align equiv.perm.perm_inv_on_of_perm_on_finset Equiv.Perm.perm_inv_on_of_perm_on_finset
theorem perm_inv_mapsTo_of_mapsTo (f : Perm Ξ±) {s : Set Ξ±} [Finite s] (h : Set.MapsTo f s s) :
Set.MapsTo (fβ»ΒΉ : _) s s := by
cases nonempty_fintype s
exact fun x hx =>
Set.mem_toFinset.mp <|
perm_inv_on_of_perm_on_finset
(fun a ha => Set.mem_toFinset.mpr (h (Set.mem_toFinset.mp ha)))
(Set.mem_toFinset.mpr hx)
#align equiv.perm.perm_inv_maps_to_of_maps_to Equiv.Perm.perm_inv_mapsTo_of_mapsTo
@[simp]
theorem perm_inv_mapsTo_iff_mapsTo {f : Perm Ξ±} {s : Set Ξ±} [Finite s] :
Set.MapsTo (fβ»ΒΉ : _) s s β Set.MapsTo f s s :=
β¨perm_inv_mapsTo_of_mapsTo fβ»ΒΉ, perm_inv_mapsTo_of_mapsTo fβ©
#align equiv.perm.perm_inv_maps_to_iff_maps_to Equiv.Perm.perm_inv_mapsTo_iff_mapsTo
theorem perm_inv_on_of_perm_on_finite {f : Perm Ξ±} {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) {x : Ξ±} (hx : p x) : p (fβ»ΒΉ x) :=
-- Porting note: relies heavily on the definitions of `Subtype` and `setOf` unfolding to their
-- underlying predicate.
have : Finite { x | p x } := βΉ_βΊ
perm_inv_mapsTo_of_mapsTo (s := {x | p x}) f h hx
#align equiv.perm.perm_inv_on_of_perm_on_finite Equiv.Perm.perm_inv_on_of_perm_on_finite
abbrev subtypePermOfFintype (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) : Perm { x // p x } :=
f.subtypePerm fun x => β¨h x, fun hβ => f.inv_apply_self x βΈ perm_inv_on_of_perm_on_finite h hββ©
#align equiv.perm.subtype_perm_of_fintype Equiv.Perm.subtypePermOfFintype
@[simp]
theorem subtypePermOfFintype_apply (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) (x : { x // p x }) : subtypePermOfFintype f h x = β¨f x, h x x.2β© :=
rfl
#align equiv.perm.subtype_perm_of_fintype_apply Equiv.Perm.subtypePermOfFintype_apply
theorem subtypePermOfFintype_one (p : Ξ± β Prop) [Finite { x // p x }]
(h : β x, p x β p ((1 : Perm Ξ±) x)) : @subtypePermOfFintype Ξ± 1 p _ h = 1 :=
rfl
#align equiv.perm.subtype_perm_of_fintype_one Equiv.Perm.subtypePermOfFintype_one
| Mathlib/GroupTheory/Perm/Finite.lean | 111 | 129 | theorem perm_mapsTo_inl_iff_mapsTo_inr {m n : Type*} [Finite m] [Finite n] (Ο : Perm (Sum m n)) :
Set.MapsTo Ο (Set.range Sum.inl) (Set.range Sum.inl) β
Set.MapsTo Ο (Set.range Sum.inr) (Set.range Sum.inr) := by
constructor <;> |
constructor <;>
( intro h
classical
rw [β perm_inv_mapsTo_iff_mapsTo] at h
intro x
cases' hx : Ο x with l r)
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨l, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inl_ne_inr
Β· rintro _; exact β¨r, rflβ©
Β· rintro _; exact β¨l, rflβ©
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨r, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inr_ne_inl
| true |
import Mathlib.Analysis.InnerProductSpace.Projection
import Mathlib.Geometry.Euclidean.PerpBisector
import Mathlib.Algebra.QuadraticDiscriminant
#align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0"
noncomputable section
open scoped Classical
open RealInnerProductSpace
namespace EuclideanGeometry
variable {V : Type*} {P : Type*}
variable [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace P]
variable [NormedAddTorsor V P]
theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) :
dist p1 (midpoint β p1 p2) = dist p2 (midpoint β p1 p2) := by
rw [dist_left_midpoint (π := β) p1 p2, dist_right_midpoint (π := β) p1 p2]
#align euclidean_geometry.dist_left_midpoint_eq_dist_right_midpoint EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint
theorem inner_weightedVSub {ΞΉβ : Type*} {sβ : Finset ΞΉβ} {wβ : ΞΉβ β β} (pβ : ΞΉβ β P)
(hβ : β i β sβ, wβ i = 0) {ΞΉβ : Type*} {sβ : Finset ΞΉβ} {wβ : ΞΉβ β β} (pβ : ΞΉβ β P)
(hβ : β i β sβ, wβ i = 0) :
βͺsβ.weightedVSub pβ wβ, sβ.weightedVSub pβ wββ« =
(-β iβ β sβ, β iβ β sβ, wβ iβ * wβ iβ * (dist (pβ iβ) (pβ iβ) * dist (pβ iβ) (pβ iβ))) /
2 := by
rw [Finset.weightedVSub_apply, Finset.weightedVSub_apply,
inner_sum_smul_sum_smul_of_sum_eq_zero _ hβ _ hβ]
simp_rw [vsub_sub_vsub_cancel_right]
rcongr (iβ iβ) <;> rw [dist_eq_norm_vsub V (pβ iβ) (pβ iβ)]
#align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSub
theorem dist_affineCombination {ΞΉ : Type*} {s : Finset ΞΉ} {wβ wβ : ΞΉ β β} (p : ΞΉ β P)
(hβ : β i β s, wβ i = 1) (hβ : β i β s, wβ i = 1) : by
have aβ := s.affineCombination β p wβ
have aβ := s.affineCombination β p wβ
exact dist aβ aβ * dist aβ aβ = (-β iβ β s, β iβ β s,
(wβ - wβ) iβ * (wβ - wβ) iβ * (dist (p iβ) (p iβ) * dist (p iβ) (p iβ))) / 2 := by
dsimp only
rw [dist_eq_norm_vsub V (s.affineCombination β p wβ) (s.affineCombination β p wβ), β
@inner_self_eq_norm_mul_norm β, Finset.affineCombination_vsub]
have h : (β i β s, (wβ - wβ) i) = 0 := by
simp_rw [Pi.sub_apply, Finset.sum_sub_distrib, hβ, hβ, sub_self]
exact inner_weightedVSub p h p h
#align euclidean_geometry.dist_affine_combination EuclideanGeometry.dist_affineCombination
-- Porting note: `inner_vsub_vsub_of_dist_eq_of_dist_eq` moved to `PerpendicularBisector`
theorem dist_smul_vadd_sq (r : β) (v : V) (pβ pβ : P) :
dist (r β’ v +α΅₯ pβ) pβ * dist (r β’ v +α΅₯ pβ) pβ =
βͺv, vβ« * r * r + 2 * βͺv, pβ -α΅₯ pββ« * r + βͺpβ -α΅₯ pβ, pβ -α΅₯ pββ« := by
rw [dist_eq_norm_vsub V _ pβ, β real_inner_self_eq_norm_mul_norm, vadd_vsub_assoc,
real_inner_add_add_self, real_inner_smul_left, real_inner_smul_left, real_inner_smul_right]
ring
#align euclidean_geometry.dist_smul_vadd_sq EuclideanGeometry.dist_smul_vadd_sq
| Mathlib/Geometry/Euclidean/Basic.lean | 122 | 134 | theorem dist_smul_vadd_eq_dist {v : V} (pβ pβ : P) (hv : v β 0) (r : β) :
dist (r β’ v +α΅₯ pβ) pβ = dist pβ pβ β r = 0 β¨ r = -2 * βͺv, pβ -α΅₯ pββ« / βͺv, vβ« := by
conv_lhs => |
conv_lhs =>
rw [β mul_self_inj_of_nonneg dist_nonneg dist_nonneg, dist_smul_vadd_sq, β sub_eq_zero,
add_sub_assoc, dist_eq_norm_vsub V pβ pβ, β real_inner_self_eq_norm_mul_norm, sub_self]
have hvi : βͺv, vβ« β 0 := by simpa using hv
have hd : discrim βͺv, vβ« (2 * βͺv, pβ -α΅₯ pββ«) 0 = 2 * βͺv, pβ -α΅₯ pββ« * (2 * βͺv, pβ -α΅₯ pββ«) := by
rw [discrim]
ring
rw [quadratic_eq_zero_iff hvi hd, add_left_neg, zero_div, neg_mul_eq_neg_mul, β
mul_sub_right_distrib, sub_eq_add_neg, β mul_two, mul_assoc, mul_div_assoc, mul_div_mul_left,
mul_div_assoc]
norm_num
| true |
import Mathlib.Analysis.Calculus.Deriv.Inv
import Mathlib.Analysis.Calculus.Deriv.Polynomial
import Mathlib.Analysis.SpecialFunctions.ExpDeriv
import Mathlib.Analysis.SpecialFunctions.PolynomialExp
#align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open scoped Classical Topology
open Polynomial Real Filter Set Function
open scoped Polynomial
def expNegInvGlue (x : β) : β :=
if x β€ 0 then 0 else exp (-xβ»ΒΉ)
#align exp_neg_inv_glue expNegInvGlue
namespace expNegInvGlue
theorem zero_of_nonpos {x : β} (hx : x β€ 0) : expNegInvGlue x = 0 := by simp [expNegInvGlue, hx]
#align exp_neg_inv_glue.zero_of_nonpos expNegInvGlue.zero_of_nonpos
@[simp] -- Porting note (#10756): new lemma
protected theorem zero : expNegInvGlue 0 = 0 := zero_of_nonpos le_rfl
theorem pos_of_pos {x : β} (hx : 0 < x) : 0 < expNegInvGlue x := by
simp [expNegInvGlue, not_le.2 hx, exp_pos]
#align exp_neg_inv_glue.pos_of_pos expNegInvGlue.pos_of_pos
| Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean | 58 | 61 | theorem nonneg (x : β) : 0 β€ expNegInvGlue x := by
cases le_or_gt x 0 with |
cases le_or_gt x 0 with
| inl h => exact ge_of_eq (zero_of_nonpos h)
| inr h => exact le_of_lt (pos_of_pos h)
| true |
import Mathlib.Analysis.InnerProductSpace.Dual
import Mathlib.Analysis.InnerProductSpace.Orientation
import Mathlib.Data.Complex.Orientation
import Mathlib.Tactic.LinearCombination
#align_import analysis.inner_product_space.two_dim from "leanprover-community/mathlib"@"cd8fafa2fac98e1a67097e8a91ad9901cfde48af"
noncomputable section
open scoped RealInnerProductSpace ComplexConjugate
open FiniteDimensional
lemma FiniteDimensional.of_fact_finrank_eq_two {K V : Type*} [DivisionRing K]
[AddCommGroup V] [Module K V] [Fact (finrank K V = 2)] : FiniteDimensional K V :=
.of_fact_finrank_eq_succ 1
attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two
@[deprecated (since := "2024-02-02")]
alias FiniteDimensional.finiteDimensional_of_fact_finrank_eq_two :=
FiniteDimensional.of_fact_finrank_eq_two
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] [Fact (finrank β E = 2)]
(o : Orientation β E (Fin 2))
namespace Orientation
irreducible_def areaForm : E ββ[β] E ββ[β] β := by
let z : E [β^Fin 0]ββ[β] β ββ[β] β :=
AlternatingMap.constLinearEquivOfIsEmpty.symm
let y : E [β^Fin 1]ββ[β] β ββ[β] E ββ[β] β :=
LinearMap.llcomp β E (E [β^Fin 0]ββ[β] β) β z ββ AlternatingMap.curryLeftLinearMap
exact y ββ AlternatingMap.curryLeftLinearMap (R' := β) o.volumeForm
#align orientation.area_form Orientation.areaForm
local notation "Ο" => o.areaForm
| Mathlib/Analysis/InnerProductSpace/TwoDim.lean | 105 | 105 | theorem areaForm_to_volumeForm (x y : E) : Ο x y = o.volumeForm ![x, y] := by | simp [areaForm]
| true |
import Mathlib.Algebra.Polynomial.Roots
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent
import Mathlib.Analysis.Asymptotics.SpecificAsymptotics
#align_import analysis.special_functions.polynomials from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Filter Finset Asymptotics
open Asymptotics Polynomial Topology
namespace Polynomial
variable {π : Type*} [NormedLinearOrderedField π] (P Q : π[X])
theorem eventually_no_roots (hP : P β 0) : βαΆ x in atTop, Β¬P.IsRoot x :=
atTop_le_cofinite <| (finite_setOf_isRoot hP).compl_mem_cofinite
#align polynomial.eventually_no_roots Polynomial.eventually_no_roots
variable [OrderTopology π]
section PolynomialAtTop
theorem isEquivalent_atTop_lead :
(fun x => eval x P) ~[atTop] fun x => P.leadingCoeff * x ^ P.natDegree := by
by_cases h : P = 0
Β· simp [h, IsEquivalent.refl]
Β· simp only [Polynomial.eval_eq_sum_range, sum_range_succ]
exact
IsLittleO.add_isEquivalent
(IsLittleO.sum fun i hi =>
IsLittleO.const_mul_left
((IsLittleO.const_mul_right fun hz => h <| leadingCoeff_eq_zero.mp hz) <|
isLittleO_pow_pow_atTop_of_lt (mem_range.mp hi))
_)
IsEquivalent.refl
#align polynomial.is_equivalent_at_top_lead Polynomial.isEquivalent_atTop_lead
theorem tendsto_atTop_of_leadingCoeff_nonneg (hdeg : 0 < P.degree) (hnng : 0 β€ P.leadingCoeff) :
Tendsto (fun x => eval x P) atTop atTop :=
P.isEquivalent_atTop_lead.symm.tendsto_atTop <|
tendsto_const_mul_pow_atTop (natDegree_pos_iff_degree_pos.2 hdeg).ne' <|
hnng.lt_of_ne' <| leadingCoeff_ne_zero.mpr <| ne_zero_of_degree_gt hdeg
#align polynomial.tendsto_at_top_of_leading_coeff_nonneg Polynomial.tendsto_atTop_of_leadingCoeff_nonneg
theorem tendsto_atTop_iff_leadingCoeff_nonneg :
Tendsto (fun x => eval x P) atTop atTop β 0 < P.degree β§ 0 β€ P.leadingCoeff := by
refine β¨fun h => ?_, fun h => tendsto_atTop_of_leadingCoeff_nonneg P h.1 h.2β©
have : Tendsto (fun x => P.leadingCoeff * x ^ P.natDegree) atTop atTop :=
(isEquivalent_atTop_lead P).tendsto_atTop h
rw [tendsto_const_mul_pow_atTop_iff, β pos_iff_ne_zero, natDegree_pos_iff_degree_pos] at this
exact β¨this.1, this.2.leβ©
#align polynomial.tendsto_at_top_iff_leading_coeff_nonneg Polynomial.tendsto_atTop_iff_leadingCoeff_nonneg
theorem tendsto_atBot_iff_leadingCoeff_nonpos :
Tendsto (fun x => eval x P) atTop atBot β 0 < P.degree β§ P.leadingCoeff β€ 0 := by
simp only [β tendsto_neg_atTop_iff, β eval_neg, tendsto_atTop_iff_leadingCoeff_nonneg,
degree_neg, leadingCoeff_neg, neg_nonneg]
#align polynomial.tendsto_at_bot_iff_leading_coeff_nonpos Polynomial.tendsto_atBot_iff_leadingCoeff_nonpos
theorem tendsto_atBot_of_leadingCoeff_nonpos (hdeg : 0 < P.degree) (hnps : P.leadingCoeff β€ 0) :
Tendsto (fun x => eval x P) atTop atBot :=
P.tendsto_atBot_iff_leadingCoeff_nonpos.2 β¨hdeg, hnpsβ©
#align polynomial.tendsto_at_bot_of_leading_coeff_nonpos Polynomial.tendsto_atBot_of_leadingCoeff_nonpos
| Mathlib/Analysis/SpecialFunctions/Polynomials.lean | 84 | 88 | theorem abs_tendsto_atTop (hdeg : 0 < P.degree) :
Tendsto (fun x => abs <| eval x P) atTop atTop := by
rcases le_total 0 P.leadingCoeff with hP | hP |
rcases le_total 0 P.leadingCoeff with hP | hP
Β· exact tendsto_abs_atTop_atTop.comp (P.tendsto_atTop_of_leadingCoeff_nonneg hdeg hP)
Β· exact tendsto_abs_atBot_atTop.comp (P.tendsto_atBot_of_leadingCoeff_nonpos hdeg hP)
| true |
import Mathlib.RingTheory.Valuation.Basic
import Mathlib.NumberTheory.Padics.PadicNorm
import Mathlib.Analysis.Normed.Field.Basic
#align_import number_theory.padics.padic_numbers from "leanprover-community/mathlib"@"b9b2114f7711fec1c1e055d507f082f8ceb2c3b7"
noncomputable section
open scoped Classical
open Nat multiplicity padicNorm CauSeq CauSeq.Completion Metric
abbrev PadicSeq (p : β) :=
CauSeq _ (padicNorm p)
#align padic_seq PadicSeq
namespace PadicSeq
section
variable {p : β} [Fact p.Prime]
theorem stationary {f : CauSeq β (padicNorm p)} (hf : Β¬f β 0) :
β N, β m n, N β€ m β N β€ n β padicNorm p (f n) = padicNorm p (f m) :=
have : β Ξ΅ > 0, β N1, β j β₯ N1, Ξ΅ β€ padicNorm p (f j) :=
CauSeq.abv_pos_of_not_limZero <| not_limZero_of_not_congr_zero hf
let β¨Ξ΅, hΞ΅, N1, hN1β© := this
let β¨N2, hN2β© := CauSeq.cauchyβ f hΞ΅
β¨max N1 N2, fun n m hn hm β¦ by
have : padicNorm p (f n - f m) < Ξ΅ := hN2 _ (max_le_iff.1 hn).2 _ (max_le_iff.1 hm).2
have : padicNorm p (f n - f m) < padicNorm p (f n) :=
lt_of_lt_of_le this <| hN1 _ (max_le_iff.1 hn).1
have : padicNorm p (f n - f m) < max (padicNorm p (f n)) (padicNorm p (f m)) :=
lt_max_iff.2 (Or.inl this)
by_contra hne
rw [β padicNorm.neg (f m)] at hne
have hnam := add_eq_max_of_ne hne
rw [padicNorm.neg, max_comm] at hnam
rw [β hnam, sub_eq_add_neg, add_comm] at this
apply _root_.lt_irrefl _ thisβ©
#align padic_seq.stationary PadicSeq.stationary
def stationaryPoint {f : PadicSeq p} (hf : Β¬f β 0) : β :=
Classical.choose <| stationary hf
#align padic_seq.stationary_point PadicSeq.stationaryPoint
theorem stationaryPoint_spec {f : PadicSeq p} (hf : Β¬f β 0) :
β {m n},
stationaryPoint hf β€ m β stationaryPoint hf β€ n β padicNorm p (f n) = padicNorm p (f m) :=
@(Classical.choose_spec <| stationary hf)
#align padic_seq.stationary_point_spec PadicSeq.stationaryPoint_spec
def norm (f : PadicSeq p) : β :=
if hf : f β 0 then 0 else padicNorm p (f (stationaryPoint hf))
#align padic_seq.norm PadicSeq.norm
theorem norm_zero_iff (f : PadicSeq p) : f.norm = 0 β f β 0 := by
constructor
Β· intro h
by_contra hf
unfold norm at h
split_ifs at h
Β· contradiction
apply hf
intro Ξ΅ hΞ΅
exists stationaryPoint hf
intro j hj
have heq := stationaryPoint_spec hf le_rfl hj
simpa [h, heq]
Β· intro h
simp [norm, h]
#align padic_seq.norm_zero_iff PadicSeq.norm_zero_iff
end
section Embedding
open CauSeq
variable {p : β} [Fact p.Prime]
theorem equiv_zero_of_val_eq_of_equiv_zero {f g : PadicSeq p}
(h : β k, padicNorm p (f k) = padicNorm p (g k)) (hf : f β 0) : g β 0 := fun Ξ΅ hΞ΅ β¦
let β¨i, hiβ© := hf _ hΞ΅
β¨i, fun j hj β¦ by simpa [h] using hi _ hjβ©
#align padic_seq.equiv_zero_of_val_eq_of_equiv_zero PadicSeq.equiv_zero_of_val_eq_of_equiv_zero
theorem norm_nonzero_of_not_equiv_zero {f : PadicSeq p} (hf : Β¬f β 0) : f.norm β 0 :=
hf β f.norm_zero_iff.1
#align padic_seq.norm_nonzero_of_not_equiv_zero PadicSeq.norm_nonzero_of_not_equiv_zero
theorem norm_eq_norm_app_of_nonzero {f : PadicSeq p} (hf : Β¬f β 0) :
β k, f.norm = padicNorm p k β§ k β 0 :=
have heq : f.norm = padicNorm p (f <| stationaryPoint hf) := by simp [norm, hf]
β¨f <| stationaryPoint hf, heq, fun h β¦
norm_nonzero_of_not_equiv_zero hf (by simpa [h] using heq)β©
#align padic_seq.norm_eq_norm_app_of_nonzero PadicSeq.norm_eq_norm_app_of_nonzero
theorem not_limZero_const_of_nonzero {q : β} (hq : q β 0) : Β¬LimZero (const (padicNorm p) q) :=
fun h' β¦ hq <| const_limZero.1 h'
#align padic_seq.not_lim_zero_const_of_nonzero PadicSeq.not_limZero_const_of_nonzero
theorem not_equiv_zero_const_of_nonzero {q : β} (hq : q β 0) : Β¬const (padicNorm p) q β 0 :=
fun h : LimZero (const (padicNorm p) q - 0) β¦ not_limZero_const_of_nonzero hq <| by simpa using h
#align padic_seq.not_equiv_zero_const_of_nonzero PadicSeq.not_equiv_zero_const_of_nonzero
theorem norm_nonneg (f : PadicSeq p) : 0 β€ f.norm :=
if hf : f β 0 then by simp [hf, norm] else by simp [norm, hf, padicNorm.nonneg]
#align padic_seq.norm_nonneg PadicSeq.norm_nonneg
| Mathlib/NumberTheory/Padics/PadicNumbers.lean | 176 | 181 | theorem lift_index_left_left {f : PadicSeq p} (hf : Β¬f β 0) (v2 v3 : β) :
padicNorm p (f (stationaryPoint hf)) =
padicNorm p (f (max (stationaryPoint hf) (max v2 v3))) := by
apply stationaryPoint_spec hf |
apply stationaryPoint_spec hf
Β· apply le_max_left
Β· exact le_rfl
| true |
import Mathlib.Algebra.Order.Floor
import Mathlib.Algebra.Order.Field.Power
import Mathlib.Data.Nat.Log
#align_import data.int.log from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58"
variable {R : Type*} [LinearOrderedSemifield R] [FloorSemiring R]
namespace Int
def log (b : β) (r : R) : β€ :=
if 1 β€ r then Nat.log b βrββ else -Nat.clog b βrβ»ΒΉββ
#align int.log Int.log
theorem log_of_one_le_right (b : β) {r : R} (hr : 1 β€ r) : log b r = Nat.log b βrββ :=
if_pos hr
#align int.log_of_one_le_right Int.log_of_one_le_right
theorem log_of_right_le_one (b : β) {r : R} (hr : r β€ 1) : log b r = -Nat.clog b βrβ»ΒΉββ := by
obtain rfl | hr := hr.eq_or_lt
Β· rw [log, if_pos hr, inv_one, Nat.ceil_one, Nat.floor_one, Nat.log_one_right, Nat.clog_one_right,
Int.ofNat_zero, neg_zero]
Β· exact if_neg hr.not_le
#align int.log_of_right_le_one Int.log_of_right_le_one
@[simp, norm_cast]
theorem log_natCast (b : β) (n : β) : log b (n : R) = Nat.log b n := by
cases n
Β· simp [log_of_right_le_one]
Β· rw [log_of_one_le_right, Nat.floor_natCast]
simp
#align int.log_nat_cast Int.log_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem log_ofNat (b : β) (n : β) [n.AtLeastTwo] :
log b (no_index (OfNat.ofNat n : R)) = Nat.log b (OfNat.ofNat n) :=
log_natCast b n
theorem log_of_left_le_one {b : β} (hb : b β€ 1) (r : R) : log b r = 0 := by
rcases le_total 1 r with h | h
Β· rw [log_of_one_le_right _ h, Nat.log_of_left_le_one hb, Int.ofNat_zero]
Β· rw [log_of_right_le_one _ h, Nat.clog_of_left_le_one hb, Int.ofNat_zero, neg_zero]
#align int.log_of_left_le_one Int.log_of_left_le_one
theorem log_of_right_le_zero (b : β) {r : R} (hr : r β€ 0) : log b r = 0 := by
rw [log_of_right_le_one _ (hr.trans zero_le_one),
Nat.clog_of_right_le_one ((Nat.ceil_eq_zero.mpr <| inv_nonpos.2 hr).trans_le zero_le_one),
Int.ofNat_zero, neg_zero]
#align int.log_of_right_le_zero Int.log_of_right_le_zero
theorem zpow_log_le_self {b : β} {r : R} (hb : 1 < b) (hr : 0 < r) : (b : R) ^ log b r β€ r := by
rcases le_total 1 r with hr1 | hr1
Β· rw [log_of_one_le_right _ hr1]
rw [zpow_natCast, β Nat.cast_pow, β Nat.le_floor_iff hr.le]
exact Nat.pow_log_le_self b (Nat.floor_pos.mpr hr1).ne'
Β· rw [log_of_right_le_one _ hr1, zpow_neg, zpow_natCast, β Nat.cast_pow]
exact inv_le_of_inv_le hr (Nat.ceil_le.1 <| Nat.le_pow_clog hb _)
#align int.zpow_log_le_self Int.zpow_log_le_self
theorem lt_zpow_succ_log_self {b : β} (hb : 1 < b) (r : R) : r < (b : R) ^ (log b r + 1) := by
rcases le_or_lt r 0 with hr | hr
Β· rw [log_of_right_le_zero _ hr, zero_add, zpow_one]
exact hr.trans_lt (zero_lt_one.trans_le <| mod_cast hb.le)
rcases le_or_lt 1 r with hr1 | hr1
Β· rw [log_of_one_le_right _ hr1]
rw [Int.ofNat_add_one_out, zpow_natCast, β Nat.cast_pow]
apply Nat.lt_of_floor_lt
exact Nat.lt_pow_succ_log_self hb _
Β· rw [log_of_right_le_one _ hr1.le]
have hcri : 1 < rβ»ΒΉ := one_lt_inv hr hr1
have : 1 β€ Nat.clog b βrβ»ΒΉββ :=
Nat.succ_le_of_lt (Nat.clog_pos hb <| Nat.one_lt_cast.1 <| hcri.trans_le (Nat.le_ceil _))
rw [neg_add_eq_sub, β neg_sub, β Int.ofNat_one, β Int.ofNat_sub this, zpow_neg, zpow_natCast,
lt_inv hr (pow_pos (Nat.cast_pos.mpr <| zero_lt_one.trans hb) _), β Nat.cast_pow]
refine Nat.lt_ceil.1 ?_
exact Nat.pow_pred_clog_lt_self hb <| Nat.one_lt_cast.1 <| hcri.trans_le <| Nat.le_ceil _
#align int.lt_zpow_succ_log_self Int.lt_zpow_succ_log_self
@[simp]
theorem log_zero_right (b : β) : log b (0 : R) = 0 :=
log_of_right_le_zero b le_rfl
#align int.log_zero_right Int.log_zero_right
@[simp]
theorem log_one_right (b : β) : log b (1 : R) = 0 := by
rw [log_of_one_le_right _ le_rfl, Nat.floor_one, Nat.log_one_right, Int.ofNat_zero]
#align int.log_one_right Int.log_one_right
-- Porting note: needed to replace b ^ z with (b : R) ^ z in the below
| Mathlib/Data/Int/Log.lean | 138 | 145 | theorem log_zpow {b : β} (hb : 1 < b) (z : β€) : log b ((b : R) ^ z : R) = z := by
obtain β¨n, rfl | rflβ© := Int.eq_nat_or_neg z |
obtain β¨n, rfl | rflβ© := Int.eq_nat_or_neg z
Β· rw [log_of_one_le_right _ (one_le_zpow_of_nonneg _ <| Int.natCast_nonneg _), zpow_natCast, β
Nat.cast_pow, Nat.floor_natCast, Nat.log_pow hb]
exact mod_cast hb.le
Β· rw [log_of_right_le_one _ (zpow_le_one_of_nonpos _ <| neg_nonpos.mpr (Int.natCast_nonneg _)),
zpow_neg, inv_inv, zpow_natCast, β Nat.cast_pow, Nat.ceil_natCast, Nat.clog_pow _ _ hb]
exact mod_cast hb.le
| true |
import Mathlib.NumberTheory.NumberField.Basic
import Mathlib.RingTheory.FractionalIdeal.Norm
import Mathlib.RingTheory.FractionalIdeal.Operations
variable (K : Type*) [Field K] [NumberField K]
namespace NumberField
open scoped nonZeroDivisors
section Basis
open Module
-- This is necessary to avoid several timeouts
attribute [local instance 2000] Submodule.module
instance (I : FractionalIdeal (π K)β° K) : Module.Free β€ I := by
refine Free.of_equiv (LinearEquiv.restrictScalars β€ (I.equivNum ?_)).symm
exact nonZeroDivisors.coe_ne_zero I.den
instance (I : FractionalIdeal (π K)β° K) : Module.Finite β€ I := by
refine Module.Finite.of_surjective
(LinearEquiv.restrictScalars β€ (I.equivNum ?_)).symm.toLinearMap (LinearEquiv.surjective _)
exact nonZeroDivisors.coe_ne_zero I.den
instance (I : (FractionalIdeal (π K)β° K)Λ£) :
IsLocalizedModule β€β° ((Submodule.subtype (I : Submodule (π K) K)).restrictScalars β€) where
map_units x := by
rw [β (Algebra.lmul _ _).commutes, Algebra.lmul_isUnit_iff, isUnit_iff_ne_zero, eq_intCast,
Int.cast_ne_zero]
exact nonZeroDivisors.coe_ne_zero x
surj' x := by
obtain β¨β¨a, _, d, hd, rflβ©, hβ© := IsLocalization.surj (Algebra.algebraMapSubmonoid (π K) β€β°) x
refine β¨β¨β¨Ideal.absNorm I.1.num * (algebraMap _ K a), I.1.num_le ?_β©, d * Ideal.absNorm I.1.num,
?_β© , ?_β©
Β· simp_rw [FractionalIdeal.val_eq_coe, FractionalIdeal.coe_coeIdeal]
refine (IsLocalization.mem_coeSubmodule _ _).mpr β¨Ideal.absNorm I.1.num * a, ?_, ?_β©
Β· exact Ideal.mul_mem_right _ _ I.1.num.absNorm_mem
Β· rw [map_mul, map_natCast]
Β· refine Submonoid.mul_mem _ hd (mem_nonZeroDivisors_of_ne_zero ?_)
rw [Nat.cast_ne_zero, ne_eq, Ideal.absNorm_eq_zero_iff]
exact FractionalIdeal.num_eq_zero_iff.not.mpr <| Units.ne_zero I
Β· simp_rw [LinearMap.coe_restrictScalars, Submodule.coeSubtype] at h β’
rw [β h]
simp only [Submonoid.mk_smul, zsmul_eq_mul, Int.cast_mul, Int.cast_natCast, algebraMap_int_eq,
eq_intCast, map_intCast]
ring
exists_of_eq h :=
β¨1, by rwa [one_smul, one_smul, β (Submodule.injective_subtype I.1.coeToSubmodule).eq_iff]β©
noncomputable def fractionalIdealBasis (I : FractionalIdeal (π K)β° K) :
Basis (Free.ChooseBasisIndex β€ I) β€ I := Free.chooseBasis β€ I
noncomputable def basisOfFractionalIdeal (I : (FractionalIdeal (π K)β° K)Λ£) :
Basis (Free.ChooseBasisIndex β€ I) β K :=
(fractionalIdealBasis K I.1).ofIsLocalizedModule β β€β°
((Submodule.subtype (I : Submodule (π K) K)).restrictScalars β€)
theorem basisOfFractionalIdeal_apply (I : (FractionalIdeal (π K)β° K)Λ£)
(i : Free.ChooseBasisIndex β€ I) :
basisOfFractionalIdeal K I i = fractionalIdealBasis K I.1 i :=
(fractionalIdealBasis K I.1).ofIsLocalizedModule_apply β β€β° _ i
| Mathlib/NumberTheory/NumberField/FractionalIdeal.lean | 87 | 90 | theorem mem_span_basisOfFractionalIdeal {I : (FractionalIdeal (π K)β° K)Λ£} {x : K} :
x β Submodule.span β€ (Set.range (basisOfFractionalIdeal K I)) β x β (I : Set K) := by
rw [basisOfFractionalIdeal, (fractionalIdealBasis K I.1).ofIsLocalizedModule_span β β€β° _] |
rw [basisOfFractionalIdeal, (fractionalIdealBasis K I.1).ofIsLocalizedModule_span β β€β° _]
simp
| true |
import Mathlib.Algebra.Homology.ComplexShape
import Mathlib.CategoryTheory.Subobject.Limits
import Mathlib.CategoryTheory.GradedObject
import Mathlib.Algebra.Homology.ShortComplex.Basic
#align_import algebra.homology.homological_complex from "leanprover-community/mathlib"@"88bca0ce5d22ebfd9e73e682e51d60ea13b48347"
universe v u
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits
variable {ΞΉ : Type*}
variable (V : Type u) [Category.{v} V] [HasZeroMorphisms V]
structure HomologicalComplex (c : ComplexShape ΞΉ) where
X : ΞΉ β V
d : β i j, X i βΆ X j
shape : β i j, Β¬c.Rel i j β d i j = 0 := by aesop_cat
d_comp_d' : β i j k, c.Rel i j β c.Rel j k β d i j β« d j k = 0 := by aesop_cat
#align homological_complex HomologicalComplex
abbrev ChainComplex (Ξ± : Type*) [AddRightCancelSemigroup Ξ±] [One Ξ±] : Type _ :=
HomologicalComplex V (ComplexShape.down Ξ±)
#align chain_complex ChainComplex
abbrev CochainComplex (Ξ± : Type*) [AddRightCancelSemigroup Ξ±] [One Ξ±] : Type _ :=
HomologicalComplex V (ComplexShape.up Ξ±)
#align cochain_complex CochainComplex
namespace CochainComplex
@[simp]
theorem prev (Ξ± : Type*) [AddGroup Ξ±] [One Ξ±] (i : Ξ±) : (ComplexShape.up Ξ±).prev i = i - 1 :=
(ComplexShape.up Ξ±).prev_eq' <| sub_add_cancel _ _
#align cochain_complex.prev CochainComplex.prev
@[simp]
theorem next (Ξ± : Type*) [AddRightCancelSemigroup Ξ±] [One Ξ±] (i : Ξ±) :
(ComplexShape.up Ξ±).next i = i + 1 :=
(ComplexShape.up Ξ±).next_eq' rfl
#align cochain_complex.next CochainComplex.next
@[simp]
| Mathlib/Algebra/Homology/HomologicalComplex.lean | 206 | 211 | theorem prev_nat_zero : (ComplexShape.up β).prev 0 = 0 := by
classical |
classical
refine dif_neg ?_
push_neg
intro
apply Nat.noConfusion
| true |
import Mathlib.LinearAlgebra.Contraction
#align_import linear_algebra.coevaluation from "leanprover-community/mathlib"@"d6814c584384ddf2825ff038e868451a7c956f31"
noncomputable section
section coevaluation
open TensorProduct FiniteDimensional
open TensorProduct
universe u v
variable (K : Type u) [Field K]
variable (V : Type v) [AddCommGroup V] [Module K V] [FiniteDimensional K V]
def coevaluation : K ββ[K] V β[K] Module.Dual K V :=
let bV := Basis.ofVectorSpace K V
(Basis.singleton Unit K).constr K fun _ =>
β i : Basis.ofVectorSpaceIndex K V, bV i ββ[K] bV.coord i
#align coevaluation coevaluation
| Mathlib/LinearAlgebra/Coevaluation.lean | 47 | 54 | theorem coevaluation_apply_one :
(coevaluation K V) (1 : K) =
let bV := Basis.ofVectorSpace K V
β i : Basis.ofVectorSpaceIndex K V, bV i ββ[K] bV.coord i := by
simp only [coevaluation, id] |
simp only [coevaluation, id]
rw [(Basis.singleton Unit K).constr_apply_fintype K]
simp only [Fintype.univ_punit, Finset.sum_const, one_smul, Basis.singleton_repr,
Basis.equivFun_apply, Basis.coe_ofVectorSpace, one_nsmul, Finset.card_singleton]
| true |
import Mathlib.Order.Cover
import Mathlib.Order.Interval.Finset.Defs
#align_import data.finset.locally_finite from "leanprover-community/mathlib"@"442a83d738cb208d3600056c489be16900ba701d"
assert_not_exists MonoidWithZero
assert_not_exists Finset.sum
open Function OrderDual
open FinsetInterval
variable {ΞΉ Ξ± : Type*}
namespace Finset
section Preorder
variable [Preorder Ξ±]
section LocallyFiniteOrder
variable [LocallyFiniteOrder Ξ±] {a aβ aβ b bβ bβ c x : Ξ±}
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Icc : (Icc a b).Nonempty β a β€ b := by
rw [β coe_nonempty, coe_Icc, Set.nonempty_Icc]
#align finset.nonempty_Icc Finset.nonempty_Icc
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Ico : (Ico a b).Nonempty β a < b := by
rw [β coe_nonempty, coe_Ico, Set.nonempty_Ico]
#align finset.nonempty_Ico Finset.nonempty_Ico
@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
| Mathlib/Order/Interval/Finset/Basic.lean | 67 | 68 | theorem nonempty_Ioc : (Ioc a b).Nonempty β a < b := by |
rw [β coe_nonempty, coe_Ioc, Set.nonempty_Ioc]
| true |
import Mathlib.Algebra.Order.ToIntervalMod
import Mathlib.Algebra.Ring.AddAut
import Mathlib.Data.Nat.Totient
import Mathlib.GroupTheory.Divisible
import Mathlib.Topology.Connected.PathConnected
import Mathlib.Topology.IsLocalHomeomorph
#align_import topology.instances.add_circle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec"
noncomputable section
open AddCommGroup Set Function AddSubgroup TopologicalSpace
open Topology
variable {π B : Type*}
@[nolint unusedArguments]
abbrev AddCircle [LinearOrderedAddCommGroup π] [TopologicalSpace π] [OrderTopology π] (p : π) :=
π β§Έ zmultiples p
#align add_circle AddCircle
namespace AddCircle
section LinearOrderedAddCommGroup
variable [LinearOrderedAddCommGroup π] [TopologicalSpace π] [OrderTopology π] (p : π)
theorem coe_nsmul {n : β} {x : π} : (β(n β’ x) : AddCircle p) = n β’ (x : AddCircle p) :=
rfl
#align add_circle.coe_nsmul AddCircle.coe_nsmul
theorem coe_zsmul {n : β€} {x : π} : (β(n β’ x) : AddCircle p) = n β’ (x : AddCircle p) :=
rfl
#align add_circle.coe_zsmul AddCircle.coe_zsmul
theorem coe_add (x y : π) : (β(x + y) : AddCircle p) = (x : AddCircle p) + (y : AddCircle p) :=
rfl
#align add_circle.coe_add AddCircle.coe_add
theorem coe_sub (x y : π) : (β(x - y) : AddCircle p) = (x : AddCircle p) - (y : AddCircle p) :=
rfl
#align add_circle.coe_sub AddCircle.coe_sub
theorem coe_neg {x : π} : (β(-x) : AddCircle p) = -(x : AddCircle p) :=
rfl
#align add_circle.coe_neg AddCircle.coe_neg
| Mathlib/Topology/Instances/AddCircle.lean | 152 | 153 | theorem coe_eq_zero_iff {x : π} : (x : AddCircle p) = 0 β β n : β€, n β’ p = x := by |
simp [AddSubgroup.mem_zmultiples_iff]
| true |
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals
import Mathlib.Analysis.Calculus.ParametricIntegral
import Mathlib.MeasureTheory.Measure.Haar.NormedSpace
#align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb"
open MeasureTheory Set Filter Asymptotics TopologicalSpace
open Real
open Complex hiding exp log abs_of_nonneg
open scoped Topology
noncomputable section
variable {E : Type*} [NormedAddCommGroup E]
section MellinConvergent
theorem mellin_convergent_iff_norm [NormedSpace β E] {f : β β E} {T : Set β} (hT : T β Ioi 0)
(hT' : MeasurableSet T) (hfc : AEStronglyMeasurable f <| volume.restrict <| Ioi 0) {s : β} :
IntegrableOn (fun t : β => (t : β) ^ (s - 1) β’ f t) T β
IntegrableOn (fun t : β => t ^ (s.re - 1) * βf tβ) T := by
have : AEStronglyMeasurable (fun t : β => (t : β) ^ (s - 1) β’ f t) (volume.restrict T) := by
refine ((ContinuousAt.continuousOn ?_).aestronglyMeasurable hT').smul (hfc.mono_set hT)
exact fun t ht => continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_gt (hT ht))
rw [IntegrableOn, β integrable_norm_iff this, β IntegrableOn]
refine integrableOn_congr_fun (fun t ht => ?_) hT'
simp_rw [norm_smul, Complex.norm_eq_abs, abs_cpow_eq_rpow_re_of_pos (hT ht), sub_re, one_re]
#align mellin_convergent_iff_norm mellin_convergent_iff_norm
theorem mellin_convergent_top_of_isBigO {f : β β β}
(hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0)) {a s : β}
(hf : f =O[atTop] (Β· ^ (-a))) (hs : s < a) :
β c : β, 0 < c β§ IntegrableOn (fun t : β => t ^ (s - 1) * f t) (Ioi c) := by
obtain β¨d, hd'β© := hf.isBigOWith
simp_rw [IsBigOWith, eventually_atTop] at hd'
obtain β¨e, heβ© := hd'
have he' : 0 < max e 1 := zero_lt_one.trans_le (le_max_right _ _)
refine β¨max e 1, he', ?_, ?_β©
Β· refine AEStronglyMeasurable.mul ?_ (hfc.mono_set (Ioi_subset_Ioi he'.le))
refine (ContinuousAt.continuousOn fun t ht => ?_).aestronglyMeasurable measurableSet_Ioi
exact continuousAt_rpow_const _ _ (Or.inl <| (he'.trans ht).ne')
Β· have : βα΅ t : β βvolume.restrict (Ioi <| max e 1),
βt ^ (s - 1) * f tβ β€ t ^ (s - 1 + -a) * d := by
refine (ae_restrict_mem measurableSet_Ioi).mono fun t ht => ?_
have ht' : 0 < t := he'.trans ht
rw [norm_mul, rpow_add ht', β norm_of_nonneg (rpow_nonneg ht'.le (-a)), mul_assoc,
mul_comm _ d, norm_of_nonneg (rpow_nonneg ht'.le _)]
gcongr
exact he t ((le_max_left e 1).trans_lt ht).le
refine (HasFiniteIntegral.mul_const ?_ _).mono' this
exact (integrableOn_Ioi_rpow_of_lt (by linarith) he').hasFiniteIntegral
set_option linter.uppercaseLean3 false in
#align mellin_convergent_top_of_is_O mellin_convergent_top_of_isBigO
| Mathlib/Analysis/MellinTransform.lean | 237 | 264 | theorem mellin_convergent_zero_of_isBigO {b : β} {f : β β β}
(hfc : AEStronglyMeasurable f <| volume.restrict (Ioi 0))
(hf : f =O[π[>] 0] (Β· ^ (-b))) {s : β} (hs : b < s) :
β c : β, 0 < c β§ IntegrableOn (fun t : β => t ^ (s - 1) * f t) (Ioc 0 c) := by
obtain β¨d, _, hd'β© := hf.exists_pos |
obtain β¨d, _, hd'β© := hf.exists_pos
simp_rw [IsBigOWith, eventually_nhdsWithin_iff, Metric.eventually_nhds_iff, gt_iff_lt] at hd'
obtain β¨Ξ΅, hΞ΅, hΞ΅'β© := hd'
refine β¨Ξ΅, hΞ΅, integrableOn_Ioc_iff_integrableOn_Ioo.mpr β¨?_, ?_β©β©
Β· refine AEStronglyMeasurable.mul ?_ (hfc.mono_set Ioo_subset_Ioi_self)
refine (ContinuousAt.continuousOn fun t ht => ?_).aestronglyMeasurable measurableSet_Ioo
exact continuousAt_rpow_const _ _ (Or.inl ht.1.ne')
Β· apply HasFiniteIntegral.mono'
Β· show HasFiniteIntegral (fun t => d * t ^ (s - b - 1)) _
refine (Integrable.hasFiniteIntegral ?_).const_mul _
rw [β IntegrableOn, β integrableOn_Ioc_iff_integrableOn_Ioo, β
intervalIntegrable_iff_integrableOn_Ioc_of_le hΞ΅.le]
exact intervalIntegral.intervalIntegrable_rpow' (by linarith)
Β· refine (ae_restrict_iff' measurableSet_Ioo).mpr (eventually_of_forall fun t ht => ?_)
rw [mul_comm, norm_mul]
specialize hΞ΅' _ ht.1
Β· rw [dist_eq_norm, sub_zero, norm_of_nonneg (le_of_lt ht.1)]
exact ht.2
Β· calc _ β€ d * βt ^ (-b)β * βt ^ (s - 1)β := by gcongr
_ = d * t ^ (s - b - 1) := ?_
simp_rw [norm_of_nonneg (rpow_nonneg (le_of_lt ht.1) _), mul_assoc]
rw [β rpow_add ht.1]
congr 2
abel
| true |
import Mathlib.Probability.Kernel.MeasurableIntegral
#align_import probability.kernel.composition from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b"
open MeasureTheory
open scoped ENNReal
namespace ProbabilityTheory
namespace kernel
variable {Ξ± Ξ² ΞΉ : Type*} {mΞ± : MeasurableSpace Ξ±} {mΞ² : MeasurableSpace Ξ²}
section CompositionProduct
variable {Ξ³ : Type*} {mΞ³ : MeasurableSpace Ξ³} {s : Set (Ξ² Γ Ξ³)}
noncomputable def compProdFun (ΞΊ : kernel Ξ± Ξ²) (Ξ· : kernel (Ξ± Γ Ξ²) Ξ³) (a : Ξ±) (s : Set (Ξ² Γ Ξ³)) :
ββ₯0β :=
β«β» b, Ξ· (a, b) {c | (b, c) β s} βΞΊ a
#align probability_theory.kernel.comp_prod_fun ProbabilityTheory.kernel.compProdFun
| Mathlib/Probability/Kernel/Composition.lean | 93 | 96 | theorem compProdFun_empty (ΞΊ : kernel Ξ± Ξ²) (Ξ· : kernel (Ξ± Γ Ξ²) Ξ³) (a : Ξ±) :
compProdFun ΞΊ Ξ· a β
= 0 := by
simp only [compProdFun, Set.mem_empty_iff_false, Set.setOf_false, measure_empty, |
simp only [compProdFun, Set.mem_empty_iff_false, Set.setOf_false, measure_empty,
MeasureTheory.lintegral_const, zero_mul]
| true |
import Mathlib.Algebra.CharZero.Defs
import Mathlib.Algebra.Group.Hom.Defs
import Mathlib.Algebra.Order.Monoid.Canonical.Defs
import Mathlib.Algebra.Order.Monoid.OrderDual
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Defs
import Mathlib.Order.WithBot
#align_import algebra.order.monoid.with_top from "leanprover-community/mathlib"@"0111834459f5d7400215223ea95ae38a1265a907"
universe u v
variable {Ξ± : Type u} {Ξ² : Type v}
open Function
namespace WithTop
section Add
variable [Add Ξ±] {a b c d : WithTop Ξ±} {x y : Ξ±}
instance add : Add (WithTop Ξ±) :=
β¨Option.mapβ (Β· + Β·)β©
#align with_top.has_add WithTop.add
@[simp, norm_cast] lemma coe_add (a b : Ξ±) : β(a + b) = (a + b : WithTop Ξ±) := rfl
#align with_top.coe_add WithTop.coe_add
#noalign with_top.coe_bit0
#noalign with_top.coe_bit1
@[simp]
theorem top_add (a : WithTop Ξ±) : β€ + a = β€ :=
rfl
#align with_top.top_add WithTop.top_add
@[simp]
theorem add_top (a : WithTop Ξ±) : a + β€ = β€ := by cases a <;> rfl
#align with_top.add_top WithTop.add_top
@[simp]
theorem add_eq_top : a + b = β€ β a = β€ β¨ b = β€ := by
match a, b with
| β€, _ => simp
| _, β€ => simp
| (a : Ξ±), (b : Ξ±) => simp only [β coe_add, coe_ne_top, or_false]
#align with_top.add_eq_top WithTop.add_eq_top
theorem add_ne_top : a + b β β€ β a β β€ β§ b β β€ :=
add_eq_top.not.trans not_or
#align with_top.add_ne_top WithTop.add_ne_top
theorem add_lt_top [LT Ξ±] {a b : WithTop Ξ±} : a + b < β€ β a < β€ β§ b < β€ := by
simp_rw [WithTop.lt_top_iff_ne_top, add_ne_top]
#align with_top.add_lt_top WithTop.add_lt_top
theorem add_eq_coe :
β {a b : WithTop Ξ±} {c : Ξ±}, a + b = c β β a' b' : Ξ±, βa' = a β§ βb' = b β§ a' + b' = c
| β€, b, c => by simp
| some a, β€, c => by simp
| some a, some b, c => by norm_cast; simp
#align with_top.add_eq_coe WithTop.add_eq_coe
-- Porting note (#10618): simp can already prove this.
-- @[simp]
| Mathlib/Algebra/Order/Monoid/WithTop.lean | 156 | 156 | theorem add_coe_eq_top_iff {x : WithTop Ξ±} {y : Ξ±} : x + y = β€ β x = β€ := by | simp
| true |
import Mathlib.CategoryTheory.Sites.Grothendieck
import Mathlib.CategoryTheory.Sites.Pretopology
import Mathlib.CategoryTheory.Limits.Lattice
import Mathlib.Topology.Sets.Opens
#align_import category_theory.sites.spaces from "leanprover-community/mathlib"@"b6fa3beb29f035598cf0434d919694c5e98091eb"
universe u
namespace Opens
variable (T : Type u) [TopologicalSpace T]
open CategoryTheory TopologicalSpace CategoryTheory.Limits
def grothendieckTopology : GrothendieckTopology (Opens T) where
sieves X S := β x β X, β (U : _) (f : U βΆ X), S f β§ x β U
top_mem' X x hx := β¨_, π _, trivial, hxβ©
pullback_stable' X Y S f hf y hy := by
rcases hf y (f.le hy) with β¨U, g, hg, hUβ©
refine β¨U β Y, homOfLE inf_le_right, ?_, hU, hyβ©
apply S.downward_closed hg (homOfLE inf_le_left)
transitive' X S hS R hR x hx := by
rcases hS x hx with β¨U, f, hf, hUβ©
rcases hR hf _ hU with β¨V, g, hg, hVβ©
exact β¨_, g β« f, hg, hVβ©
#align opens.grothendieck_topology Opens.grothendieckTopology
def pretopology : Pretopology (Opens T) where
coverings X R := β x β X, β (U : _) (f : U βΆ X), R f β§ x β U
has_isos X Y f i x hx := β¨_, _, Presieve.singleton_self _, (inv f).le hxβ©
pullbacks X Y f S hS x hx := by
rcases hS _ (f.le hx) with β¨U, g, hg, hUβ©
refine β¨_, _, Presieve.pullbackArrows.mk _ _ hg, ?_β©
have : U β Y β€ pullback g f :=
leOfHom (pullback.lift (homOfLE inf_le_left) (homOfLE inf_le_right) rfl)
apply this β¨hU, hxβ©
transitive X S Ti hS hTi x hx := by
rcases hS x hx with β¨U, f, hf, hUβ©
rcases hTi f hf x hU with β¨V, g, hg, hVβ©
exact β¨_, _, β¨_, g, f, hf, hg, rflβ©, hVβ©
#align opens.pretopology Opens.pretopology
@[simp]
theorem pretopology_ofGrothendieck :
Pretopology.ofGrothendieck _ (Opens.grothendieckTopology T) = Opens.pretopology T := by
apply le_antisymm
Β· intro X R hR x hx
rcases hR x hx with β¨U, f, β¨V, gβ, gβ, hgβ, _β©, hUβ©
exact β¨V, gβ, hgβ, gβ.le hUβ©
Β· intro X R hR x hx
rcases hR x hx with β¨U, f, hf, hUβ©
exact β¨U, f, Sieve.le_generate R U hf, hUβ©
#align opens.pretopology_of_grothendieck Opens.pretopology_ofGrothendieck
@[simp]
| Mathlib/CategoryTheory/Sites/Spaces.lean | 92 | 95 | theorem pretopology_toGrothendieck :
Pretopology.toGrothendieck _ (Opens.pretopology T) = Opens.grothendieckTopology T := by
rw [β pretopology_ofGrothendieck] |
rw [β pretopology_ofGrothendieck]
apply (Pretopology.gi (Opens T)).l_u_eq
| true |
import Mathlib.Data.Set.Image
import Mathlib.Order.Interval.Set.Basic
#align_import data.set.intervals.with_bot_top from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
open Set
variable {Ξ± : Type*}
namespace WithTop
@[simp]
theorem preimage_coe_top : (some : Ξ± β WithTop Ξ±) β»ΒΉ' {β€} = (β
: Set Ξ±) :=
eq_empty_of_subset_empty fun _ => coe_ne_top
#align with_top.preimage_coe_top WithTop.preimage_coe_top
variable [Preorder Ξ±] {a b : Ξ±}
| Mathlib/Order/Interval/Set/WithBotTop.lean | 33 | 35 | theorem range_coe : range (some : Ξ± β WithTop Ξ±) = Iio β€ := by
ext x |
ext x
rw [mem_Iio, WithTop.lt_top_iff_ne_top, mem_range, ne_top_iff_exists]
| true |
import Mathlib.Algebra.Polynomial.Eval
#align_import data.polynomial.degree.lemmas from "leanprover-community/mathlib"@"728baa2f54e6062c5879a3e397ac6bac323e506f"
noncomputable section
open Polynomial
open Finsupp Finset
namespace Polynomial
universe u v w
variable {R : Type u} {S : Type v} {ΞΉ : Type w} {a b : R} {m n : β}
section Semiring
variable [Semiring R] {p q r : R[X]}
section NoZeroDivisors
variable [Semiring R] [NoZeroDivisors R] {p q : R[X]} {a : R}
theorem degree_mul_C (a0 : a β 0) : (p * C a).degree = p.degree := by
rw [degree_mul, degree_C a0, add_zero]
set_option linter.uppercaseLean3 false in
#align polynomial.degree_mul_C Polynomial.degree_mul_C
theorem degree_C_mul (a0 : a β 0) : (C a * p).degree = p.degree := by
rw [degree_mul, degree_C a0, zero_add]
set_option linter.uppercaseLean3 false in
#align polynomial.degree_C_mul Polynomial.degree_C_mul
| Mathlib/Algebra/Polynomial/Degree/Lemmas.lean | 366 | 367 | theorem natDegree_mul_C (a0 : a β 0) : (p * C a).natDegree = p.natDegree := by |
simp only [natDegree, degree_mul_C a0]
| true |
import Mathlib.LinearAlgebra.Eigenspace.Basic
import Mathlib.FieldTheory.Minpoly.Field
#align_import linear_algebra.eigenspace.minpoly from "leanprover-community/mathlib"@"c3216069e5f9369e6be586ccbfcde2592b3cec92"
universe u v w
namespace Module
namespace End
open Polynomial FiniteDimensional
open scoped Polynomial
variable {K : Type v} {V : Type w} [Field K] [AddCommGroup V] [Module K V]
theorem eigenspace_aeval_polynomial_degree_1 (f : End K V) (q : K[X]) (hq : degree q = 1) :
eigenspace f (-q.coeff 0 / q.leadingCoeff) = LinearMap.ker (aeval f q) :=
calc
eigenspace f (-q.coeff 0 / q.leadingCoeff)
_ = LinearMap.ker (q.leadingCoeff β’ f - algebraMap K (End K V) (-q.coeff 0)) := by
rw [eigenspace_div]
intro h
rw [leadingCoeff_eq_zero_iff_deg_eq_bot.1 h] at hq
cases hq
_ = LinearMap.ker (aeval f (C q.leadingCoeff * X + C (q.coeff 0))) := by
rw [C_mul', aeval_def]; simp [algebraMap, Algebra.toRingHom]
_ = LinearMap.ker (aeval f q) := by rwa [β eq_X_add_C_of_degree_eq_one]
#align module.End.eigenspace_aeval_polynomial_degree_1 Module.End.eigenspace_aeval_polynomial_degree_1
| Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean | 46 | 51 | theorem ker_aeval_ring_hom'_unit_polynomial (f : End K V) (c : K[X]Λ£) :
LinearMap.ker (aeval f (c : K[X])) = β₯ := by
rw [Polynomial.eq_C_of_degree_eq_zero (degree_coe_units c)] |
rw [Polynomial.eq_C_of_degree_eq_zero (degree_coe_units c)]
simp only [aeval_def, evalβ_C]
apply ker_algebraMap_end
apply coeff_coe_units_zero_ne_zero c
| true |
import Mathlib.Algebra.Group.Hom.Defs
import Mathlib.Algebra.Group.Units
#align_import algebra.hom.units from "leanprover-community/mathlib"@"a07d750983b94c530ab69a726862c2ab6802b38c"
assert_not_exists MonoidWithZero
assert_not_exists DenselyOrdered
open Function
universe u v w
namespace Units
variable {Ξ± : Type*} {M : Type u} {N : Type v} {P : Type w} [Monoid M] [Monoid N] [Monoid P]
@[to_additive "The additive homomorphism on `AddUnit`s induced by an `AddMonoidHom`."]
def map (f : M β* N) : MΛ£ β* NΛ£ :=
MonoidHom.mk'
(fun u => β¨f u.val, f u.inv,
by rw [β f.map_mul, u.val_inv, f.map_one],
by rw [β f.map_mul, u.inv_val, f.map_one]β©)
fun x y => ext (f.map_mul x y)
#align units.map Units.map
#align add_units.map AddUnits.map
@[to_additive (attr := simp)]
theorem coe_map (f : M β* N) (x : MΛ£) : β(map f x) = f x := rfl
#align units.coe_map Units.coe_map
#align add_units.coe_map AddUnits.coe_map
@[to_additive (attr := simp)]
theorem coe_map_inv (f : M β* N) (u : MΛ£) : β(map f u)β»ΒΉ = f βuβ»ΒΉ := rfl
#align units.coe_map_inv Units.coe_map_inv
#align add_units.coe_map_neg AddUnits.coe_map_neg
@[to_additive (attr := simp)]
theorem map_comp (f : M β* N) (g : N β* P) : map (g.comp f) = (map g).comp (map f) := rfl
#align units.map_comp Units.map_comp
#align add_units.map_comp AddUnits.map_comp
@[to_additive]
lemma map_injective {f : M β* N} (hf : Function.Injective f) :
Function.Injective (map f) := fun _ _ e => ext (hf (congr_arg val e))
variable (M)
@[to_additive (attr := simp)]
| Mathlib/Algebra/Group/Units/Hom.lean | 94 | 94 | theorem map_id : map (MonoidHom.id M) = MonoidHom.id MΛ£ := by | ext; rfl
| true |
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
#align_import measure_theory.function.egorov from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical
open MeasureTheory NNReal ENNReal Topology
namespace MeasureTheory
open Set Filter TopologicalSpace
variable {Ξ± Ξ² ΞΉ : Type*} {m : MeasurableSpace Ξ±} [MetricSpace Ξ²] {ΞΌ : Measure Ξ±}
namespace Egorov
def notConvergentSeq [Preorder ΞΉ] (f : ΞΉ β Ξ± β Ξ²) (g : Ξ± β Ξ²) (n : β) (j : ΞΉ) : Set Ξ± :=
β (k) (_ : j β€ k), { x | 1 / (n + 1 : β) < dist (f k x) (g x) }
#align measure_theory.egorov.not_convergent_seq MeasureTheory.Egorov.notConvergentSeq
variable {n : β} {i j : ΞΉ} {s : Set Ξ±} {Ξ΅ : β} {f : ΞΉ β Ξ± β Ξ²} {g : Ξ± β Ξ²}
| Mathlib/MeasureTheory/Function/Egorov.lean | 50 | 52 | theorem mem_notConvergentSeq_iff [Preorder ΞΉ] {x : Ξ±} :
x β notConvergentSeq f g n j β β k β₯ j, 1 / (n + 1 : β) < dist (f k x) (g x) := by |
simp_rw [notConvergentSeq, Set.mem_iUnion, exists_prop, mem_setOf]
| true |
import Mathlib.MeasureTheory.Integral.SetToL1
#align_import measure_theory.integral.bochner from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
assert_not_exists Differentiable
noncomputable section
open scoped Topology NNReal ENNReal MeasureTheory
open Set Filter TopologicalSpace ENNReal EMetric
namespace MeasureTheory
variable {Ξ± E F π : Type*}
section WeightedSMul
open ContinuousLinearMap
variable [NormedAddCommGroup F] [NormedSpace β F] {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±}
def weightedSMul {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (s : Set Ξ±) : F βL[β] F :=
(ΞΌ s).toReal β’ ContinuousLinearMap.id β F
#align measure_theory.weighted_smul MeasureTheory.weightedSMul
theorem weightedSMul_apply {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (s : Set Ξ±) (x : F) :
weightedSMul ΞΌ s x = (ΞΌ s).toReal β’ x := by simp [weightedSMul]
#align measure_theory.weighted_smul_apply MeasureTheory.weightedSMul_apply
@[simp]
theorem weightedSMul_zero_measure {m : MeasurableSpace Ξ±} :
weightedSMul (0 : Measure Ξ±) = (0 : Set Ξ± β F βL[β] F) := by ext1; simp [weightedSMul]
#align measure_theory.weighted_smul_zero_measure MeasureTheory.weightedSMul_zero_measure
@[simp]
| Mathlib/MeasureTheory/Integral/Bochner.lean | 181 | 182 | theorem weightedSMul_empty {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) :
weightedSMul ΞΌ β
= (0 : F βL[β] F) := by | ext1 x; rw [weightedSMul_apply]; simp
| true |
import Mathlib.Algebra.Group.Commute.Basic
import Mathlib.Data.Fintype.Card
import Mathlib.GroupTheory.Perm.Basic
#align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Equiv Finset
namespace Equiv.Perm
variable {Ξ± : Type*}
section IsSwap
variable [DecidableEq Ξ±]
def IsSwap (f : Perm Ξ±) : Prop :=
β x y, x β y β§ f = swap x y
#align equiv.perm.is_swap Equiv.Perm.IsSwap
@[simp]
theorem ofSubtype_swap_eq {p : Ξ± β Prop} [DecidablePred p] (x y : Subtype p) :
ofSubtype (Equiv.swap x y) = Equiv.swap βx βy :=
Equiv.ext fun z => by
by_cases hz : p z
Β· rw [swap_apply_def, ofSubtype_apply_of_mem _ hz]
split_ifs with hzx hzy
Β· simp_rw [hzx, Subtype.coe_eta, swap_apply_left]
Β· simp_rw [hzy, Subtype.coe_eta, swap_apply_right]
Β· rw [swap_apply_of_ne_of_ne] <;>
simp [Subtype.ext_iff, *]
Β· rw [ofSubtype_apply_of_not_mem _ hz, swap_apply_of_ne_of_ne]
Β· intro h
apply hz
rw [h]
exact Subtype.prop x
intro h
apply hz
rw [h]
exact Subtype.prop y
#align equiv.perm.of_subtype_swap_eq Equiv.Perm.ofSubtype_swap_eq
theorem IsSwap.of_subtype_isSwap {p : Ξ± β Prop} [DecidablePred p] {f : Perm (Subtype p)}
(h : f.IsSwap) : (ofSubtype f).IsSwap :=
let β¨β¨x, hxβ©, β¨y, hyβ©, hxyβ© := h
β¨x, y, by
simp only [Ne, Subtype.ext_iff] at hxy
exact hxy.1, by
rw [hxy.2, ofSubtype_swap_eq]β©
#align equiv.perm.is_swap.of_subtype_is_swap Equiv.Perm.IsSwap.of_subtype_isSwap
| Mathlib/GroupTheory/Perm/Support.lean | 248 | 253 | theorem ne_and_ne_of_swap_mul_apply_ne_self {f : Perm Ξ±} {x y : Ξ±} (hy : (swap x (f x) * f) y β y) :
f y β y β§ y β x := by
simp only [swap_apply_def, mul_apply, f.injective.eq_iff] at * |
simp only [swap_apply_def, mul_apply, f.injective.eq_iff] at *
by_cases h : f y = x
Β· constructor <;> intro <;> simp_all only [if_true, eq_self_iff_true, not_true, Ne]
Β· split_ifs at hy with h h <;> try { simp [*] at * }
| true |
import Mathlib.Data.Rat.Cast.Defs
import Mathlib.Algebra.Field.Basic
#align_import data.rat.cast from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441"
namespace Rat
variable {Ξ± : Type*} [DivisionRing Ξ±]
-- Porting note: rewrote proof
@[simp]
theorem cast_inv_nat (n : β) : ((nβ»ΒΉ : β) : Ξ±) = (n : Ξ±)β»ΒΉ := by
cases' n with n
Β· simp
rw [cast_def, inv_natCast_num, inv_natCast_den, if_neg n.succ_ne_zero,
Int.sign_eq_one_of_pos (Nat.cast_pos.mpr n.succ_pos), Int.cast_one, one_div]
#align rat.cast_inv_nat Rat.cast_inv_nat
-- Porting note: proof got a lot easier - is this still the intended statement?
@[simp]
theorem cast_inv_int (n : β€) : ((nβ»ΒΉ : β) : Ξ±) = (n : Ξ±)β»ΒΉ := by
cases' n with n n
Β· simp [ofInt_eq_cast, cast_inv_nat]
Β· simp only [ofInt_eq_cast, Int.cast_negSucc, β Nat.cast_succ, cast_neg, inv_neg, cast_inv_nat]
#align rat.cast_inv_int Rat.cast_inv_int
@[simp, norm_cast]
theorem cast_nnratCast {K} [DivisionRing K] (q : ββ₯0) :
((q : β) : K) = (q : K) := by
rw [Rat.cast_def, NNRat.cast_def, NNRat.cast_def]
have hn := @num_div_eq_of_coprime q.num q.den ?hdp q.coprime_num_den
on_goal 1 => have hd := @den_div_eq_of_coprime q.num q.den ?hdp q.coprime_num_den
case hdp => simpa only [Nat.cast_pos] using q.den_pos
simp only [Int.cast_natCast, Nat.cast_inj] at hn hd
rw [hn, hd, Int.cast_natCast]
@[simp, norm_cast]
| Mathlib/Data/Rat/Cast/Lemmas.lean | 55 | 57 | theorem cast_ofScientific {K} [DivisionRing K] (m : β) (s : Bool) (e : β) :
(OfScientific.ofScientific m s e : β) = (OfScientific.ofScientific m s e : K) := by |
rw [β NNRat.cast_ofScientific (K := K), β NNRat.cast_ofScientific, cast_nnratCast]
| true |
import Mathlib.Analysis.Calculus.BumpFunction.Basic
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
#align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
noncomputable section
open Function Filter Set Metric MeasureTheory FiniteDimensional Measure
open scoped Topology
namespace ContDiffBump
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [HasContDiffBump E]
[MeasurableSpace E] {c : E} (f : ContDiffBump c) {x : E} {n : ββ} {ΞΌ : Measure E}
protected def normed (ΞΌ : Measure E) : E β β := fun x => f x / β« x, f x βΞΌ
#align cont_diff_bump.normed ContDiffBump.normed
theorem normed_def {ΞΌ : Measure E} (x : E) : f.normed ΞΌ x = f x / β« x, f x βΞΌ :=
rfl
#align cont_diff_bump.normed_def ContDiffBump.normed_def
theorem nonneg_normed (x : E) : 0 β€ f.normed ΞΌ x :=
div_nonneg f.nonneg <| integral_nonneg f.nonneg'
#align cont_diff_bump.nonneg_normed ContDiffBump.nonneg_normed
theorem contDiff_normed {n : ββ} : ContDiff β n (f.normed ΞΌ) :=
f.contDiff.div_const _
#align cont_diff_bump.cont_diff_normed ContDiffBump.contDiff_normed
theorem continuous_normed : Continuous (f.normed ΞΌ) :=
f.continuous.div_const _
#align cont_diff_bump.continuous_normed ContDiffBump.continuous_normed
theorem normed_sub (x : E) : f.normed ΞΌ (c - x) = f.normed ΞΌ (c + x) := by
simp_rw [f.normed_def, f.sub]
#align cont_diff_bump.normed_sub ContDiffBump.normed_sub
theorem normed_neg (f : ContDiffBump (0 : E)) (x : E) : f.normed ΞΌ (-x) = f.normed ΞΌ x := by
simp_rw [f.normed_def, f.neg]
#align cont_diff_bump.normed_neg ContDiffBump.normed_neg
variable [BorelSpace E] [FiniteDimensional β E] [IsLocallyFiniteMeasure ΞΌ]
protected theorem integrable : Integrable f ΞΌ :=
f.continuous.integrable_of_hasCompactSupport f.hasCompactSupport
#align cont_diff_bump.integrable ContDiffBump.integrable
protected theorem integrable_normed : Integrable (f.normed ΞΌ) ΞΌ :=
f.integrable.div_const _
#align cont_diff_bump.integrable_normed ContDiffBump.integrable_normed
variable [ΞΌ.IsOpenPosMeasure]
theorem integral_pos : 0 < β« x, f x βΞΌ := by
refine (integral_pos_iff_support_of_nonneg f.nonneg' f.integrable).mpr ?_
rw [f.support_eq]
exact measure_ball_pos ΞΌ c f.rOut_pos
#align cont_diff_bump.integral_pos ContDiffBump.integral_pos
theorem integral_normed : β« x, f.normed ΞΌ x βΞΌ = 1 := by
simp_rw [ContDiffBump.normed, div_eq_mul_inv, mul_comm (f _), β smul_eq_mul, integral_smul]
exact inv_mul_cancel f.integral_pos.ne'
#align cont_diff_bump.integral_normed ContDiffBump.integral_normed
theorem support_normed_eq : Function.support (f.normed ΞΌ) = Metric.ball c f.rOut := by
unfold ContDiffBump.normed
rw [support_div, f.support_eq, support_const f.integral_pos.ne', inter_univ]
#align cont_diff_bump.support_normed_eq ContDiffBump.support_normed_eq
theorem tsupport_normed_eq : tsupport (f.normed ΞΌ) = Metric.closedBall c f.rOut := by
rw [tsupport, f.support_normed_eq, closure_ball _ f.rOut_pos.ne']
#align cont_diff_bump.tsupport_normed_eq ContDiffBump.tsupport_normed_eq
theorem hasCompactSupport_normed : HasCompactSupport (f.normed ΞΌ) := by
simp only [HasCompactSupport, f.tsupport_normed_eq (ΞΌ := ΞΌ), isCompact_closedBall]
#align cont_diff_bump.has_compact_support_normed ContDiffBump.hasCompactSupport_normed
theorem tendsto_support_normed_smallSets {ΞΉ} {Ο : ΞΉ β ContDiffBump c} {l : Filter ΞΉ}
(hΟ : Tendsto (fun i => (Ο i).rOut) l (π 0)) :
Tendsto (fun i => Function.support fun x => (Ο i).normed ΞΌ x) l (π c).smallSets := by
simp_rw [NormedAddCommGroup.tendsto_nhds_zero, Real.norm_eq_abs,
abs_eq_self.mpr (Ο _).rOut_pos.le] at hΟ
rw [nhds_basis_ball.smallSets.tendsto_right_iff]
refine fun Ξ΅ hΞ΅ β¦ (hΟ Ξ΅ hΞ΅).mono fun i hi β¦ ?_
rw [(Ο i).support_normed_eq]
exact ball_subset_ball hi.le
#align cont_diff_bump.tendsto_support_normed_small_sets ContDiffBump.tendsto_support_normed_smallSets
variable (ΞΌ)
theorem integral_normed_smul {X} [NormedAddCommGroup X] [NormedSpace β X]
[CompleteSpace X] (z : X) : β« x, f.normed ΞΌ x β’ z βΞΌ = z := by
simp_rw [integral_smul_const, f.integral_normed (ΞΌ := ΞΌ), one_smul]
#align cont_diff_bump.integral_normed_smul ContDiffBump.integral_normed_smul
theorem measure_closedBall_le_integral : (ΞΌ (closedBall c f.rIn)).toReal β€ β« x, f x βΞΌ := by calc
(ΞΌ (closedBall c f.rIn)).toReal = β« x in closedBall c f.rIn, 1 βΞΌ := by simp
_ = β« x in closedBall c f.rIn, f x βΞΌ := setIntegral_congr measurableSet_closedBall
(fun x hx β¦ (one_of_mem_closedBall f hx).symm)
_ β€ β« x, f x βΞΌ := setIntegral_le_integral f.integrable (eventually_of_forall (fun x β¦ f.nonneg))
| Mathlib/Analysis/Calculus/BumpFunction/Normed.lean | 117 | 123 | theorem normed_le_div_measure_closedBall_rIn (x : E) :
f.normed ΞΌ x β€ 1 / (ΞΌ (closedBall c f.rIn)).toReal := by
rw [normed_def] |
rw [normed_def]
gcongr
Β· exact ENNReal.toReal_pos (measure_closedBall_pos _ _ f.rIn_pos).ne' measure_closedBall_lt_top.ne
Β· exact f.le_one
Β· exact f.measure_closedBall_le_integral ΞΌ
| true |
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Prod
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Option
#align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open Equiv
@[simp]
theorem Equiv.optionCongr_one {Ξ± : Type*} : (1 : Perm Ξ±).optionCongr = 1 :=
Equiv.optionCongr_refl
#align equiv.option_congr_one Equiv.optionCongr_one
@[simp]
theorem Equiv.optionCongr_swap {Ξ± : Type*} [DecidableEq Ξ±] (x y : Ξ±) :
optionCongr (swap x y) = swap (some x) (some y) := by
ext (_ | i)
Β· simp [swap_apply_of_ne_of_ne]
Β· by_cases hx : i = x
Β· simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def,
Option.some.injEq]
by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne]
#align equiv.option_congr_swap Equiv.optionCongr_swap
@[simp]
theorem Equiv.optionCongr_sign {Ξ± : Type*} [DecidableEq Ξ±] [Fintype Ξ±] (e : Perm Ξ±) :
Perm.sign e.optionCongr = Perm.sign e := by
refine Perm.swap_induction_on e ?_ ?_
Β· simp [Perm.one_def]
Β· intro f x y hne h
simp [h, hne, Perm.mul_def, β Equiv.optionCongr_trans]
#align equiv.option_congr_sign Equiv.optionCongr_sign
@[simp]
theorem map_equiv_removeNone {Ξ± : Type*} [DecidableEq Ξ±] (Ο : Perm (Option Ξ±)) :
(removeNone Ο).optionCongr = swap none (Ο none) * Ο := by
ext1 x
have : Option.map (β(removeNone Ο)) x = (swap none (Ο none)) (Ο x) := by
cases' x with x
Β· simp
Β· cases h : Ο (some _)
Β· simp [removeNone_none _ h]
Β· have hn : Ο (some x) β none := by simp [h]
have hΟn : Ο (some x) β Ο none := Ο.injective.ne (by simp)
simp [removeNone_some _ β¨_, hβ©, β h, swap_apply_of_ne_of_ne hn hΟn]
simpa using this
#align map_equiv_remove_none map_equiv_removeNone
@[simps]
def Equiv.Perm.decomposeOption {Ξ± : Type*} [DecidableEq Ξ±] :
Perm (Option Ξ±) β Option Ξ± Γ Perm Ξ± where
toFun Ο := (Ο none, removeNone Ο)
invFun i := swap none i.1 * i.2.optionCongr
left_inv Ο := by simp
right_inv := fun β¨x, Οβ© => by
have : removeNone (swap none x * Ο.optionCongr) = Ο :=
Equiv.optionCongr_injective (by simp [β mul_assoc])
simp [β Perm.eq_inv_iff_eq, this]
#align equiv.perm.decompose_option Equiv.Perm.decomposeOption
| Mathlib/GroupTheory/Perm/Option.lean | 76 | 77 | theorem Equiv.Perm.decomposeOption_symm_of_none_apply {Ξ± : Type*} [DecidableEq Ξ±] (e : Perm Ξ±)
(i : Option Ξ±) : Equiv.Perm.decomposeOption.symm (none, e) i = i.map e := by | simp
| true |
import Mathlib.Topology.Category.TopCat.Limits.Products
#align_import topology.category.Top.limits.pullbacks from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
-- Porting note: every ML3 decl has an uppercase letter
set_option linter.uppercaseLean3 false
open TopologicalSpace
open CategoryTheory
open CategoryTheory.Limits
universe v u w
noncomputable section
namespace TopCat
variable {J : Type v} [SmallCategory J]
section Pullback
variable {X Y Z : TopCat.{u}}
abbrev pullbackFst (f : X βΆ Z) (g : Y βΆ Z) : TopCat.of { p : X Γ Y // f p.1 = g p.2 } βΆ X :=
β¨Prod.fst β Subtype.val, by
apply Continuous.comp <;> set_option tactic.skipAssignedInstances false in continuityβ©
#align Top.pullback_fst TopCat.pullbackFst
lemma pullbackFst_apply (f : X βΆ Z) (g : Y βΆ Z) (x) : pullbackFst f g x = x.1.1 := rfl
abbrev pullbackSnd (f : X βΆ Z) (g : Y βΆ Z) : TopCat.of { p : X Γ Y // f p.1 = g p.2 } βΆ Y :=
β¨Prod.snd β Subtype.val, by
apply Continuous.comp <;> set_option tactic.skipAssignedInstances false in continuityβ©
#align Top.pullback_snd TopCat.pullbackSnd
lemma pullbackSnd_apply (f : X βΆ Z) (g : Y βΆ Z) (x) : pullbackSnd f g x = x.1.2 := rfl
def pullbackCone (f : X βΆ Z) (g : Y βΆ Z) : PullbackCone f g :=
PullbackCone.mk (pullbackFst f g) (pullbackSnd f g)
(by
dsimp [pullbackFst, pullbackSnd, Function.comp_def]
ext β¨x, hβ©
-- Next 2 lines were
-- `rw [comp_apply, ContinuousMap.coe_mk, comp_apply, ContinuousMap.coe_mk]`
-- `exact h` before leanprover/lean4#2644
rw [comp_apply, comp_apply]
congr!)
#align Top.pullback_cone TopCat.pullbackCone
def pullbackConeIsLimit (f : X βΆ Z) (g : Y βΆ Z) : IsLimit (pullbackCone f g) :=
PullbackCone.isLimitAux' _
(by
intro S
constructor; swap
Β· exact
{ toFun := fun x =>
β¨β¨S.fst x, S.snd xβ©, by simpa using ConcreteCategory.congr_hom S.condition xβ©
continuous_toFun := by
apply Continuous.subtype_mk <| Continuous.prod_mk ?_ ?_
Β· exact (PullbackCone.fst S)|>.continuous_toFun
Β· exact (PullbackCone.snd S)|>.continuous_toFun
}
refine β¨?_, ?_, ?_β©
Β· delta pullbackCone
ext a
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [comp_apply, ContinuousMap.coe_mk]
Β· delta pullbackCone
ext a
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [comp_apply, ContinuousMap.coe_mk]
Β· intro m hβ hβ
-- Porting note: used to be ext x
apply ContinuousMap.ext; intro x
apply Subtype.ext
apply Prod.ext
Β· simpa using ConcreteCategory.congr_hom hβ x
Β· simpa using ConcreteCategory.congr_hom hβ x)
#align Top.pullback_cone_is_limit TopCat.pullbackConeIsLimit
def pullbackIsoProdSubtype (f : X βΆ Z) (g : Y βΆ Z) :
pullback f g β
TopCat.of { p : X Γ Y // f p.1 = g p.2 } :=
(limit.isLimit _).conePointUniqueUpToIso (pullbackConeIsLimit f g)
#align Top.pullback_iso_prod_subtype TopCat.pullbackIsoProdSubtype
@[reassoc (attr := simp)]
| Mathlib/Topology/Category/TopCat/Limits/Pullbacks.lean | 103 | 105 | theorem pullbackIsoProdSubtype_inv_fst (f : X βΆ Z) (g : Y βΆ Z) :
(pullbackIsoProdSubtype f g).inv β« pullback.fst = pullbackFst f g := by |
simp [pullbackCone, pullbackIsoProdSubtype]
| true |
import Mathlib.Data.Finsupp.Basic
import Mathlib.Data.Finsupp.Order
#align_import data.finsupp.multiset from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf"
open Finset
variable {Ξ± Ξ² ΞΉ : Type*}
namespace Finsupp
def toMultiset : (Ξ± ββ β) β+ Multiset Ξ± where
toFun f := Finsupp.sum f fun a n => n β’ {a}
-- Porting note: times out if h is not specified
map_add' _f _g := sum_add_index' (h := fun a n => n β’ ({a} : Multiset Ξ±))
(fun _ β¦ zero_nsmul _) (fun _ β¦ add_nsmul _)
map_zero' := sum_zero_index
theorem toMultiset_zero : toMultiset (0 : Ξ± ββ β) = 0 :=
rfl
#align finsupp.to_multiset_zero Finsupp.toMultiset_zero
theorem toMultiset_add (m n : Ξ± ββ β) : toMultiset (m + n) = toMultiset m + toMultiset n :=
toMultiset.map_add m n
#align finsupp.to_multiset_add Finsupp.toMultiset_add
theorem toMultiset_apply (f : Ξ± ββ β) : toMultiset f = f.sum fun a n => n β’ {a} :=
rfl
#align finsupp.to_multiset_apply Finsupp.toMultiset_apply
@[simp]
theorem toMultiset_single (a : Ξ±) (n : β) : toMultiset (single a n) = n β’ {a} := by
rw [toMultiset_apply, sum_single_index]; apply zero_nsmul
#align finsupp.to_multiset_single Finsupp.toMultiset_single
theorem toMultiset_sum {f : ΞΉ β Ξ± ββ β} (s : Finset ΞΉ) :
Finsupp.toMultiset (β i β s, f i) = β i β s, Finsupp.toMultiset (f i) :=
map_sum Finsupp.toMultiset _ _
#align finsupp.to_multiset_sum Finsupp.toMultiset_sum
theorem toMultiset_sum_single (s : Finset ΞΉ) (n : β) :
Finsupp.toMultiset (β i β s, single i n) = n β’ s.val := by
simp_rw [toMultiset_sum, Finsupp.toMultiset_single, sum_nsmul, sum_multiset_singleton]
#align finsupp.to_multiset_sum_single Finsupp.toMultiset_sum_single
@[simp]
theorem card_toMultiset (f : Ξ± ββ β) : Multiset.card (toMultiset f) = f.sum fun _ => id := by
simp [toMultiset_apply, map_finsupp_sum, Function.id_def]
#align finsupp.card_to_multiset Finsupp.card_toMultiset
| Mathlib/Data/Finsupp/Multiset.lean | 71 | 79 | theorem toMultiset_map (f : Ξ± ββ β) (g : Ξ± β Ξ²) :
f.toMultiset.map g = toMultiset (f.mapDomain g) := by
refine f.induction ?_ ?_ |
refine f.induction ?_ ?_
Β· rw [toMultiset_zero, Multiset.map_zero, mapDomain_zero, toMultiset_zero]
Β· intro a n f _ _ ih
rw [toMultiset_add, Multiset.map_add, ih, mapDomain_add, mapDomain_single,
toMultiset_single, toMultiset_add, toMultiset_single, β Multiset.coe_mapAddMonoidHom,
(Multiset.mapAddMonoidHom g).map_nsmul]
rfl
| true |
import Mathlib.Data.Real.NNReal
import Mathlib.Tactic.GCongr.Core
#align_import analysis.normed.group.seminorm from "leanprover-community/mathlib"@"09079525fd01b3dda35e96adaa08d2f943e1648c"
open Set
open NNReal
variable {ΞΉ R R' E F G : Type*}
structure AddGroupSeminorm (G : Type*) [AddGroup G] where
-- Porting note: can't extend `ZeroHom G β` because otherwise `to_additive` won't work since
-- we aren't using old structures
protected toFun : G β β
protected map_zero' : toFun 0 = 0
protected add_le' : β r s, toFun (r + s) β€ toFun r + toFun s
protected neg' : β r, toFun (-r) = toFun r
#align add_group_seminorm AddGroupSeminorm
@[to_additive]
structure GroupSeminorm (G : Type*) [Group G] where
protected toFun : G β β
protected map_one' : toFun 1 = 0
protected mul_le' : β x y, toFun (x * y) β€ toFun x + toFun y
protected inv' : β x, toFun xβ»ΒΉ = toFun x
#align group_seminorm GroupSeminorm
structure NonarchAddGroupSeminorm (G : Type*) [AddGroup G] extends ZeroHom G β where
protected add_le_max' : β r s, toFun (r + s) β€ max (toFun r) (toFun s)
protected neg' : β r, toFun (-r) = toFun r
#align nonarch_add_group_seminorm NonarchAddGroupSeminorm
structure AddGroupNorm (G : Type*) [AddGroup G] extends AddGroupSeminorm G where
protected eq_zero_of_map_eq_zero' : β x, toFun x = 0 β x = 0
#align add_group_norm AddGroupNorm
@[to_additive]
structure GroupNorm (G : Type*) [Group G] extends GroupSeminorm G where
protected eq_one_of_map_eq_zero' : β x, toFun x = 0 β x = 1
#align group_norm GroupNorm
structure NonarchAddGroupNorm (G : Type*) [AddGroup G] extends NonarchAddGroupSeminorm G where
protected eq_zero_of_map_eq_zero' : β x, toFun x = 0 β x = 0
#align nonarch_add_group_norm NonarchAddGroupNorm
class NonarchAddGroupSeminormClass (F : Type*) (Ξ± : outParam Type*) [AddGroup Ξ±] [FunLike F Ξ± β]
extends NonarchimedeanHomClass F Ξ± β : Prop where
protected map_zero (f : F) : f 0 = 0
protected map_neg_eq_map' (f : F) (a : Ξ±) : f (-a) = f a
#align nonarch_add_group_seminorm_class NonarchAddGroupSeminormClass
class NonarchAddGroupNormClass (F : Type*) (Ξ± : outParam Type*) [AddGroup Ξ±] [FunLike F Ξ± β]
extends NonarchAddGroupSeminormClass F Ξ± : Prop where
protected eq_zero_of_map_eq_zero (f : F) {a : Ξ±} : f a = 0 β a = 0
#align nonarch_add_group_norm_class NonarchAddGroupNormClass
section NonarchAddGroupSeminormClass
variable [AddGroup E] [FunLike F E β] [NonarchAddGroupSeminormClass F E] (f : F) (x y : E)
| Mathlib/Analysis/Normed/Group/Seminorm.lean | 148 | 150 | theorem map_sub_le_max : f (x - y) β€ max (f x) (f y) := by
rw [sub_eq_add_neg, β NonarchAddGroupSeminormClass.map_neg_eq_map' f y] |
rw [sub_eq_add_neg, β NonarchAddGroupSeminormClass.map_neg_eq_map' f y]
exact map_add_le_max _ _ _
| true |
import Mathlib.Data.Complex.Module
import Mathlib.LinearAlgebra.Determinant
#align_import data.complex.determinant from "leanprover-community/mathlib"@"65ec59902eb17e4ab7da8d7e3d0bd9774d1b8b99"
namespace Complex
@[simp]
| Mathlib/Data/Complex/Determinant.lean | 24 | 26 | theorem det_conjAe : LinearMap.det conjAe.toLinearMap = -1 := by
rw [β LinearMap.det_toMatrix basisOneI, toMatrix_conjAe, Matrix.det_fin_two_of] |
rw [β LinearMap.det_toMatrix basisOneI, toMatrix_conjAe, Matrix.det_fin_two_of]
simp
| true |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.Order.Monoid.Unbundled.Pow
import Mathlib.Algebra.Ring.Int
import Mathlib.Data.Nat.Factorial.Basic
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.nat.prime from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1"
open Bool Subtype
open Nat
namespace Nat
variable {n : β}
-- Porting note (#11180): removed @[pp_nodot]
def Prime (p : β) :=
Irreducible p
#align nat.prime Nat.Prime
theorem irreducible_iff_nat_prime (a : β) : Irreducible a β Nat.Prime a :=
Iff.rfl
#align irreducible_iff_nat_prime Nat.irreducible_iff_nat_prime
@[aesop safe destruct] theorem not_prime_zero : Β¬Prime 0
| h => h.ne_zero rfl
#align nat.not_prime_zero Nat.not_prime_zero
@[aesop safe destruct] theorem not_prime_one : Β¬Prime 1
| h => h.ne_one rfl
#align nat.not_prime_one Nat.not_prime_one
theorem Prime.ne_zero {n : β} (h : Prime n) : n β 0 :=
Irreducible.ne_zero h
#align nat.prime.ne_zero Nat.Prime.ne_zero
theorem Prime.pos {p : β} (pp : Prime p) : 0 < p :=
Nat.pos_of_ne_zero pp.ne_zero
#align nat.prime.pos Nat.Prime.pos
theorem Prime.two_le : β {p : β}, Prime p β 2 β€ p
| 0, h => (not_prime_zero h).elim
| 1, h => (not_prime_one h).elim
| _ + 2, _ => le_add_self
#align nat.prime.two_le Nat.Prime.two_le
theorem Prime.one_lt {p : β} : Prime p β 1 < p :=
Prime.two_le
#align nat.prime.one_lt Nat.Prime.one_lt
lemma Prime.one_le {p : β} (hp : p.Prime) : 1 β€ p := hp.one_lt.le
instance Prime.one_lt' (p : β) [hp : Fact p.Prime] : Fact (1 < p) :=
β¨hp.1.one_ltβ©
#align nat.prime.one_lt' Nat.Prime.one_lt'
theorem Prime.ne_one {p : β} (hp : p.Prime) : p β 1 :=
hp.one_lt.ne'
#align nat.prime.ne_one Nat.Prime.ne_one
theorem Prime.eq_one_or_self_of_dvd {p : β} (pp : p.Prime) (m : β) (hm : m β£ p) :
m = 1 β¨ m = p := by
obtain β¨n, hnβ© := hm
have := pp.isUnit_or_isUnit hn
rw [Nat.isUnit_iff, Nat.isUnit_iff] at this
apply Or.imp_right _ this
rintro rfl
rw [hn, mul_one]
#align nat.prime.eq_one_or_self_of_dvd Nat.Prime.eq_one_or_self_of_dvd
theorem prime_def_lt'' {p : β} : Prime p β 2 β€ p β§ β m, m β£ p β m = 1 β¨ m = p := by
refine β¨fun h => β¨h.two_le, h.eq_one_or_self_of_dvdβ©, fun h => ?_β©
-- Porting note: needed to make β explicit
have h1 := (@one_lt_two β ..).trans_le h.1
refine β¨mt Nat.isUnit_iff.mp h1.ne', fun a b hab => ?_β©
simp only [Nat.isUnit_iff]
apply Or.imp_right _ (h.2 a _)
Β· rintro rfl
rw [β mul_right_inj' (pos_of_gt h1).ne', β hab, mul_one]
Β· rw [hab]
exact dvd_mul_right _ _
#align nat.prime_def_lt'' Nat.prime_def_lt''
theorem prime_def_lt {p : β} : Prime p β 2 β€ p β§ β m < p, m β£ p β m = 1 :=
prime_def_lt''.trans <|
and_congr_right fun p2 =>
forall_congr' fun _ =>
β¨fun h l d => (h d).resolve_right (ne_of_lt l), fun h d =>
(le_of_dvd (le_of_succ_le p2) d).lt_or_eq_dec.imp_left fun l => h l dβ©
#align nat.prime_def_lt Nat.prime_def_lt
theorem prime_def_lt' {p : β} : Prime p β 2 β€ p β§ β m, 2 β€ m β m < p β Β¬m β£ p :=
prime_def_lt.trans <|
and_congr_right fun p2 =>
forall_congr' fun m =>
β¨fun h m2 l d => not_lt_of_ge m2 ((h l d).symm βΈ by decide), fun h l d => by
rcases m with (_ | _ | m)
Β· rw [eq_zero_of_zero_dvd d] at p2
revert p2
decide
Β· rfl
Β· exact (h le_add_self l).elim dβ©
#align nat.prime_def_lt' Nat.prime_def_lt'
theorem prime_def_le_sqrt {p : β} : Prime p β 2 β€ p β§ β m, 2 β€ m β m β€ sqrt p β Β¬m β£ p :=
prime_def_lt'.trans <|
and_congr_right fun p2 =>
β¨fun a m m2 l => a m m2 <| lt_of_le_of_lt l <| sqrt_lt_self p2, fun a =>
have : β {m k : β}, m β€ k β 1 < m β p β m * k := fun {m k} mk m1 e =>
a m m1 (le_sqrt.2 (e.symm βΈ Nat.mul_le_mul_left m mk)) β¨k, eβ©
fun m m2 l β¨k, eβ© => by
rcases le_total m k with mk | km
Β· exact this mk m2 e
Β· rw [mul_comm] at e
refine this km (lt_of_mul_lt_mul_right ?_ (zero_le m)) e
rwa [one_mul, β e]β©
#align nat.prime_def_le_sqrt Nat.prime_def_le_sqrt
| Mathlib/Data/Nat/Prime.lean | 147 | 153 | theorem prime_of_coprime (n : β) (h1 : 1 < n) (h : β m < n, m β 0 β n.Coprime m) : Prime n := by
refine prime_def_lt.mpr β¨h1, fun m mlt mdvd => ?_β© |
refine prime_def_lt.mpr β¨h1, fun m mlt mdvd => ?_β©
have hm : m β 0 := by
rintro rfl
rw [zero_dvd_iff] at mdvd
exact mlt.ne' mdvd
exact (h m mlt hm).symm.eq_one_of_dvd mdvd
| true |
import Mathlib.Analysis.Analytic.Basic
import Mathlib.Analysis.Complex.Basic
import Mathlib.Analysis.Normed.Field.InfiniteSum
import Mathlib.Data.Nat.Choose.Cast
import Mathlib.Data.Finset.NoncommProd
import Mathlib.Topology.Algebra.Algebra
#align_import analysis.normed_space.exponential from "leanprover-community/mathlib"@"62748956a1ece9b26b33243e2e3a2852176666f5"
namespace NormedSpace
open Filter RCLike ContinuousMultilinearMap NormedField Asymptotics
open scoped Nat Topology ENNReal
section TopologicalAlgebra
variable (π πΈ : Type*) [Field π] [Ring πΈ] [Algebra π πΈ] [TopologicalSpace πΈ] [TopologicalRing πΈ]
def expSeries : FormalMultilinearSeries π πΈ πΈ := fun n =>
(n !β»ΒΉ : π) β’ ContinuousMultilinearMap.mkPiAlgebraFin π n πΈ
#align exp_series NormedSpace.expSeries
variable {πΈ}
noncomputable def exp (x : πΈ) : πΈ :=
(expSeries π πΈ).sum x
#align exp NormedSpace.exp
variable {π}
theorem expSeries_apply_eq (x : πΈ) (n : β) :
(expSeries π πΈ n fun _ => x) = (n !β»ΒΉ : π) β’ x ^ n := by simp [expSeries]
#align exp_series_apply_eq NormedSpace.expSeries_apply_eq
theorem expSeries_apply_eq' (x : πΈ) :
(fun n => expSeries π πΈ n fun _ => x) = fun n => (n !β»ΒΉ : π) β’ x ^ n :=
funext (expSeries_apply_eq x)
#align exp_series_apply_eq' NormedSpace.expSeries_apply_eq'
theorem expSeries_sum_eq (x : πΈ) : (expSeries π πΈ).sum x = β' n : β, (n !β»ΒΉ : π) β’ x ^ n :=
tsum_congr fun n => expSeries_apply_eq x n
#align exp_series_sum_eq NormedSpace.expSeries_sum_eq
theorem exp_eq_tsum : exp π = fun x : πΈ => β' n : β, (n !β»ΒΉ : π) β’ x ^ n :=
funext expSeries_sum_eq
#align exp_eq_tsum NormedSpace.exp_eq_tsum
theorem expSeries_apply_zero (n : β) :
(expSeries π πΈ n fun _ => (0 : πΈ)) = Pi.single (f := fun _ => πΈ) 0 1 n := by
rw [expSeries_apply_eq]
cases' n with n
Β· rw [pow_zero, Nat.factorial_zero, Nat.cast_one, inv_one, one_smul, Pi.single_eq_same]
Β· rw [zero_pow (Nat.succ_ne_zero _), smul_zero, Pi.single_eq_of_ne n.succ_ne_zero]
#align exp_series_apply_zero NormedSpace.expSeries_apply_zero
@[simp]
theorem exp_zero : exp π (0 : πΈ) = 1 := by
simp_rw [exp_eq_tsum, β expSeries_apply_eq, expSeries_apply_zero, tsum_pi_single]
#align exp_zero NormedSpace.exp_zero
@[simp]
theorem exp_op [T2Space πΈ] (x : πΈ) : exp π (MulOpposite.op x) = MulOpposite.op (exp π x) := by
simp_rw [exp, expSeries_sum_eq, β MulOpposite.op_pow, β MulOpposite.op_smul, tsum_op]
#align exp_op NormedSpace.exp_op
@[simp]
| Mathlib/Analysis/NormedSpace/Exponential.lean | 155 | 157 | theorem exp_unop [T2Space πΈ] (x : πΈα΅α΅α΅) :
exp π (MulOpposite.unop x) = MulOpposite.unop (exp π x) := by |
simp_rw [exp, expSeries_sum_eq, β MulOpposite.unop_pow, β MulOpposite.unop_smul, tsum_unop]
| true |
import Mathlib.LinearAlgebra.TensorProduct.Basic
import Mathlib.RingTheory.Finiteness
open scoped TensorProduct
open Submodule
variable {R M N : Type*}
variable [CommSemiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N]
variable {Mβ Mβ : Submodule R M} {Nβ Nβ : Submodule R N}
namespace TensorProduct
| Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean | 52 | 60 | theorem exists_multiset (x : M β[R] N) :
β S : Multiset (M Γ N), x = (S.map fun i β¦ i.1 ββ[R] i.2).sum := by
induction x using TensorProduct.induction_on with |
induction x using TensorProduct.induction_on with
| zero => exact β¨0, by simpβ©
| tmul x y => exact β¨{(x, y)}, by simpβ©
| add x y hx hy =>
obtain β¨Sx, hxβ© := hx
obtain β¨Sy, hyβ© := hy
exact β¨Sx + Sy, by rw [Multiset.map_add, Multiset.sum_add, hx, hy]β©
| true |
import Mathlib.Topology.Separation
open Topology Filter Set TopologicalSpace
section Basic
variable {Ξ± : Type*} [TopologicalSpace Ξ±] {C : Set Ξ±}
theorem AccPt.nhds_inter {x : Ξ±} {U : Set Ξ±} (h_acc : AccPt x (π C)) (hU : U β π x) :
AccPt x (π (U β© C)) := by
have : π[β ] x β€ π U := by
rw [le_principal_iff]
exact mem_nhdsWithin_of_mem_nhds hU
rw [AccPt, β inf_principal, β inf_assoc, inf_of_le_left this]
exact h_acc
#align acc_pt.nhds_inter AccPt.nhds_inter
def Preperfect (C : Set Ξ±) : Prop :=
β x β C, AccPt x (π C)
#align preperfect Preperfect
@[mk_iff perfect_def]
structure Perfect (C : Set Ξ±) : Prop where
closed : IsClosed C
acc : Preperfect C
#align perfect Perfect
theorem preperfect_iff_nhds : Preperfect C β β x β C, β U β π x, β y β U β© C, y β x := by
simp only [Preperfect, accPt_iff_nhds]
#align preperfect_iff_nhds preperfect_iff_nhds
section Preperfect
theorem Preperfect.open_inter {U : Set Ξ±} (hC : Preperfect C) (hU : IsOpen U) :
Preperfect (U β© C) := by
rintro x β¨xU, xCβ©
apply (hC _ xC).nhds_inter
exact hU.mem_nhds xU
#align preperfect.open_inter Preperfect.open_inter
theorem Preperfect.perfect_closure (hC : Preperfect C) : Perfect (closure C) := by
constructor; Β· exact isClosed_closure
intro x hx
by_cases h : x β C <;> apply AccPt.mono _ (principal_mono.mpr subset_closure)
Β· exact hC _ h
have : {x}αΆ β© C = C := by simp [h]
rw [AccPt, nhdsWithin, inf_assoc, inf_principal, this]
rw [closure_eq_cluster_pts] at hx
exact hx
#align preperfect.perfect_closure Preperfect.perfect_closure
| Mathlib/Topology/Perfect.lean | 132 | 144 | theorem preperfect_iff_perfect_closure [T1Space Ξ±] : Preperfect C β Perfect (closure C) := by
constructor <;> intro h |
constructor <;> intro h
Β· exact h.perfect_closure
intro x xC
have H : AccPt x (π (closure C)) := h.acc _ (subset_closure xC)
rw [accPt_iff_frequently] at *
have : β y, y β x β§ y β closure C β βαΆ z in π y, z β x β§ z β C := by
rintro y β¨hyx, yCβ©
simp only [β mem_compl_singleton_iff, and_comm, β frequently_nhdsWithin_iff,
hyx.nhdsWithin_compl_singleton, β mem_closure_iff_frequently]
exact yC
rw [β frequently_frequently_nhds]
exact H.mono this
| true |
import Mathlib.Algebra.Polynomial.Degree.Lemmas
open Polynomial
namespace Mathlib.Tactic.ComputeDegree
section recursion_lemmas
variable {R : Type*}
section semiring
variable [Semiring R]
theorem natDegree_C_le (a : R) : natDegree (C a) β€ 0 := (natDegree_C a).le
theorem natDegree_natCast_le (n : β) : natDegree (n : R[X]) β€ 0 := (natDegree_natCast _).le
theorem natDegree_zero_le : natDegree (0 : R[X]) β€ 0 := natDegree_zero.le
theorem natDegree_one_le : natDegree (1 : R[X]) β€ 0 := natDegree_one.le
@[deprecated (since := "2024-04-17")]
alias natDegree_nat_cast_le := natDegree_natCast_le
| Mathlib/Tactic/ComputeDegree.lean | 101 | 103 | theorem coeff_add_of_eq {n : β} {a b : R} {f g : R[X]}
(h_add_left : f.coeff n = a) (h_add_right : g.coeff n = b) :
(f + g).coeff n = a + b := by | subst βΉ_βΊ βΉ_βΊ; apply coeff_add
| true |
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.MeasureTheory.Constructions.Prod.Integral
open Fintype MeasureTheory MeasureTheory.Measure
variable {π : Type*} [RCLike π]
namespace MeasureTheory
theorem Integrable.fin_nat_prod {n : β} {E : Fin n β Type*}
[β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))]
{f : (i : Fin n) β E i β π} (hf : β i, Integrable (f i)) :
Integrable (fun (x : (i : Fin n) β E i) β¦ β i, f i (x i)) := by
induction n with
| zero => simp only [Nat.zero_eq, Finset.univ_eq_empty, Finset.prod_empty, volume_pi,
integrable_const_iff, one_ne_zero, pi_empty_univ, ENNReal.one_lt_top, or_true]
| succ n n_ih =>
have := ((measurePreserving_piFinSuccAbove (fun i => (volume : Measure (E i))) 0).symm)
rw [volume_pi, β this.integrable_comp_emb (MeasurableEquiv.measurableEmbedding _)]
simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply,
Fin.prod_univ_succ, Fin.insertNth_zero]
simp only [Fin.zero_succAbove, cast_eq, Function.comp_def, Fin.cons_zero, Fin.cons_succ]
have : Integrable (fun (x : (j : Fin n) β E (Fin.succ j)) β¦ β j, f (Fin.succ j) (x j)) :=
n_ih (fun i β¦ hf _)
exact Integrable.prod_mul (hf 0) this
theorem Integrable.fintype_prod_dep {ΞΉ : Type*} [Fintype ΞΉ] {E : ΞΉ β Type*}
{f : (i : ΞΉ) β E i β π} [β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))]
(hf : β i, Integrable (f i)) :
Integrable (fun (x : (i : ΞΉ) β E i) β¦ β i, f i (x i)) := by
let e := (equivFin ΞΉ).symm
simp_rw [β (volume_measurePreserving_piCongrLeft _ e).integrable_comp_emb
(MeasurableEquiv.measurableEmbedding _),
β e.prod_comp, MeasurableEquiv.coe_piCongrLeft, Function.comp_def,
Equiv.piCongrLeft_apply_apply]
exact .fin_nat_prod (fun i β¦ hf _)
theorem Integrable.fintype_prod {ΞΉ : Type*} [Fintype ΞΉ] {E : Type*}
{f : ΞΉ β E β π} [MeasureSpace E] [SigmaFinite (volume : Measure E)]
(hf : β i, Integrable (f i)) :
Integrable (fun (x : ΞΉ β E) β¦ β i, f i (x i)) :=
Integrable.fintype_prod_dep hf
theorem integral_fin_nat_prod_eq_prod {n : β} {E : Fin n β Type*}
[β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))]
(f : (i : Fin n) β E i β π) :
β« x : (i : Fin n) β E i, β i, f i (x i) = β i, β« x, f i x := by
induction n with
| zero =>
simp only [Nat.zero_eq, volume_pi, Finset.univ_eq_empty, Finset.prod_empty, integral_const,
pi_empty_univ, ENNReal.one_toReal, smul_eq_mul, mul_one, pow_zero, one_smul]
| succ n n_ih =>
calc
_ = β« x : E 0 Γ ((i : Fin n) β E (Fin.succ i)),
f 0 x.1 * β i : Fin n, f (Fin.succ i) (x.2 i) := by
rw [volume_pi, β ((measurePreserving_piFinSuccAbove
(fun i => (volume : Measure (E i))) 0).symm).integral_comp']
simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply,
Fin.prod_univ_succ, Fin.insertNth_zero, Fin.cons_succ, volume_eq_prod, volume_pi,
Fin.zero_succAbove, cast_eq, Fin.cons_zero]
_ = (β« x, f 0 x) * β i : Fin n, β« (x : E (Fin.succ i)), f (Fin.succ i) x := by
rw [β n_ih, β integral_prod_mul, volume_eq_prod]
_ = β i, β« x, f i x := by rw [Fin.prod_univ_succ]
theorem integral_fintype_prod_eq_prod (ΞΉ : Type*) [Fintype ΞΉ] {E : ΞΉ β Type*}
(f : (i : ΞΉ) β E i β π) [β i, MeasureSpace (E i)] [β i, SigmaFinite (volume : Measure (E i))] :
β« x : (i : ΞΉ) β E i, β i, f i (x i) = β i, β« x, f i x := by
let e := (equivFin ΞΉ).symm
rw [β (volume_measurePreserving_piCongrLeft _ e).integral_comp']
simp_rw [β e.prod_comp, MeasurableEquiv.coe_piCongrLeft, Equiv.piCongrLeft_apply_apply,
MeasureTheory.integral_fin_nat_prod_eq_prod]
| Mathlib/MeasureTheory/Integral/Pi.lean | 95 | 98 | theorem integral_fintype_prod_eq_pow {E : Type*} (ΞΉ : Type*) [Fintype ΞΉ] (f : E β π)
[MeasureSpace E] [SigmaFinite (volume : Measure E)] :
β« x : ΞΉ β E, β i, f (x i) = (β« x, f x) ^ (card ΞΉ) := by |
rw [integral_fintype_prod_eq_prod, Finset.prod_const, card]
| true |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.Deriv.Slope
import Mathlib.Analysis.NormedSpace.FiniteDimension
import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
#align_import analysis.calculus.fderiv_measurable from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
set_option linter.uppercaseLean3 false -- A B D
noncomputable section
open Set Metric Asymptotics Filter ContinuousLinearMap MeasureTheory TopologicalSpace
open scoped Topology
section fderiv
variable {π : Type*} [NontriviallyNormedField π]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
variable {f : E β F} (K : Set (E βL[π] F))
namespace FDerivMeasurableAux
def A (f : E β F) (L : E βL[π] F) (r Ξ΅ : β) : Set E :=
{ x | β r' β Ioc (r / 2) r, β y β ball x r', β z β ball x r', βf z - f y - L (z - y)β < Ξ΅ * r }
#align fderiv_measurable_aux.A FDerivMeasurableAux.A
def B (f : E β F) (K : Set (E βL[π] F)) (r s Ξ΅ : β) : Set E :=
β L β K, A f L r Ξ΅ β© A f L s Ξ΅
#align fderiv_measurable_aux.B FDerivMeasurableAux.B
def D (f : E β F) (K : Set (E βL[π] F)) : Set E :=
β e : β, β n : β, β (p β₯ n) (q β₯ n), B f K ((1 / 2) ^ p) ((1 / 2) ^ q) ((1 / 2) ^ e)
#align fderiv_measurable_aux.D FDerivMeasurableAux.D
theorem isOpen_A (L : E βL[π] F) (r Ξ΅ : β) : IsOpen (A f L r Ξ΅) := by
rw [Metric.isOpen_iff]
rintro x β¨r', r'_mem, hr'β©
obtain β¨s, s_gt, s_ltβ© : β s : β, r / 2 < s β§ s < r' := exists_between r'_mem.1
have : s β Ioc (r / 2) r := β¨s_gt, le_of_lt (s_lt.trans_le r'_mem.2)β©
refine β¨r' - s, by linarith, fun x' hx' => β¨s, this, ?_β©β©
have B : ball x' s β ball x r' := ball_subset (le_of_lt hx')
intro y hy z hz
exact hr' y (B hy) z (B hz)
#align fderiv_measurable_aux.is_open_A FDerivMeasurableAux.isOpen_A
| Mathlib/Analysis/Calculus/FDeriv/Measurable.lean | 144 | 145 | theorem isOpen_B {K : Set (E βL[π] F)} {r s Ξ΅ : β} : IsOpen (B f K r s Ξ΅) := by |
simp [B, isOpen_biUnion, IsOpen.inter, isOpen_A]
| true |
import Mathlib.Algebra.Polynomial.Degree.Definitions
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.Algebra.Polynomial.Monic
import Mathlib.Algebra.Polynomial.RingDivision
import Mathlib.Tactic.Abel
#align_import ring_theory.polynomial.pochhammer from "leanprover-community/mathlib"@"53b216bcc1146df1c4a0a86877890ea9f1f01589"
universe u v
open Polynomial
open Polynomial
section Ring
variable (R : Type u) [Ring R]
noncomputable def descPochhammer : β β R[X]
| 0 => 1
| n + 1 => X * (descPochhammer n).comp (X - 1)
@[simp]
theorem descPochhammer_zero : descPochhammer R 0 = 1 :=
rfl
@[simp]
theorem descPochhammer_one : descPochhammer R 1 = X := by simp [descPochhammer]
theorem descPochhammer_succ_left (n : β) :
descPochhammer R (n + 1) = X * (descPochhammer R n).comp (X - 1) := by
rw [descPochhammer]
theorem monic_descPochhammer (n : β) [Nontrivial R] [NoZeroDivisors R] :
Monic <| descPochhammer R n := by
induction' n with n hn
Β· simp
Β· have h : leadingCoeff (X - 1 : R[X]) = 1 := leadingCoeff_X_sub_C 1
have : natDegree (X - (1 : R[X])) β 0 := ne_zero_of_eq_one <| natDegree_X_sub_C (1 : R)
rw [descPochhammer_succ_left, Monic.def, leadingCoeff_mul, leadingCoeff_comp this, hn, monic_X,
one_mul, one_mul, h, one_pow]
section
variable {R} {T : Type v} [Ring T]
@[simp]
theorem descPochhammer_map (f : R β+* T) (n : β) :
(descPochhammer R n).map f = descPochhammer T n := by
induction' n with n ih
Β· simp
Β· simp [ih, descPochhammer_succ_left, map_comp]
end
@[simp, norm_cast]
theorem descPochhammer_eval_cast (n : β) (k : β€) :
(((descPochhammer β€ n).eval k : β€) : R) = ((descPochhammer R n).eval k : R) := by
rw [β descPochhammer_map (algebraMap β€ R), eval_map, β eq_intCast (algebraMap β€ R)]
simp only [algebraMap_int_eq, eq_intCast, evalβ_at_intCast, Nat.cast_id, eq_natCast, Int.cast_id]
theorem descPochhammer_eval_zero {n : β} :
(descPochhammer R n).eval 0 = if n = 0 then 1 else 0 := by
cases n
Β· simp
Β· simp [X_mul, Nat.succ_ne_zero, descPochhammer_succ_left]
theorem descPochhammer_zero_eval_zero : (descPochhammer R 0).eval 0 = 1 := by simp
@[simp]
theorem descPochhammer_ne_zero_eval_zero {n : β} (h : n β 0) : (descPochhammer R n).eval 0 = 0 := by
simp [descPochhammer_eval_zero, h]
theorem descPochhammer_succ_right (n : β) :
descPochhammer R (n + 1) = descPochhammer R n * (X - (n : R[X])) := by
suffices h : descPochhammer β€ (n + 1) = descPochhammer β€ n * (X - (n : β€[X])) by
apply_fun Polynomial.map (algebraMap β€ R) at h
simpa [descPochhammer_map, Polynomial.map_mul, Polynomial.map_add, map_X,
Polynomial.map_intCast] using h
induction' n with n ih
Β· simp [descPochhammer]
Β· conv_lhs =>
rw [descPochhammer_succ_left, ih, mul_comp, β mul_assoc, β descPochhammer_succ_left, sub_comp,
X_comp, natCast_comp]
rw [Nat.cast_add, Nat.cast_one, sub_add_eq_sub_sub_swap]
@[simp]
theorem descPochhammer_natDegree (n : β) [NoZeroDivisors R] [Nontrivial R] :
(descPochhammer R n).natDegree = n := by
induction' n with n hn
Β· simp
Β· have : natDegree (X - (n : R[X])) = 1 := natDegree_X_sub_C (n : R)
rw [descPochhammer_succ_right,
natDegree_mul _ (ne_zero_of_natDegree_gt <| this.symm βΈ Nat.zero_lt_one), hn, this]
cases n
Β· simp
Β· refine ne_zero_of_natDegree_gt <| hn.symm βΈ Nat.add_one_pos _
| Mathlib/RingTheory/Polynomial/Pochhammer.lean | 326 | 329 | theorem descPochhammer_succ_eval {S : Type*} [Ring S] (n : β) (k : S) :
(descPochhammer S (n + 1)).eval k = (descPochhammer S n).eval k * (k - n) := by
rw [descPochhammer_succ_right, mul_sub, eval_sub, eval_mul_X, β Nat.cast_comm, β C_eq_natCast, |
rw [descPochhammer_succ_right, mul_sub, eval_sub, eval_mul_X, β Nat.cast_comm, β C_eq_natCast,
eval_C_mul, Nat.cast_comm, β mul_sub]
| true |
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Finset.Card
import Mathlib.Data.List.NodupEquivFin
import Mathlib.Data.Set.Image
#align_import data.fintype.card from "leanprover-community/mathlib"@"bf2428c9486c407ca38b5b3fb10b87dad0bc99fa"
assert_not_exists MonoidWithZero
assert_not_exists MulAction
open Function
open Nat
universe u v
variable {Ξ± Ξ² Ξ³ : Type*}
open Finset Function
namespace Fintype
def card (Ξ±) [Fintype Ξ±] : β :=
(@univ Ξ± _).card
#align fintype.card Fintype.card
def truncEquivFin (Ξ±) [DecidableEq Ξ±] [Fintype Ξ±] : Trunc (Ξ± β Fin (card Ξ±)) := by
unfold card Finset.card
exact
Quot.recOnSubsingleton'
(motive := fun s : Multiset Ξ± =>
(β x : Ξ±, x β s) β s.Nodup β Trunc (Ξ± β Fin (Multiset.card s)))
univ.val
(fun l (h : β x : Ξ±, x β l) (nd : l.Nodup) => Trunc.mk (nd.getEquivOfForallMemList _ h).symm)
mem_univ_val univ.2
#align fintype.trunc_equiv_fin Fintype.truncEquivFin
noncomputable def equivFin (Ξ±) [Fintype Ξ±] : Ξ± β Fin (card Ξ±) :=
letI := Classical.decEq Ξ±
(truncEquivFin Ξ±).out
#align fintype.equiv_fin Fintype.equivFin
def truncFinBijection (Ξ±) [Fintype Ξ±] : Trunc { f : Fin (card Ξ±) β Ξ± // Bijective f } := by
unfold card Finset.card
refine
Quot.recOnSubsingleton'
(motive := fun s : Multiset Ξ± =>
(β x : Ξ±, x β s) β s.Nodup β Trunc {f : Fin (Multiset.card s) β Ξ± // Bijective f})
univ.val
(fun l (h : β x : Ξ±, x β l) (nd : l.Nodup) => Trunc.mk (nd.getBijectionOfForallMemList _ h))
mem_univ_val univ.2
#align fintype.trunc_fin_bijection Fintype.truncFinBijection
theorem subtype_card {p : Ξ± β Prop} (s : Finset Ξ±) (H : β x : Ξ±, x β s β p x) :
@card { x // p x } (Fintype.subtype s H) = s.card :=
Multiset.card_pmap _ _ _
#align fintype.subtype_card Fintype.subtype_card
| Mathlib/Data/Fintype/Card.lean | 126 | 130 | theorem card_of_subtype {p : Ξ± β Prop} (s : Finset Ξ±) (H : β x : Ξ±, x β s β p x)
[Fintype { x // p x }] : card { x // p x } = s.card := by
rw [β subtype_card s H] |
rw [β subtype_card s H]
congr
apply Subsingleton.elim
| true |
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic
import Mathlib.NumberTheory.GaussSum
#align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9"
section SpecialValues
open ZMod MulChar
variable {F : Type*} [Field F] [Fintype F]
theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β 2) :
quadraticChar F 2 = Οβ (Fintype.card F) :=
IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Οβ hF
((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF))
#align quadratic_char_two quadraticChar_two
theorem FiniteField.isSquare_two_iff :
IsSquare (2 : F) β Fintype.card F % 8 β 3 β§ Fintype.card F % 8 β 5 := by
classical
by_cases hF : ringChar F = 2
focus
have h := FiniteField.even_card_of_char_two hF
simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff]
rotate_left
focus
have h := FiniteField.odd_card_of_char_ne_two hF
rw [β quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF,
Οβ_nat_eq_if_mod_eight]
simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β€) β 1),
imp_false, Classical.not_not]
all_goals
rw [β Nat.mod_mod_of_dvd _ (by decide : 2 β£ 8)] at h
have hβ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8)
revert hβ h
generalize Fintype.card F % 8 = n
intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!`
#align finite_field.is_square_two_iff FiniteField.isSquare_two_iff
theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β 2) :
quadraticChar F (-2) = Οβ' (Fintype.card F) := by
rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Οβ'_eq_Οβ_mul_Οβ, quadraticChar_neg_one hF,
quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 β£ 8)]
#align quadratic_char_neg_two quadraticChar_neg_two
theorem FiniteField.isSquare_neg_two_iff :
IsSquare (-2 : F) β Fintype.card F % 8 β 5 β§ Fintype.card F % 8 β 7 := by
classical
by_cases hF : ringChar F = 2
focus
have h := FiniteField.even_card_of_char_two hF
simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff]
rotate_left
focus
have h := FiniteField.odd_card_of_char_ne_two hF
rw [β quadraticChar_one_iff_isSquare (neg_ne_zero.mpr (Ring.two_ne_zero hF)),
quadraticChar_neg_two hF, Οβ'_nat_eq_if_mod_eight]
simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β€) β 1),
imp_false, Classical.not_not]
all_goals
rw [β Nat.mod_mod_of_dvd _ (by decide : 2 β£ 8)] at h
have hβ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8)
revert hβ h
generalize Fintype.card F % 8 = n
intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!`
#align finite_field.is_square_neg_two_iff FiniteField.isSquare_neg_two_iff
theorem quadraticChar_card_card [DecidableEq F] (hF : ringChar F β 2) {F' : Type*} [Field F']
[Fintype F'] [DecidableEq F'] (hF' : ringChar F' β 2) (h : ringChar F' β ringChar F) :
quadraticChar F (Fintype.card F') =
quadraticChar F' (quadraticChar F (-1) * Fintype.card F) := by
let Ο := (quadraticChar F).ringHomComp (algebraMap β€ F')
have hΟβ : Ο.IsNontrivial := by
obtain β¨a, haβ© := quadraticChar_exists_neg_one hF
have hu : IsUnit a := by
contrapose ha
exact ne_of_eq_of_ne (map_nonunit (quadraticChar F) ha) (mt zero_eq_neg.mp one_ne_zero)
use hu.unit
simp only [Ο, IsUnit.unit_spec, ringHomComp_apply, eq_intCast, Ne, ha]
rw [Int.cast_neg, Int.cast_one]
exact Ring.neg_one_ne_one_of_char_ne_two hF'
have hΟβ : Ο.IsQuadratic := IsQuadratic.comp (quadraticChar_isQuadratic F) _
have h := Char.card_pow_card hΟβ hΟβ h hF'
rw [β quadraticChar_eq_pow_of_char_ne_two' hF'] at h
exact (IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F')
(quadraticChar_isQuadratic F) hF' h).symm
#align quadratic_char_card_card quadraticChar_card_card
| Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean | 119 | 125 | theorem quadraticChar_odd_prime [DecidableEq F] (hF : ringChar F β 2) {p : β} [Fact p.Prime]
(hpβ : p β 2) (hpβ : ringChar F β p) :
quadraticChar F p = quadraticChar (ZMod p) (Οβ (Fintype.card F) * Fintype.card F) := by
rw [β quadraticChar_neg_one hF] |
rw [β quadraticChar_neg_one hF]
have h := quadraticChar_card_card hF (ne_of_eq_of_ne (ringChar_zmod_n p) hpβ)
(ne_of_eq_of_ne (ringChar_zmod_n p) hpβ.symm)
rwa [card p] at h
| true |
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.Topology.MetricSpace.ThickenedIndicator
open MeasureTheory Topology Metric Filter Set ENNReal NNReal
open scoped Topology ENNReal NNReal BoundedContinuousFunction
section auxiliary
namespace MeasureTheory
variable {Ξ© : Type*} [TopologicalSpace Ξ©] [MeasurableSpace Ξ©] [OpensMeasurableSpace Ξ©]
theorem tendsto_lintegral_nn_filter_of_le_const {ΞΉ : Type*} {L : Filter ΞΉ} [L.IsCountablyGenerated]
(ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] {fs : ΞΉ β Ξ© βα΅ ββ₯0} {c : ββ₯0}
(fs_le_const : βαΆ i in L, βα΅ Ο : Ξ© βΞΌ, fs i Ο β€ c) {f : Ξ© β ββ₯0}
(fs_lim : βα΅ Ο : Ξ© βΞΌ, Tendsto (fun i β¦ fs i Ο) L (π (f Ο))) :
Tendsto (fun i β¦ β«β» Ο, fs i Ο βΞΌ) L (π (β«β» Ο, f Ο βΞΌ)) := by
refine tendsto_lintegral_filter_of_dominated_convergence (fun _ β¦ c)
(eventually_of_forall fun i β¦ (ENNReal.continuous_coe.comp (fs i).continuous).measurable) ?_
(@lintegral_const_lt_top _ _ ΞΌ _ _ (@ENNReal.coe_ne_top c)).ne ?_
Β· simpa only [Function.comp_apply, ENNReal.coe_le_coe] using fs_le_const
Β· simpa only [Function.comp_apply, ENNReal.tendsto_coe] using fs_lim
#align measure_theory.finite_measure.tendsto_lintegral_nn_filter_of_le_const MeasureTheory.tendsto_lintegral_nn_filter_of_le_const
theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ΞΉ : Type*} {L : Filter ΞΉ}
[L.IsCountablyGenerated] [TopologicalSpace Ξ©] [OpensMeasurableSpace Ξ©] (ΞΌ : Measure Ξ©)
[IsFiniteMeasure ΞΌ] {c : ββ₯0} {E : Set Ξ©} (E_mble : MeasurableSet E) (fs : ΞΉ β Ξ© βα΅ ββ₯0)
(fs_bdd : βαΆ i in L, βα΅ Ο : Ξ© βΞΌ, fs i Ο β€ c)
(fs_lim : βα΅ Ο βΞΌ, Tendsto (fun i β¦ fs i Ο) L (π (indicator E (fun _ β¦ (1 : ββ₯0)) Ο))) :
Tendsto (fun n β¦ lintegral ΞΌ fun Ο β¦ fs n Ο) L (π (ΞΌ E)) := by
convert tendsto_lintegral_nn_filter_of_le_const ΞΌ fs_bdd fs_lim
have aux : β Ο, indicator E (fun _ β¦ (1 : ββ₯0β)) Ο = β(indicator E (fun _ β¦ (1 : ββ₯0)) Ο) :=
fun Ο β¦ by simp only [ENNReal.coe_indicator, ENNReal.coe_one]
simp_rw [β aux, lintegral_indicator _ E_mble]
simp only [lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter]
#align measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator
| Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean | 95 | 105 | theorem measure_of_cont_bdd_of_tendsto_indicator [OpensMeasurableSpace Ξ©]
(ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] {c : ββ₯0} {E : Set Ξ©} (E_mble : MeasurableSet E)
(fs : β β Ξ© βα΅ ββ₯0) (fs_bdd : β n Ο, fs n Ο β€ c)
(fs_lim : Tendsto (fun n Ο β¦ fs n Ο) atTop (π (indicator E fun _ β¦ (1 : ββ₯0)))) :
Tendsto (fun n β¦ lintegral ΞΌ fun Ο β¦ fs n Ο) atTop (π (ΞΌ E)) := by
have fs_lim' : |
have fs_lim' :
β Ο, Tendsto (fun n : β β¦ (fs n Ο : ββ₯0)) atTop (π (indicator E (fun _ β¦ (1 : ββ₯0)) Ο)) := by
rw [tendsto_pi_nhds] at fs_lim
exact fun Ο β¦ fs_lim Ο
apply measure_of_cont_bdd_of_tendsto_filter_indicator ΞΌ E_mble fs
(eventually_of_forall fun n β¦ eventually_of_forall (fs_bdd n)) (eventually_of_forall fs_lim')
| true |
import Mathlib.Order.Interval.Finset.Nat
import Mathlib.Data.PNat.Defs
#align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
open Finset Function PNat
namespace PNat
variable (a b : β+)
instance instLocallyFiniteOrder : LocallyFiniteOrder β+ := Subtype.instLocallyFiniteOrder _
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ico_eq_finset_subtype PNat.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ioc_eq_finset_subtype PNat.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β) b).subtype fun n : β => 0 < n :=
rfl
#align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β) b).subtype fun n : β => 0 < n := rfl
#align pnat.uIcc_eq_finset_subtype PNat.uIcc_eq_finset_subtype
theorem map_subtype_embedding_Icc : (Icc a b).map (Embedding.subtype _) = Icc βa βb :=
Finset.map_subtype_embedding_Icc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc
theorem map_subtype_embedding_Ico : (Ico a b).map (Embedding.subtype _) = Ico βa βb :=
Finset.map_subtype_embedding_Ico _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico
theorem map_subtype_embedding_Ioc : (Ioc a b).map (Embedding.subtype _) = Ioc βa βb :=
Finset.map_subtype_embedding_Ioc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc
theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo βa βb :=
Finset.map_subtype_embedding_Ioo _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
#align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc βa βb :=
map_subtype_embedding_Icc _ _
#align pnat.map_subtype_embedding_uIcc PNat.map_subtype_embedding_uIcc
@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a := by
rw [β Nat.card_Icc]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Icc PNat.card_Icc
@[simp]
theorem card_Ico : (Ico a b).card = b - a := by
rw [β Nat.card_Ico]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Ico PNat.card_Ico
@[simp]
theorem card_Ioc : (Ioc a b).card = b - a := by
rw [β Nat.card_Ioc]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
#align pnat.card_Ioc PNat.card_Ioc
@[simp]
| Mathlib/Data/PNat/Interval.lean | 94 | 99 | theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
rw [β Nat.card_Ioo] |
rw [β Nat.card_Ioo]
-- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
-- https://github.com/leanprover-community/mathlib4/issues/5164
erw [β Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
rw [card_map]
| true |
import Mathlib.RepresentationTheory.Action.Limits
import Mathlib.RepresentationTheory.Action.Concrete
import Mathlib.CategoryTheory.Monoidal.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Transport
import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence
import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Linear
import Mathlib.CategoryTheory.Monoidal.Braided.Basic
import Mathlib.CategoryTheory.Monoidal.Types.Basic
universe u v
open CategoryTheory Limits
variable {V : Type (u + 1)} [LargeCategory V] {G : MonCat.{u}}
namespace Action
section Monoidal
open MonoidalCategory
variable [MonoidalCategory V]
instance instMonoidalCategory : MonoidalCategory (Action V G) :=
Monoidal.transport (Action.functorCategoryEquivalence _ _).symm
@[simp]
theorem tensorUnit_v : (π_ (Action V G)).V = π_ V :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_unit_V Action.tensorUnit_v
-- Porting note: removed @[simp] as the simpNF linter complains
theorem tensorUnit_rho {g : G} : (π_ (Action V G)).Ο g = π (π_ V) :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_unit_rho Action.tensorUnit_rho
@[simp]
theorem tensor_v {X Y : Action V G} : (X β Y).V = X.V β Y.V :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_V Action.tensor_v
-- Porting note: removed @[simp] as the simpNF linter complains
theorem tensor_rho {X Y : Action V G} {g : G} : (X β Y).Ο g = X.Ο g β Y.Ο g :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_rho Action.tensor_rho
@[simp]
theorem tensor_hom {W X Y Z : Action V G} (f : W βΆ X) (g : Y βΆ Z) : (f β g).hom = f.hom β g.hom :=
rfl
set_option linter.uppercaseLean3 false in
#align Action.tensor_hom Action.tensor_hom
@[simp]
theorem whiskerLeft_hom (X : Action V G) {Y Z : Action V G} (f : Y βΆ Z) :
(X β f).hom = X.V β f.hom :=
rfl
@[simp]
theorem whiskerRight_hom {X Y : Action V G} (f : X βΆ Y) (Z : Action V G) :
(f β· Z).hom = f.hom β· Z.V :=
rfl
-- Porting note: removed @[simp] as the simpNF linter complains
| Mathlib/RepresentationTheory/Action/Monoidal.lean | 82 | 85 | theorem associator_hom_hom {X Y Z : Action V G} :
Hom.hom (Ξ±_ X Y Z).hom = (Ξ±_ X.V Y.V Z.V).hom := by
dsimp |
dsimp
simp
| true |
import Mathlib.Data.Bundle
import Mathlib.Data.Set.Image
import Mathlib.Topology.PartialHomeomorph
import Mathlib.Topology.Order.Basic
#align_import topology.fiber_bundle.trivialization from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833"
open TopologicalSpace Filter Set Bundle Function
open scoped Topology Classical Bundle
variable {ΞΉ : Type*} {B : Type*} {F : Type*} {E : B β Type*}
variable (F) {Z : Type*} [TopologicalSpace B] [TopologicalSpace F] {proj : Z β B}
structure Pretrivialization (proj : Z β B) extends PartialEquiv Z (B Γ F) where
open_target : IsOpen target
baseSet : Set B
open_baseSet : IsOpen baseSet
source_eq : source = proj β»ΒΉ' baseSet
target_eq : target = baseSet ΓΛ’ univ
proj_toFun : β p β source, (toFun p).1 = proj p
#align pretrivialization Pretrivialization
namespace Pretrivialization
variable {F}
variable (e : Pretrivialization F proj) {x : Z}
@[coe] def toFun' : Z β (B Γ F) := e.toFun
instance : CoeFun (Pretrivialization F proj) fun _ => Z β B Γ F := β¨toFun'β©
@[ext]
lemma ext' (e e' : Pretrivialization F proj) (hβ : e.toPartialEquiv = e'.toPartialEquiv)
(hβ : e.baseSet = e'.baseSet) : e = e' := by
cases e; cases e'; congr
#align pretrivialization.ext Pretrivialization.ext'
-- Porting note (#11215): TODO: move `ext` here?
lemma ext {e e' : Pretrivialization F proj} (hβ : β x, e x = e' x)
(hβ : β x, e.toPartialEquiv.symm x = e'.toPartialEquiv.symm x) (hβ : e.baseSet = e'.baseSet) :
e = e' := by
ext1 <;> [ext1; exact hβ]
Β· apply hβ
Β· apply hβ
Β· rw [e.source_eq, e'.source_eq, hβ]
lemma toPartialEquiv_injective [Nonempty F] :
Injective (toPartialEquiv : Pretrivialization F proj β PartialEquiv Z (B Γ F)) := by
refine fun e e' h β¦ ext' _ _ h ?_
simpa only [fst_image_prod, univ_nonempty, target_eq]
using congr_arg (Prod.fst '' PartialEquiv.target Β·) h
@[simp, mfld_simps]
theorem coe_coe : βe.toPartialEquiv = e :=
rfl
#align pretrivialization.coe_coe Pretrivialization.coe_coe
@[simp, mfld_simps]
theorem coe_fst (ex : x β e.source) : (e x).1 = proj x :=
e.proj_toFun x ex
#align pretrivialization.coe_fst Pretrivialization.coe_fst
theorem mem_source : x β e.source β proj x β e.baseSet := by rw [e.source_eq, mem_preimage]
#align pretrivialization.mem_source Pretrivialization.mem_source
theorem coe_fst' (ex : proj x β e.baseSet) : (e x).1 = proj x :=
e.coe_fst (e.mem_source.2 ex)
#align pretrivialization.coe_fst' Pretrivialization.coe_fst'
protected theorem eqOn : EqOn (Prod.fst β e) proj e.source := fun _ hx => e.coe_fst hx
#align pretrivialization.eq_on Pretrivialization.eqOn
theorem mk_proj_snd (ex : x β e.source) : (proj x, (e x).2) = e x :=
Prod.ext (e.coe_fst ex).symm rfl
#align pretrivialization.mk_proj_snd Pretrivialization.mk_proj_snd
theorem mk_proj_snd' (ex : proj x β e.baseSet) : (proj x, (e x).2) = e x :=
Prod.ext (e.coe_fst' ex).symm rfl
#align pretrivialization.mk_proj_snd' Pretrivialization.mk_proj_snd'
def setSymm : e.target β Z :=
e.target.restrict e.toPartialEquiv.symm
#align pretrivialization.set_symm Pretrivialization.setSymm
| Mathlib/Topology/FiberBundle/Trivialization.lean | 141 | 142 | theorem mem_target {x : B Γ F} : x β e.target β x.1 β e.baseSet := by |
rw [e.target_eq, prod_univ, mem_preimage]
| true |
import Mathlib.Algebra.Polynomial.Splits
#align_import algebra.cubic_discriminant from "leanprover-community/mathlib"@"930133160e24036d5242039fe4972407cd4f1222"
noncomputable section
@[ext]
structure Cubic (R : Type*) where
(a b c d : R)
#align cubic Cubic
namespace Cubic
open Cubic Polynomial
open Polynomial
variable {R S F K : Type*}
instance [Inhabited R] : Inhabited (Cubic R) :=
β¨β¨default, default, default, defaultβ©β©
instance [Zero R] : Zero (Cubic R) :=
β¨β¨0, 0, 0, 0β©β©
section Basic
variable {P Q : Cubic R} {a b c d a' b' c' d' : R} [Semiring R]
def toPoly (P : Cubic R) : R[X] :=
C P.a * X ^ 3 + C P.b * X ^ 2 + C P.c * X + C P.d
#align cubic.to_poly Cubic.toPoly
theorem C_mul_prod_X_sub_C_eq [CommRing S] {w x y z : S} :
C w * (X - C x) * (X - C y) * (X - C z) =
toPoly β¨w, w * -(x + y + z), w * (x * y + x * z + y * z), w * -(x * y * z)β© := by
simp only [toPoly, C_neg, C_add, C_mul]
ring1
set_option linter.uppercaseLean3 false in
#align cubic.C_mul_prod_X_sub_C_eq Cubic.C_mul_prod_X_sub_C_eq
theorem prod_X_sub_C_eq [CommRing S] {x y z : S} :
(X - C x) * (X - C y) * (X - C z) =
toPoly β¨1, -(x + y + z), x * y + x * z + y * z, -(x * y * z)β© := by
rw [β one_mul <| X - C x, β C_1, C_mul_prod_X_sub_C_eq, one_mul, one_mul, one_mul]
set_option linter.uppercaseLean3 false in
#align cubic.prod_X_sub_C_eq Cubic.prod_X_sub_C_eq
section Map
variable [Semiring S] {Ο : R β+* S}
def map (Ο : R β+* S) (P : Cubic R) : Cubic S :=
β¨Ο P.a, Ο P.b, Ο P.c, Ο P.dβ©
#align cubic.map Cubic.map
| Mathlib/Algebra/CubicDiscriminant.lean | 458 | 459 | theorem map_toPoly : (map Ο P).toPoly = Polynomial.map Ο P.toPoly := by |
simp only [map, toPoly, map_C, map_X, Polynomial.map_add, Polynomial.map_mul, Polynomial.map_pow]
| true |
import Mathlib.Algebra.Algebra.Spectrum
import Mathlib.LinearAlgebra.GeneralLinearGroup
import Mathlib.LinearAlgebra.FiniteDimensional
import Mathlib.RingTheory.Nilpotent.Basic
#align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
universe u v w
namespace Module
namespace End
open FiniteDimensional Set
variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K]
[AddCommGroup V] [Module K V]
def eigenspace (f : End R M) (ΞΌ : R) : Submodule R M :=
LinearMap.ker (f - algebraMap R (End R M) ΞΌ)
#align module.End.eigenspace Module.End.eigenspace
@[simp]
| Mathlib/LinearAlgebra/Eigenspace/Basic.lean | 69 | 69 | theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by | simp [eigenspace]
| true |
import Mathlib.Algebra.Polynomial.Monic
#align_import algebra.polynomial.big_operators from "leanprover-community/mathlib"@"47adfab39a11a072db552f47594bf8ed2cf8a722"
open Finset
open Multiset
open Polynomial
universe u w
variable {R : Type u} {ΞΉ : Type w}
namespace Polynomial
variable (s : Finset ΞΉ)
section Semiring
variable {S : Type*} [Semiring S]
set_option backward.isDefEq.lazyProjDelta false in -- See https://github.com/leanprover-community/mathlib4/issues/12535
theorem natDegree_list_sum_le (l : List S[X]) : natDegree l.sum β€ (l.map natDegree).foldr max 0 :=
List.sum_le_foldr_max natDegree (by simp) natDegree_add_le _
#align polynomial.nat_degree_list_sum_le Polynomial.natDegree_list_sum_le
theorem natDegree_multiset_sum_le (l : Multiset S[X]) :
natDegree l.sum β€ (l.map natDegree).foldr max max_left_comm 0 :=
Quotient.inductionOn l (by simpa using natDegree_list_sum_le)
#align polynomial.nat_degree_multiset_sum_le Polynomial.natDegree_multiset_sum_le
theorem natDegree_sum_le (f : ΞΉ β S[X]) :
natDegree (β i β s, f i) β€ s.fold max 0 (natDegree β f) := by
simpa using natDegree_multiset_sum_le (s.val.map f)
#align polynomial.nat_degree_sum_le Polynomial.natDegree_sum_le
lemma natDegree_sum_le_of_forall_le {n : β} (f : ΞΉ β S[X]) (h : β i β s, natDegree (f i) β€ n) :
natDegree (β i β s, f i) β€ n :=
le_trans (natDegree_sum_le s f) <| (Finset.fold_max_le n).mpr <| by simpa
theorem degree_list_sum_le (l : List S[X]) : degree l.sum β€ (l.map natDegree).maximum := by
by_cases h : l.sum = 0
Β· simp [h]
Β· rw [degree_eq_natDegree h]
suffices (l.map natDegree).maximum = ((l.map natDegree).foldr max 0 : β) by
rw [this]
simpa using natDegree_list_sum_le l
rw [β List.foldr_max_of_ne_nil]
Β· congr
contrapose! h
rw [List.map_eq_nil] at h
simp [h]
#align polynomial.degree_list_sum_le Polynomial.degree_list_sum_le
theorem natDegree_list_prod_le (l : List S[X]) : natDegree l.prod β€ (l.map natDegree).sum := by
induction' l with hd tl IH
Β· simp
Β· simpa using natDegree_mul_le.trans (add_le_add_left IH _)
#align polynomial.nat_degree_list_prod_le Polynomial.natDegree_list_prod_le
theorem degree_list_prod_le (l : List S[X]) : degree l.prod β€ (l.map degree).sum := by
induction' l with hd tl IH
Β· simp
Β· simpa using (degree_mul_le _ _).trans (add_le_add_left IH _)
#align polynomial.degree_list_prod_le Polynomial.degree_list_prod_le
| Mathlib/Algebra/Polynomial/BigOperators.lean | 92 | 111 | theorem coeff_list_prod_of_natDegree_le (l : List S[X]) (n : β) (hl : β p β l, natDegree p β€ n) :
coeff (List.prod l) (l.length * n) = (l.map fun p => coeff p n).prod := by
induction' l with hd tl IH |
induction' l with hd tl IH
Β· simp
Β· have hl' : β p β tl, natDegree p β€ n := fun p hp => hl p (List.mem_cons_of_mem _ hp)
simp only [List.prod_cons, List.map, List.length]
rw [add_mul, one_mul, add_comm, β IH hl', mul_comm tl.length]
have h : natDegree tl.prod β€ n * tl.length := by
refine (natDegree_list_prod_le _).trans ?_
rw [β tl.length_map natDegree, mul_comm]
refine List.sum_le_card_nsmul _ _ ?_
simpa using hl'
have hdn : natDegree hd β€ n := hl _ (List.mem_cons_self _ _)
rcases hdn.eq_or_lt with (rfl | hdn')
Β· rcases h.eq_or_lt with h' | h'
Β· rw [β h', coeff_mul_degree_add_degree, leadingCoeff, leadingCoeff]
Β· rw [coeff_eq_zero_of_natDegree_lt, coeff_eq_zero_of_natDegree_lt h', mul_zero]
exact natDegree_mul_le.trans_lt (add_lt_add_left h' _)
Β· rw [coeff_eq_zero_of_natDegree_lt hdn', coeff_eq_zero_of_natDegree_lt, zero_mul]
exact natDegree_mul_le.trans_lt (add_lt_add_of_lt_of_le hdn' h)
| true |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Set.Subsingleton
#align_import combinatorics.composition from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
open List
variable {n : β}
@[ext]
structure Composition (n : β) where
blocks : List β
blocks_pos : β {i}, i β blocks β 0 < i
blocks_sum : blocks.sum = n
#align composition Composition
@[ext]
structure CompositionAsSet (n : β) where
boundaries : Finset (Fin n.succ)
zero_mem : (0 : Fin n.succ) β boundaries
getLast_mem : Fin.last n β boundaries
#align composition_as_set CompositionAsSet
instance {n : β} : Inhabited (CompositionAsSet n) :=
β¨β¨Finset.univ, Finset.mem_univ _, Finset.mem_univ _β©β©
namespace Composition
variable (c : Composition n)
instance (n : β) : ToString (Composition n) :=
β¨fun c => toString c.blocksβ©
abbrev length : β :=
c.blocks.length
#align composition.length Composition.length
theorem blocks_length : c.blocks.length = c.length :=
rfl
#align composition.blocks_length Composition.blocks_length
def blocksFun : Fin c.length β β := c.blocks.get
#align composition.blocks_fun Composition.blocksFun
theorem ofFn_blocksFun : ofFn c.blocksFun = c.blocks :=
ofFn_get _
#align composition.of_fn_blocks_fun Composition.ofFn_blocksFun
theorem sum_blocksFun : β i, c.blocksFun i = n := by
conv_rhs => rw [β c.blocks_sum, β ofFn_blocksFun, sum_ofFn]
#align composition.sum_blocks_fun Composition.sum_blocksFun
theorem blocksFun_mem_blocks (i : Fin c.length) : c.blocksFun i β c.blocks :=
get_mem _ _ _
#align composition.blocks_fun_mem_blocks Composition.blocksFun_mem_blocks
@[simp]
theorem one_le_blocks {i : β} (h : i β c.blocks) : 1 β€ i :=
c.blocks_pos h
#align composition.one_le_blocks Composition.one_le_blocks
@[simp]
theorem one_le_blocks' {i : β} (h : i < c.length) : 1 β€ c.blocks.get β¨i, hβ© :=
c.one_le_blocks (get_mem (blocks c) i h)
#align composition.one_le_blocks' Composition.one_le_blocks'
@[simp]
theorem blocks_pos' (i : β) (h : i < c.length) : 0 < c.blocks.get β¨i, hβ© :=
c.one_le_blocks' h
#align composition.blocks_pos' Composition.blocks_pos'
theorem one_le_blocksFun (i : Fin c.length) : 1 β€ c.blocksFun i :=
c.one_le_blocks (c.blocksFun_mem_blocks i)
#align composition.one_le_blocks_fun Composition.one_le_blocksFun
theorem length_le : c.length β€ n := by
conv_rhs => rw [β c.blocks_sum]
exact length_le_sum_of_one_le _ fun i hi => c.one_le_blocks hi
#align composition.length_le Composition.length_le
theorem length_pos_of_pos (h : 0 < n) : 0 < c.length := by
apply length_pos_of_sum_pos
convert h
exact c.blocks_sum
#align composition.length_pos_of_pos Composition.length_pos_of_pos
def sizeUpTo (i : β) : β :=
(c.blocks.take i).sum
#align composition.size_up_to Composition.sizeUpTo
@[simp]
theorem sizeUpTo_zero : c.sizeUpTo 0 = 0 := by simp [sizeUpTo]
#align composition.size_up_to_zero Composition.sizeUpTo_zero
theorem sizeUpTo_ofLength_le (i : β) (h : c.length β€ i) : c.sizeUpTo i = n := by
dsimp [sizeUpTo]
convert c.blocks_sum
exact take_all_of_le h
#align composition.size_up_to_of_length_le Composition.sizeUpTo_ofLength_le
@[simp]
theorem sizeUpTo_length : c.sizeUpTo c.length = n :=
c.sizeUpTo_ofLength_le c.length le_rfl
#align composition.size_up_to_length Composition.sizeUpTo_length
theorem sizeUpTo_le (i : β) : c.sizeUpTo i β€ n := by
conv_rhs => rw [β c.blocks_sum, β sum_take_add_sum_drop _ i]
exact Nat.le_add_right _ _
#align composition.size_up_to_le Composition.sizeUpTo_le
theorem sizeUpTo_succ {i : β} (h : i < c.length) :
c.sizeUpTo (i + 1) = c.sizeUpTo i + c.blocks.get β¨i, hβ© := by
simp only [sizeUpTo]
rw [sum_take_succ _ _ h]
#align composition.size_up_to_succ Composition.sizeUpTo_succ
theorem sizeUpTo_succ' (i : Fin c.length) :
c.sizeUpTo ((i : β) + 1) = c.sizeUpTo i + c.blocksFun i :=
c.sizeUpTo_succ i.2
#align composition.size_up_to_succ' Composition.sizeUpTo_succ'
theorem sizeUpTo_strict_mono {i : β} (h : i < c.length) : c.sizeUpTo i < c.sizeUpTo (i + 1) := by
rw [c.sizeUpTo_succ h]
simp
#align composition.size_up_to_strict_mono Composition.sizeUpTo_strict_mono
theorem monotone_sizeUpTo : Monotone c.sizeUpTo :=
monotone_sum_take _
#align composition.monotone_size_up_to Composition.monotone_sizeUpTo
def boundary : Fin (c.length + 1) βͺo Fin (n + 1) :=
(OrderEmbedding.ofStrictMono fun i => β¨c.sizeUpTo i, Nat.lt_succ_of_le (c.sizeUpTo_le i)β©) <|
Fin.strictMono_iff_lt_succ.2 fun β¨_, hiβ© => c.sizeUpTo_strict_mono hi
#align composition.boundary Composition.boundary
@[simp]
| Mathlib/Combinatorics/Enumerative/Composition.lean | 252 | 252 | theorem boundary_zero : c.boundary 0 = 0 := by | simp [boundary, Fin.ext_iff]
| true |
import Mathlib.Algebra.Polynomial.Degree.Definitions
#align_import ring_theory.polynomial.opposites from "leanprover-community/mathlib"@"63417e01fbc711beaf25fa73b6edb395c0cfddd0"
open Polynomial
open Polynomial MulOpposite
variable {R : Type*} [Semiring R]
noncomputable section
namespace Polynomial
def opRingEquiv (R : Type*) [Semiring R] : R[X]α΅α΅α΅ β+* Rα΅α΅α΅[X] :=
((toFinsuppIso R).op.trans AddMonoidAlgebra.opRingEquiv).trans (toFinsuppIso _).symm
#align polynomial.op_ring_equiv Polynomial.opRingEquiv
@[simp]
theorem opRingEquiv_op_monomial (n : β) (r : R) :
opRingEquiv R (op (monomial n r : R[X])) = monomial n (op r) := by
simp only [opRingEquiv, RingEquiv.coe_trans, Function.comp_apply,
AddMonoidAlgebra.opRingEquiv_apply, RingEquiv.op_apply_apply, toFinsuppIso_apply, unop_op,
toFinsupp_monomial, Finsupp.mapRange_single, toFinsuppIso_symm_apply, ofFinsupp_single]
#align polynomial.op_ring_equiv_op_monomial Polynomial.opRingEquiv_op_monomial
@[simp]
theorem opRingEquiv_op_C (a : R) : opRingEquiv R (op (C a)) = C (op a) :=
opRingEquiv_op_monomial 0 a
set_option linter.uppercaseLean3 false in
#align polynomial.op_ring_equiv_op_C Polynomial.opRingEquiv_op_C
@[simp]
theorem opRingEquiv_op_X : opRingEquiv R (op (X : R[X])) = X :=
opRingEquiv_op_monomial 1 1
set_option linter.uppercaseLean3 false in
#align polynomial.op_ring_equiv_op_X Polynomial.opRingEquiv_op_X
| Mathlib/RingTheory/Polynomial/Opposites.lean | 57 | 59 | theorem opRingEquiv_op_C_mul_X_pow (r : R) (n : β) :
opRingEquiv R (op (C r * X ^ n : R[X])) = C (op r) * X ^ n := by |
simp only [X_pow_mul, op_mul, op_pow, map_mul, map_pow, opRingEquiv_op_X, opRingEquiv_op_C]
| true |
import Mathlib.Analysis.Analytic.Basic
import Mathlib.Combinatorics.Enumerative.Composition
#align_import analysis.analytic.composition from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a"
noncomputable section
variable {π : Type*} {E F G H : Type*}
open Filter List
open scoped Topology Classical NNReal ENNReal
section Topological
variable [CommRing π] [AddCommGroup E] [AddCommGroup F] [AddCommGroup G]
variable [Module π E] [Module π F] [Module π G]
variable [TopologicalSpace E] [TopologicalSpace F] [TopologicalSpace G]
namespace FormalMultilinearSeries
variable [TopologicalAddGroup E] [ContinuousConstSMul π E]
variable [TopologicalAddGroup F] [ContinuousConstSMul π F]
variable [TopologicalAddGroup G] [ContinuousConstSMul π G]
def applyComposition (p : FormalMultilinearSeries π E F) {n : β} (c : Composition n) :
(Fin n β E) β Fin c.length β F := fun v i => p (c.blocksFun i) (v β c.embedding i)
#align formal_multilinear_series.apply_composition FormalMultilinearSeries.applyComposition
theorem applyComposition_ones (p : FormalMultilinearSeries π E F) (n : β) :
p.applyComposition (Composition.ones n) = fun v i =>
p 1 fun _ => v (Fin.castLE (Composition.length_le _) i) := by
funext v i
apply p.congr (Composition.ones_blocksFun _ _)
intro j hjn hj1
obtain rfl : j = 0 := by omega
refine congr_arg v ?_
rw [Fin.ext_iff, Fin.coe_castLE, Composition.ones_embedding, Fin.val_mk]
#align formal_multilinear_series.apply_composition_ones FormalMultilinearSeries.applyComposition_ones
theorem applyComposition_single (p : FormalMultilinearSeries π E F) {n : β} (hn : 0 < n)
(v : Fin n β E) : p.applyComposition (Composition.single n hn) v = fun _j => p n v := by
ext j
refine p.congr (by simp) fun i hi1 hi2 => ?_
dsimp
congr 1
convert Composition.single_embedding hn β¨i, hi2β© using 1
cases' j with j_val j_property
have : j_val = 0 := le_bot_iff.1 (Nat.lt_succ_iff.1 j_property)
congr!
simp
#align formal_multilinear_series.apply_composition_single FormalMultilinearSeries.applyComposition_single
@[simp]
| Mathlib/Analysis/Analytic/Composition.lean | 131 | 134 | theorem removeZero_applyComposition (p : FormalMultilinearSeries π E F) {n : β}
(c : Composition n) : p.removeZero.applyComposition c = p.applyComposition c := by
ext v i |
ext v i
simp [applyComposition, zero_lt_one.trans_le (c.one_le_blocksFun i), removeZero_of_pos]
| true |
import Mathlib.CategoryTheory.Sites.Sheaf
#align_import category_theory.sites.canonical from "leanprover-community/mathlib"@"9e7c80f638149bfb3504ba8ff48dfdbfc949fb1a"
universe v u
namespace CategoryTheory
open scoped Classical
open CategoryTheory Category Limits Sieve
variable {C : Type u} [Category.{v} C]
namespace Sheaf
variable {P : Cα΅α΅ β₯€ Type v}
variable {X Y : C} {S : Sieve X} {R : Presieve X}
variable (J Jβ : GrothendieckTopology C)
theorem isSheafFor_bind (P : Cα΅α΅ β₯€ Type v) (U : Sieve X) (B : β β¦Yβ¦ β¦f : Y βΆ Xβ¦, U f β Sieve Y)
(hU : Presieve.IsSheafFor P (U : Presieve X))
(hB : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), Presieve.IsSheafFor P (B hf : Presieve Y))
(hB' : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (h : U f) β¦Zβ¦ (g : Z βΆ Y),
Presieve.IsSeparatedFor P (((B h).pullback g) : Presieve Z)) :
Presieve.IsSheafFor P (Sieve.bind (U : Presieve X) B : Presieve X) := by
intro s hs
let y : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), Presieve.FamilyOfElements P (B hf : Presieve Y) :=
fun Y f hf Z g hg => s _ (Presieve.bind_comp _ _ hg)
have hy : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), (y hf).Compatible := by
intro Y f H Yβ Yβ Z gβ gβ fβ fβ hfβ hfβ comm
apply hs
apply reassoc_of% comm
let t : Presieve.FamilyOfElements P (U : Presieve X) :=
fun Y f hf => (hB hf).amalgamate (y hf) (hy hf)
have ht : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (hf : U f), (y hf).IsAmalgamation (t f hf) := fun Y f hf =>
(hB hf).isAmalgamation _
have hT : t.Compatible := by
rw [Presieve.compatible_iff_sieveCompatible]
intro Z W f h hf
apply (hB (U.downward_closed hf h)).isSeparatedFor.ext
intro Y l hl
apply (hB' hf (l β« h)).ext
intro M m hm
have : bind U B (m β« l β« h β« f) := by
-- Porting note: had to make explicit the parameter `((m β« l β« h) β« f)` and
-- using `by exact`
have : bind U B ((m β« l β« h) β« f) := by exact Presieve.bind_comp f hf hm
simpa using this
trans s (m β« l β« h β« f) this
Β· have := ht (U.downward_closed hf h) _ ((B _).downward_closed hl m)
rw [op_comp, FunctorToTypes.map_comp_apply] at this
rw [this]
change s _ _ = s _ _
-- Porting note: the proof was `by simp`
congr 1
simp only [assoc]
Β· have h : s _ _ = _ := (ht hf _ hm).symm
-- Porting note: this was done by `simp only [assoc] at`
conv_lhs at h => congr; rw [assoc, assoc]
rw [h]
simp only [op_comp, assoc, FunctorToTypes.map_comp_apply]
refine β¨hU.amalgamate t hT, ?_, ?_β©
Β· rintro Z _ β¨Y, f, g, hg, hf, rflβ©
rw [op_comp, FunctorToTypes.map_comp_apply, Presieve.IsSheafFor.valid_glue _ _ _ hg]
apply ht hg _ hf
Β· intro y hy
apply hU.isSeparatedFor.ext
intro Y f hf
apply (hB hf).isSeparatedFor.ext
intro Z g hg
rw [β FunctorToTypes.map_comp_apply, β op_comp, hy _ (Presieve.bind_comp _ _ hg),
hU.valid_glue _ _ hf, ht hf _ hg]
#align category_theory.sheaf.is_sheaf_for_bind CategoryTheory.Sheaf.isSheafFor_bind
| Mathlib/CategoryTheory/Sites/Canonical.lean | 125 | 150 | theorem isSheafFor_trans (P : Cα΅α΅ β₯€ Type v) (R S : Sieve X)
(hR : Presieve.IsSheafFor P (R : Presieve X))
(hR' : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (_ : S f), Presieve.IsSeparatedFor P (R.pullback f : Presieve Y))
(hS : β β¦Yβ¦ β¦f : Y βΆ Xβ¦ (_ : R f), Presieve.IsSheafFor P (S.pullback f : Presieve Y)) :
Presieve.IsSheafFor P (S : Presieve X) := by
have : (bind R fun Y f _ => S.pullback f : Presieve X) β€ S := by |
have : (bind R fun Y f _ => S.pullback f : Presieve X) β€ S := by
rintro Z f β¨W, f, g, hg, hf : S _, rflβ©
apply hf
apply Presieve.isSheafFor_subsieve_aux P this
Β· apply isSheafFor_bind _ _ _ hR hS
intro Y f hf Z g
rw [β pullback_comp]
apply (hS (R.downward_closed hf _)).isSeparatedFor
Β· intro Y f hf
have : Sieve.pullback f (bind R fun T (k : T βΆ X) (_ : R k) => pullback k S) =
R.pullback f := by
ext Z g
constructor
Β· rintro β¨W, k, l, hl, _, commβ©
rw [pullback_apply, β comm]
simp [hl]
Β· intro a
refine β¨Z, π Z, _, a, ?_β©
simp [hf]
rw [this]
apply hR' hf
| true |
import Mathlib.Algebra.Module.Zlattice.Basic
import Mathlib.NumberTheory.NumberField.Embeddings
import Mathlib.NumberTheory.NumberField.FractionalIdeal
#align_import number_theory.number_field.canonical_embedding from "leanprover-community/mathlib"@"60da01b41bbe4206f05d34fd70c8dd7498717a30"
variable (K : Type*) [Field K]
namespace NumberField.mixedEmbedding
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
local notation "E" K =>
({w : InfinitePlace K // IsReal w} β β) Γ ({w : InfinitePlace K // IsComplex w} β β)
noncomputable def _root_.NumberField.mixedEmbedding : K β+* (E K) :=
RingHom.prod (Pi.ringHom fun w => embedding_of_isReal w.prop)
(Pi.ringHom fun w => w.val.embedding)
instance [NumberField K] : Nontrivial (E K) := by
obtain β¨wβ© := (inferInstance : Nonempty (InfinitePlace K))
obtain hw | hw := w.isReal_or_isComplex
Β· have : Nonempty {w : InfinitePlace K // IsReal w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_left
Β· have : Nonempty {w : InfinitePlace K // IsComplex w} := β¨β¨w, hwβ©β©
exact nontrivial_prod_right
protected theorem finrank [NumberField K] : finrank β (E K) = finrank β K := by
classical
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
card_univ, β NrRealPlaces, β NrComplexPlaces, β card_real_embeddings, Algebra.id.smul_eq_mul,
mul_comm, β card_complex_embeddings, β NumberField.Embeddings.card K β,
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
Function.Injective (NumberField.mixedEmbedding K) := by
exact RingHom.injective _
noncomputable section norm
open scoped Classical
variable {K}
def normAtPlace (w : InfinitePlace K) : (E K) β*β β where
toFun x := if hw : IsReal w then βx.1 β¨w, hwβ©β else βx.2 β¨w, not_isReal_iff_isComplex.mp hwβ©β
map_zero' := by simp
map_one' := by simp
map_mul' x y := by split_ifs <;> simp
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
0 β€ normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_nonneg _
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
normAtPlace w (- x) = normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> simp
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
normAtPlace w (x + y) β€ normAtPlace w x + normAtPlace w y := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs <;> exact norm_add_le _ _
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : β) :
normAtPlace w (c β’ x) = |c| * normAtPlace w x := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
split_ifs
Β· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
Β· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
theorem normAtPlace_real (w : InfinitePlace K) (c : β) :
normAtPlace w ((fun _ β¦ c, fun _ β¦ c) : (E K)) = |c| := by
rw [show ((fun _ β¦ c, fun _ β¦ c) : (E K)) = c β’ 1 by ext <;> simp, normAtPlace_smul, map_one,
mul_one]
theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
normAtPlace w x = βx.1 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
| Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean | 290 | 293 | theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
normAtPlace w x = βx.2 β¨w, hwβ©β := by
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, |
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk,
dif_neg (not_isReal_iff_isComplex.mpr hw)]
| true |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Init.Data.Nat.Lemmas
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Zify
#align_import data.nat.fib from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
namespace Nat
-- Porting note: Lean cannot find pp_nodot at the time of this port.
-- @[pp_nodot]
def fib (n : β) : β :=
((fun p : β Γ β => (p.snd, p.fst + p.snd))^[n] (0, 1)).fst
#align nat.fib Nat.fib
@[simp]
theorem fib_zero : fib 0 = 0 :=
rfl
#align nat.fib_zero Nat.fib_zero
@[simp]
theorem fib_one : fib 1 = 1 :=
rfl
#align nat.fib_one Nat.fib_one
@[simp]
theorem fib_two : fib 2 = 1 :=
rfl
#align nat.fib_two Nat.fib_two
theorem fib_add_two {n : β} : fib (n + 2) = fib n + fib (n + 1) := by
simp [fib, Function.iterate_succ_apply']
#align nat.fib_add_two Nat.fib_add_two
lemma fib_add_one : β {n}, n β 0 β fib (n + 1) = fib (n - 1) + fib n
| _n + 1, _ => fib_add_two
theorem fib_le_fib_succ {n : β} : fib n β€ fib (n + 1) := by cases n <;> simp [fib_add_two]
#align nat.fib_le_fib_succ Nat.fib_le_fib_succ
@[mono]
theorem fib_mono : Monotone fib :=
monotone_nat_of_le_succ fun _ => fib_le_fib_succ
#align nat.fib_mono Nat.fib_mono
@[simp] lemma fib_eq_zero : β {n}, fib n = 0 β n = 0
| 0 => Iff.rfl
| 1 => Iff.rfl
| n + 2 => by simp [fib_add_two, fib_eq_zero]
@[simp] lemma fib_pos {n : β} : 0 < fib n β 0 < n := by simp [pos_iff_ne_zero]
#align nat.fib_pos Nat.fib_pos
theorem fib_add_two_sub_fib_add_one {n : β} : fib (n + 2) - fib (n + 1) = fib n := by
rw [fib_add_two, add_tsub_cancel_right]
#align nat.fib_add_two_sub_fib_add_one Nat.fib_add_two_sub_fib_add_one
theorem fib_lt_fib_succ {n : β} (hn : 2 β€ n) : fib n < fib (n + 1) := by
rcases exists_add_of_le hn with β¨n, rflβ©
rw [β tsub_pos_iff_lt, add_comm 2, add_right_comm, fib_add_two, add_tsub_cancel_right, fib_pos]
exact succ_pos n
#align nat.fib_lt_fib_succ Nat.fib_lt_fib_succ
| Mathlib/Data/Nat/Fib/Basic.lean | 121 | 124 | theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2) := by
refine strictMono_nat_of_lt_succ fun n => ?_ |
refine strictMono_nat_of_lt_succ fun n => ?_
rw [add_right_comm]
exact fib_lt_fib_succ (self_le_add_left _ _)
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.