Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | eval_complexity float64 0 1 |
|---|---|---|---|---|---|---|
import Mathlib.LinearAlgebra.LinearIndependent
#align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5"
noncomputable section
universe w w' u u' v v'
variable {R : Type u} {R' : Type u'} {M Mβ : Type v} {M' : Type v'}
open Cardinal Submodule Function Set
section Module
section
variable [Semiring R] [AddCommMonoid M] [Module R M]
variable (R M)
protected irreducible_def Module.rank : Cardinal :=
β¨ ΞΉ : { s : Set M // LinearIndependent R ((β) : s β M) }, (#ΞΉ.1)
#align module.rank Module.rank
theorem rank_le_card : Module.rank R M β€ #M :=
(Module.rank_def _ _).trans_le (ciSup_le' fun _ β¦ mk_set_le _)
lemma nonempty_linearIndependent_set : Nonempty {s : Set M // LinearIndependent R ((β) : s β M)} :=
β¨β¨β
, linearIndependent_empty _ _β©β©
end
variable [Ring R] [Ring R'] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup Mβ]
variable [Module R M] [Module R M'] [Module R Mβ] [Module R' M'] [Module R' Mβ]
namespace LinearIndependent
variable [Nontrivial R]
| Mathlib/LinearAlgebra/Dimension/Basic.lean | 79 | 84 | theorem cardinal_lift_le_rank {ΞΉ : Type w} {v : ΞΉ β M}
(hv : LinearIndependent R v) :
Cardinal.lift.{v} #ΞΉ β€ Cardinal.lift.{w} (Module.rank R M) := by |
rw [Module.rank]
refine le_trans ?_ (lift_le.mpr <| le_ciSup (bddAbove_range.{v, v} _) β¨_, hv.coe_rangeβ©)
exact lift_mk_le'.mpr β¨(Equiv.ofInjective _ hv.injective).toEmbeddingβ©
| 0.09375 |
import Mathlib.Analysis.NormedSpace.PiLp
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped NNReal Matrix
namespace Matrix
variable {R l m n Ξ± Ξ² : Type*} [Fintype l] [Fintype m] [Fintype n]
section LinfLinf
protected def normedAddCommGroup [NormedAddCommGroup Ξ±] : NormedAddCommGroup (Matrix m n Ξ±) :=
Pi.normedAddCommGroup
#align matrix.normed_add_comm_group Matrix.normedAddCommGroup
section LinftyOp
@[local instance]
protected def linftyOpSeminormedAddCommGroup [SeminormedAddCommGroup Ξ±] :
SeminormedAddCommGroup (Matrix m n Ξ±) :=
(by infer_instance : SeminormedAddCommGroup (m β PiLp 1 fun j : n => Ξ±))
#align matrix.linfty_op_seminormed_add_comm_group Matrix.linftyOpSeminormedAddCommGroup
@[local instance]
protected def linftyOpNormedAddCommGroup [NormedAddCommGroup Ξ±] :
NormedAddCommGroup (Matrix m n Ξ±) :=
(by infer_instance : NormedAddCommGroup (m β PiLp 1 fun j : n => Ξ±))
#align matrix.linfty_op_normed_add_comm_group Matrix.linftyOpNormedAddCommGroup
@[local instance]
protected theorem linftyOpBoundedSMul
[SeminormedRing R] [SeminormedAddCommGroup Ξ±] [Module R Ξ±] [BoundedSMul R Ξ±] :
BoundedSMul R (Matrix m n Ξ±) :=
(by infer_instance : BoundedSMul R (m β PiLp 1 fun j : n => Ξ±))
@[local instance]
protected def linftyOpNormedSpace [NormedField R] [SeminormedAddCommGroup Ξ±] [NormedSpace R Ξ±] :
NormedSpace R (Matrix m n Ξ±) :=
(by infer_instance : NormedSpace R (m β PiLp 1 fun j : n => Ξ±))
#align matrix.linfty_op_normed_space Matrix.linftyOpNormedSpace
section SeminormedAddCommGroup
variable [SeminormedAddCommGroup Ξ±]
| Mathlib/Analysis/Matrix.lean | 273 | 277 | theorem linfty_opNorm_def (A : Matrix m n Ξ±) :
βAβ = ((Finset.univ : Finset m).sup fun i : m => β j : n, βA i jββ : ββ₯0) := by |
-- Porting note: added
change βfun i => (WithLp.equiv 1 _).symm (A i)β = _
simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
| 0.09375 |
import Mathlib.LinearAlgebra.Matrix.Reindex
import Mathlib.LinearAlgebra.Matrix.ToLin
#align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76"
noncomputable section
open LinearMap Matrix Set Submodule
open Matrix
section BasisToMatrix
variable {ΞΉ ΞΉ' ΞΊ ΞΊ' : Type*}
variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {Rβ Mβ : Type*} [CommRing Rβ] [AddCommGroup Mβ] [Module Rβ Mβ]
open Function Matrix
def Basis.toMatrix (e : Basis ΞΉ R M) (v : ΞΉ' β M) : Matrix ΞΉ ΞΉ' R := fun i j => e.repr (v j) i
#align basis.to_matrix Basis.toMatrix
variable (e : Basis ΞΉ R M) (v : ΞΉ' β M) (i : ΞΉ) (j : ΞΉ')
namespace Basis
theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i :=
rfl
#align basis.to_matrix_apply Basis.toMatrix_apply
theorem toMatrix_transpose_apply : (e.toMatrix v)α΅ j = e.repr (v j) :=
funext fun _ => rfl
#align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply
theorem toMatrix_eq_toMatrix_constr [Fintype ΞΉ] [DecidableEq ΞΉ] (v : ΞΉ β M) :
e.toMatrix v = LinearMap.toMatrix e e (e.constr β v) := by
ext
rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis]
#align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr
-- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose.
theorem coePiBasisFun.toMatrix_eq_transpose [Finite ΞΉ] :
((Pi.basisFun R ΞΉ).toMatrix : Matrix ΞΉ ΞΉ R β Matrix ΞΉ ΞΉ R) = Matrix.transpose := by
ext M i j
rfl
#align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose
@[simp]
theorem toMatrix_self [DecidableEq ΞΉ] : e.toMatrix e = 1 := by
unfold Basis.toMatrix
ext i j
simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm]
#align basis.to_matrix_self Basis.toMatrix_self
| Mathlib/LinearAlgebra/Matrix/Basis.lean | 86 | 92 | theorem toMatrix_update [DecidableEq ΞΉ'] (x : M) :
e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) := by |
ext i' k
rw [Basis.toMatrix, Matrix.updateColumn_apply, e.toMatrix_apply]
split_ifs with h
Β· rw [h, update_same j x v]
Β· rw [update_noteq h]
| 0.09375 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
section Fintype
variable {Ξ± Ξ² : Type*} [Fintype Ξ±] [DecidableEq Ξ²] (e : Equiv.Perm Ξ±) (f : Ξ± βͺ Ξ²)
def Function.Embedding.toEquivRange : Ξ± β Set.range f :=
β¨fun a => β¨f a, Set.mem_range_self aβ©, f.invOfMemRange, fun _ => by simp, fun _ => by simpβ©
#align function.embedding.to_equiv_range Function.Embedding.toEquivRange
@[simp]
theorem Function.Embedding.toEquivRange_apply (a : Ξ±) :
f.toEquivRange a = β¨f a, Set.mem_range_self aβ© :=
rfl
#align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply
@[simp]
theorem Function.Embedding.toEquivRange_symm_apply_self (a : Ξ±) :
f.toEquivRange.symm β¨f a, Set.mem_range_self aβ© = a := by simp [Equiv.symm_apply_eq]
#align function.embedding.to_equiv_range_symm_apply_self Function.Embedding.toEquivRange_symm_apply_self
theorem Function.Embedding.toEquivRange_eq_ofInjective :
f.toEquivRange = Equiv.ofInjective f f.injective := by
ext
simp
#align function.embedding.to_equiv_range_eq_of_injective Function.Embedding.toEquivRange_eq_ofInjective
def Equiv.Perm.viaFintypeEmbedding : Equiv.Perm Ξ² :=
e.extendDomain f.toEquivRange
#align equiv.perm.via_fintype_embedding Equiv.Perm.viaFintypeEmbedding
@[simp]
| Mathlib/Logic/Equiv/Fintype.lean | 72 | 75 | theorem Equiv.Perm.viaFintypeEmbedding_apply_image (a : Ξ±) :
e.viaFintypeEmbedding f (f a) = f (e a) := by |
rw [Equiv.Perm.viaFintypeEmbedding]
convert Equiv.Perm.extendDomain_apply_image e (Function.Embedding.toEquivRange f) a
| 0.09375 |
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]
| Mathlib/Computability/TMToPartrec.lean | 183 | 183 | theorem id_eval (v) : id.eval v = pure v := by | simp [id]
| 0.09375 |
import Batteries.Data.Sum.Basic
import Batteries.Logic
open Function
namespace Sum
@[simp] protected theorem Β«forallΒ» {p : Ξ± β Ξ² β Prop} :
(β x, p x) β (β a, p (inl a)) β§ β b, p (inr b) :=
β¨fun h => β¨fun _ => h _, fun _ => h _β©, fun β¨hβ, hββ© => Sum.rec hβ hββ©
@[simp] protected theorem Β«existsΒ» {p : Ξ± β Ξ² β Prop} :
(β x, p x) β (β a, p (inl a)) β¨ β b, p (inr b) :=
β¨ fun
| β¨inl a, hβ© => Or.inl β¨a, hβ©
| β¨inr b, hβ© => Or.inr β¨b, hβ©,
fun
| Or.inl β¨a, hβ© => β¨inl a, hβ©
| Or.inr β¨b, hβ© => β¨inr b, hβ©β©
theorem forall_sum {Ξ³ : Ξ± β Ξ² β Sort _} (p : (β ab, Ξ³ ab) β Prop) :
(β fab, p fab) β (β fa fb, p (Sum.rec fa fb)) := by
refine β¨fun h fa fb => h _, fun h fab => ?_β©
have h1 : fab = Sum.rec (fun a => fab (Sum.inl a)) (fun b => fab (Sum.inr b)) := by
ext ab; cases ab <;> rfl
rw [h1]; exact h _ _
theorem inl.inj_iff : (inl a : Ξ± β Ξ²) = inl b β a = b := β¨inl.inj, congrArg _β©
theorem inr.inj_iff : (inr a : Ξ± β Ξ²) = inr b β a = b := β¨inr.inj, congrArg _β©
theorem inl_ne_inr : inl a β inr b := nofun
theorem inr_ne_inl : inr b β inl a := nofun
@[simp] theorem elim_comp_inl (f : Ξ± β Ξ³) (g : Ξ² β Ξ³) : Sum.elim f g β inl = f :=
rfl
@[simp] theorem elim_comp_inr (f : Ξ± β Ξ³) (g : Ξ² β Ξ³) : Sum.elim f g β inr = g :=
rfl
@[simp] theorem elim_inl_inr : @Sum.elim Ξ± Ξ² _ inl inr = id :=
funext fun x => Sum.casesOn x (fun _ => rfl) fun _ => rfl
theorem comp_elim (f : Ξ³ β Ξ΄) (g : Ξ± β Ξ³) (h : Ξ² β Ξ³) :
f β Sum.elim g h = Sum.elim (f β g) (f β h) :=
funext fun x => Sum.casesOn x (fun _ => rfl) fun _ => rfl
@[simp] theorem elim_comp_inl_inr (f : Ξ± β Ξ² β Ξ³) :
Sum.elim (f β inl) (f β inr) = f :=
funext fun x => Sum.casesOn x (fun _ => rfl) fun _ => rfl
| .lake/packages/batteries/Batteries/Data/Sum/Lemmas.lean | 116 | 118 | theorem elim_eq_iff {u u' : Ξ± β Ξ³} {v v' : Ξ² β Ξ³} :
Sum.elim u v = Sum.elim u' v' β u = u' β§ v = v' := by |
simp [funext_iff]
| 0.09375 |
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
| Mathlib/Data/Int/Lemmas.lean | 60 | 61 | 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]
| 0.09375 |
import Mathlib.LinearAlgebra.Basis
import Mathlib.LinearAlgebra.BilinearMap
#align_import linear_algebra.basis.bilinear from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d"
namespace LinearMap
variable {ΞΉβ ΞΉβ : Type*}
variable {R Rβ S Sβ M N P Rβ : Type*}
variable {Mβ Nβ Pβ : Type*}
-- Could weaken [CommSemiring Rβ] to [SMulCommClass Rβ Rβ Pβ], but might impact performance
variable [Semiring R] [Semiring S] [Semiring Rβ] [Semiring Sβ] [CommSemiring Rβ]
section AddCommMonoid
variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P]
variable [AddCommMonoid Mβ] [AddCommMonoid Nβ] [AddCommMonoid Pβ]
variable [Module R M] [Module S N] [Module Rβ P] [Module Sβ P]
variable [Module Rβ Mβ] [Module Rβ Nβ] [Module Rβ Pβ]
variable [SMulCommClass Sβ Rβ P]
variable {Οββ : R β+* Rβ} {Οββ : S β+* Sβ}
variable (bβ : Basis ΞΉβ R M) (bβ : Basis ΞΉβ S N) (bβ' : Basis ΞΉβ Rβ Mβ) (bβ' : Basis ΞΉβ Rβ Nβ)
theorem ext_basis {B B' : M βββ[Οββ] N βββ[Οββ] P} (h : β i j, B (bβ i) (bβ j) = B' (bβ i) (bβ j)) :
B = B' :=
bβ.ext fun i => bβ.ext fun j => h i j
#align linear_map.ext_basis LinearMap.ext_basis
theorem sum_repr_mul_repr_mulββ {B : M βββ[Οββ] N βββ[Οββ] P} (x y) :
((bβ.repr x).sum fun i xi => (bβ.repr y).sum fun j yj => Οββ xi β’ Οββ yj β’ B (bβ i) (bβ j)) =
B x y := by
conv_rhs => rw [β bβ.total_repr x, β bβ.total_repr y]
simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ, map_sum, LinearMap.map_smulβββ,
LinearMap.map_smulββ]
#align linear_map.sum_repr_mul_repr_mulββ LinearMap.sum_repr_mul_repr_mulββ
| Mathlib/LinearAlgebra/Basis/Bilinear.lean | 55 | 60 | theorem sum_repr_mul_repr_mul {B : Mβ ββ[Rβ] Nβ ββ[Rβ] Pβ} (x y) :
((bβ'.repr x).sum fun i xi => (bβ'.repr y).sum fun j yj => xi β’ yj β’ B (bβ' i) (bβ' j)) =
B x y := by |
conv_rhs => rw [β bβ'.total_repr x, β bβ'.total_repr y]
simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ, map_sum, LinearMap.map_smulβ,
LinearMap.map_smul]
| 0.09375 |
import Mathlib.LinearAlgebra.Dimension.LinearMap
import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition
#align_import linear_algebra.free_module.finite.matrix from "leanprover-community/mathlib"@"b1c23399f01266afe392a0d8f71f599a0dad4f7b"
universe u u' v w
variable (R : Type u) (S : Type u') (M : Type v) (N : Type w)
open Module.Free (chooseBasis ChooseBasisIndex)
open FiniteDimensional (finrank)
section Ring
variable [Ring R] [Ring S] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M]
variable [AddCommGroup N] [Module R N] [Module S N] [SMulCommClass R S N]
private noncomputable def linearMapEquivFun : (M ββ[R] N) ββ[S] ChooseBasisIndex R M β N :=
(chooseBasis R M).repr.congrLeft N S βͺβ«β (Finsupp.lsum S).symm βͺβ«β
LinearEquiv.piCongrRight fun _ β¦ LinearMap.ringLmapEquivSelf R S N
instance Module.Free.linearMap [Module.Free S N] : Module.Free S (M ββ[R] N) :=
Module.Free.of_equiv (linearMapEquivFun R S M N).symm
#align module.free.linear_map Module.Free.linearMap
instance Module.Finite.linearMap [Module.Finite S N] : Module.Finite S (M ββ[R] N) :=
Module.Finite.equiv (linearMapEquivFun R S M N).symm
#align module.finite.linear_map Module.Finite.linearMap
variable [StrongRankCondition R] [StrongRankCondition S] [Module.Free S N]
open Cardinal
theorem FiniteDimensional.rank_linearMap :
Module.rank S (M ββ[R] N) = lift.{w} (Module.rank R M) * lift.{v} (Module.rank S N) := by
rw [(linearMapEquivFun R S M N).rank_eq, rank_fun_eq_lift_mul,
β finrank_eq_card_chooseBasisIndex, β finrank_eq_rank R, lift_natCast]
| Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean | 59 | 61 | theorem FiniteDimensional.finrank_linearMap :
finrank S (M ββ[R] N) = finrank R M * finrank S N := by |
simp_rw [finrank, rank_linearMap, toNat_mul, toNat_lift]
| 0.09375 |
import Mathlib.Data.Nat.Choose.Basic
import Mathlib.Data.Sym.Sym2
namespace List
variable {Ξ± : Type*}
section Sym2
protected def sym2 : List Ξ± β List (Sym2 Ξ±)
| [] => []
| x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2
theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} :
z β (x :: xs).sym2 β z = s(x, x) β¨ (β y, y β xs β§ z = s(x, y)) β¨ z β xs.sym2 := by
simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map]
simp only [eq_comm]
@[simp]
theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] β xs = [] := by
cases xs <;> simp [List.sym2]
theorem left_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±}
(h : s(a, b) β xs.sym2) : a β xs := by
induction xs with
| nil => exact (not_mem_nil _ h).elim
| cons x xs ih =>
rw [mem_cons]
rw [mem_sym2_cons_iff] at h
obtain (h | β¨c, hc, hβ© | h) := h
Β· rw [Sym2.eq_iff, β and_or_left] at h
exact .inl h.1
Β· rw [Sym2.eq_iff] at h
obtain (β¨rfl, rflβ© | β¨rfl, rflβ©) := h <;> simp [hc]
Β· exact .inr <| ih h
| Mathlib/Data/List/Sym.lean | 63 | 66 | theorem right_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±}
(h : s(a, b) β xs.sym2) : b β xs := by |
rw [Sym2.eq_swap] at h
exact left_mem_of_mk_mem_sym2 h
| 0.09375 |
import Mathlib.Analysis.Normed.Group.Hom
import Mathlib.Analysis.NormedSpace.Basic
import Mathlib.Analysis.NormedSpace.LinearIsometry
import Mathlib.Algebra.Star.SelfAdjoint
import Mathlib.Algebra.Star.Subalgebra
import Mathlib.Algebra.Star.Unitary
import Mathlib.Topology.Algebra.Module.Star
#align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207"
open Topology
local postfix:max "β" => star
class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where
norm_star : β x : E, βxββ = βxβ
#align normed_star_group NormedStarGroup
export NormedStarGroup (norm_star)
attribute [simp] norm_star
variable {π E Ξ± : Type*}
instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] :
RingHomIsometric (starRingEnd E) :=
β¨@norm_star _ _ _ _β©
#align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd
class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where
norm_star_mul_self : β {x : E}, βxβ * xβ = βxβ * βxβ
#align cstar_ring CstarRing
instance : CstarRing β where norm_star_mul_self {x} := by simp only [star, id, norm_mul]
namespace CstarRing
section NonUnital
variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E]
-- see Note [lower instance priority]
instance (priority := 100) to_normedStarGroup : NormedStarGroup E :=
β¨by
intro x
by_cases htriv : x = 0
Β· simp only [htriv, star_zero]
Β· have hnt : 0 < βxβ := norm_pos_iff.mpr htriv
have hnt_star : 0 < βxββ :=
norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv)
have hβ :=
calc
βxβ * βxβ = βxβ * xβ := norm_star_mul_self.symm
_ β€ βxββ * βxβ := norm_mul_le _ _
have hβ :=
calc
βxββ * βxββ = βx * xββ := by rw [β norm_star_mul_self, star_star]
_ β€ βxβ * βxββ := norm_mul_le _ _
exact le_antisymm (le_of_mul_le_mul_right hβ hnt_star) (le_of_mul_le_mul_right hβ hnt)β©
#align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup
theorem norm_self_mul_star {x : E} : βx * xββ = βxβ * βxβ := by
nth_rw 1 [β star_star x]
simp only [norm_star_mul_self, norm_star]
#align cstar_ring.norm_self_mul_star CstarRing.norm_self_mul_star
theorem norm_star_mul_self' {x : E} : βxβ * xβ = βxββ * βxβ := by rw [norm_star_mul_self, norm_star]
#align cstar_ring.norm_star_mul_self' CstarRing.norm_star_mul_self'
theorem nnnorm_self_mul_star {x : E} : βx * xβββ = βxββ * βxββ :=
Subtype.ext norm_self_mul_star
#align cstar_ring.nnnorm_self_mul_star CstarRing.nnnorm_self_mul_star
theorem nnnorm_star_mul_self {x : E} : βxβ * xββ = βxββ * βxββ :=
Subtype.ext norm_star_mul_self
#align cstar_ring.nnnorm_star_mul_self CstarRing.nnnorm_star_mul_self
@[simp]
| Mathlib/Analysis/NormedSpace/Star/Basic.lean | 135 | 137 | theorem star_mul_self_eq_zero_iff (x : E) : xβ * x = 0 β x = 0 := by |
rw [β norm_eq_zero, norm_star_mul_self]
exact mul_self_eq_zero.trans norm_eq_zero
| 0.09375 |
import Mathlib.Algebra.CharP.Pi
import Mathlib.Algebra.CharP.Quotient
import Mathlib.Algebra.CharP.Subring
import Mathlib.Algebra.Ring.Pi
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal
import Mathlib.FieldTheory.Perfect
import Mathlib.RingTheory.Localization.FractionRing
import Mathlib.Algebra.Ring.Subring.Basic
import Mathlib.RingTheory.Valuation.Integers
#align_import ring_theory.perfection from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
universe uβ uβ uβ uβ
open scoped NNReal
def Monoid.perfection (M : Type uβ) [CommMonoid M] (p : β) : Submonoid (β β M) where
carrier := { f | β n, f (n + 1) ^ p = f n }
one_mem' _ := one_pow _
mul_mem' hf hg n := (mul_pow _ _ _).trans <| congr_argβ _ (hf n) (hg n)
#align monoid.perfection Monoid.perfection
def Ring.perfectionSubsemiring (R : Type uβ) [CommSemiring R] (p : β) [hp : Fact p.Prime]
[CharP R p] : Subsemiring (β β R) :=
{ Monoid.perfection R p with
zero_mem' := fun _ β¦ zero_pow hp.1.ne_zero
add_mem' := fun hf hg n => (frobenius_add R p _ _).trans <| congr_argβ _ (hf n) (hg n) }
#align ring.perfection_subsemiring Ring.perfectionSubsemiring
def Ring.perfectionSubring (R : Type uβ) [CommRing R] (p : β) [hp : Fact p.Prime] [CharP R p] :
Subring (β β R) :=
(Ring.perfectionSubsemiring R p).toSubring fun n => by
simp_rw [β frobenius_def, Pi.neg_apply, Pi.one_apply, RingHom.map_neg, RingHom.map_one]
#align ring.perfection_subring Ring.perfectionSubring
def Ring.Perfection (R : Type uβ) [CommSemiring R] (p : β) : Type uβ :=
{ f // β n : β, (f : β β R) (n + 1) ^ p = f n }
#align ring.perfection Ring.Perfection
namespace Perfection
variable (R : Type uβ) [CommSemiring R] (p : β) [hp : Fact p.Prime] [CharP R p]
instance commSemiring : CommSemiring (Ring.Perfection R p) :=
(Ring.perfectionSubsemiring R p).toCommSemiring
#align perfection.ring.perfection.comm_semiring Perfection.commSemiring
instance charP : CharP (Ring.Perfection R p) p :=
CharP.subsemiring (β β R) p (Ring.perfectionSubsemiring R p)
#align perfection.char_p Perfection.charP
instance ring (R : Type uβ) [CommRing R] [CharP R p] : Ring (Ring.Perfection R p) :=
(Ring.perfectionSubring R p).toRing
#align perfection.ring Perfection.ring
instance commRing (R : Type uβ) [CommRing R] [CharP R p] : CommRing (Ring.Perfection R p) :=
(Ring.perfectionSubring R p).toCommRing
#align perfection.comm_ring Perfection.commRing
instance : Inhabited (Ring.Perfection R p) := β¨0β©
def coeff (n : β) : Ring.Perfection R p β+* R where
toFun f := f.1 n
map_one' := rfl
map_mul' _ _ := rfl
map_zero' := rfl
map_add' _ _ := rfl
#align perfection.coeff Perfection.coeff
variable {R p}
@[ext]
theorem ext {f g : Ring.Perfection R p} (h : β n, coeff R p n f = coeff R p n g) : f = g :=
Subtype.eq <| funext h
#align perfection.ext Perfection.ext
variable (R p)
def pthRoot : Ring.Perfection R p β+* Ring.Perfection R p where
toFun f := β¨fun n => coeff R p (n + 1) f, fun _ => f.2 _β©
map_one' := rfl
map_mul' _ _ := rfl
map_zero' := rfl
map_add' _ _ := rfl
#align perfection.pth_root Perfection.pthRoot
variable {R p}
@[simp]
theorem coeff_mk (f : β β R) (hf) (n : β) : coeff R p n β¨f, hfβ© = f n := rfl
#align perfection.coeff_mk Perfection.coeff_mk
theorem coeff_pthRoot (f : Ring.Perfection R p) (n : β) :
coeff R p n (pthRoot R p f) = coeff R p (n + 1) f := rfl
#align perfection.coeff_pth_root Perfection.coeff_pthRoot
theorem coeff_pow_p (f : Ring.Perfection R p) (n : β) :
coeff R p (n + 1) (f ^ p) = coeff R p n f := by rw [RingHom.map_pow]; exact f.2 n
#align perfection.coeff_pow_p Perfection.coeff_pow_p
theorem coeff_pow_p' (f : Ring.Perfection R p) (n : β) : coeff R p (n + 1) f ^ p = coeff R p n f :=
f.2 n
#align perfection.coeff_pow_p' Perfection.coeff_pow_p'
| Mathlib/RingTheory/Perfection.lean | 137 | 138 | theorem coeff_frobenius (f : Ring.Perfection R p) (n : β) :
coeff R p (n + 1) (frobenius _ p f) = coeff R p n f := by | apply coeff_pow_p f n
| 0.09375 |
import Mathlib.Algebra.Order.Field.Power
import Mathlib.NumberTheory.Padics.PadicVal
#align_import number_theory.padics.padic_norm from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
def padicNorm (p : β) (q : β) : β :=
if q = 0 then 0 else (p : β) ^ (-padicValRat p q)
#align padic_norm padicNorm
namespace padicNorm
open padicValRat
variable {p : β}
@[simp]
protected theorem eq_zpow_of_nonzero {q : β} (hq : q β 0) :
padicNorm p q = (p : β) ^ (-padicValRat p q) := by simp [hq, padicNorm]
#align padic_norm.eq_zpow_of_nonzero padicNorm.eq_zpow_of_nonzero
protected theorem nonneg (q : β) : 0 β€ padicNorm p q :=
if hq : q = 0 then by simp [hq, padicNorm]
else by
unfold padicNorm
split_ifs
apply zpow_nonneg
exact mod_cast Nat.zero_le _
#align padic_norm.nonneg padicNorm.nonneg
@[simp]
protected theorem zero : padicNorm p 0 = 0 := by simp [padicNorm]
#align padic_norm.zero padicNorm.zero
-- @[simp] -- Porting note (#10618): simp can prove this
protected theorem one : padicNorm p 1 = 1 := by simp [padicNorm]
#align padic_norm.one padicNorm.one
| Mathlib/NumberTheory/Padics/PadicNorm.lean | 81 | 82 | theorem padicNorm_p (hp : 1 < p) : padicNorm p p = (p : β)β»ΒΉ := by |
simp [padicNorm, (pos_of_gt hp).ne', padicValNat.self hp]
| 0.09375 |
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.Order.Interval.Set.Basic
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Data.Set.Lattice
#align_import data.set.intervals.pi from "leanprover-community/mathlib"@"e4bc74cbaf429d706cb9140902f7ca6c431e75a4"
-- Porting note: Added, since dot notation no longer works on `Function.update`
open Function
variable {ΞΉ : Type*} {Ξ± : ΞΉ β Type*}
namespace Set
section PiPreorder
variable [β i, Preorder (Ξ± i)] (x y : β i, Ξ± i)
@[simp]
theorem pi_univ_Ici : (pi univ fun i β¦ Ici (x i)) = Ici x :=
ext fun y β¦ by simp [Pi.le_def]
#align set.pi_univ_Ici Set.pi_univ_Ici
@[simp]
theorem pi_univ_Iic : (pi univ fun i β¦ Iic (x i)) = Iic x :=
ext fun y β¦ by simp [Pi.le_def]
#align set.pi_univ_Iic Set.pi_univ_Iic
@[simp]
theorem pi_univ_Icc : (pi univ fun i β¦ Icc (x i) (y i)) = Icc x y :=
ext fun y β¦ by simp [Pi.le_def, forall_and]
#align set.pi_univ_Icc Set.pi_univ_Icc
theorem piecewise_mem_Icc {s : Set ΞΉ} [β j, Decidable (j β s)] {fβ fβ gβ gβ : β i, Ξ± i}
(hβ : β i β s, fβ i β Icc (gβ i) (gβ i)) (hβ : β i β s, fβ i β Icc (gβ i) (gβ i)) :
s.piecewise fβ fβ β Icc gβ gβ :=
β¨le_piecewise (fun i hi β¦ (hβ i hi).1) fun i hi β¦ (hβ i hi).1,
piecewise_le (fun i hi β¦ (hβ i hi).2) fun i hi β¦ (hβ i hi).2β©
#align set.piecewise_mem_Icc Set.piecewise_mem_Icc
theorem piecewise_mem_Icc' {s : Set ΞΉ} [β j, Decidable (j β s)] {fβ fβ gβ gβ : β i, Ξ± i}
(hβ : fβ β Icc gβ gβ) (hβ : fβ β Icc gβ gβ) : s.piecewise fβ fβ β Icc gβ gβ :=
piecewise_mem_Icc (fun _ _ β¦ β¨hβ.1 _, hβ.2 _β©) fun _ _ β¦ β¨hβ.1 _, hβ.2 _β©
#align set.piecewise_mem_Icc' Set.piecewise_mem_Icc'
variable [DecidableEq ΞΉ]
open Function (update)
| Mathlib/Order/Interval/Set/Pi.lean | 90 | 98 | theorem pi_univ_Ioc_update_left {x y : β i, Ξ± i} {iβ : ΞΉ} {m : Ξ± iβ} (hm : x iβ β€ m) :
(pi univ fun i β¦ Ioc (update x iβ m i) (y i)) =
{ z | m < z iβ } β© pi univ fun i β¦ Ioc (x i) (y i) := by |
have : Ioc m (y iβ) = Ioi m β© Ioc (x iβ) (y iβ) := by
rw [β Ioi_inter_Iic, β Ioi_inter_Iic, β inter_assoc,
inter_eq_self_of_subset_left (Ioi_subset_Ioi hm)]
simp_rw [univ_pi_update iβ _ _ fun i z β¦ Ioc z (y i), β pi_inter_compl ({iβ} : Set ΞΉ),
singleton_pi', β inter_assoc, this]
rfl
| 0.09375 |
import Mathlib.Algebra.MonoidAlgebra.Division
import Mathlib.Algebra.MvPolynomial.Basic
#align_import data.mv_polynomial.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951"
variable {Ο R : Type*} [CommSemiring R]
namespace MvPolynomial
theorem monomial_dvd_monomial {r s : R} {i j : Ο ββ β} :
monomial i r β£ monomial j s β (s = 0 β¨ i β€ j) β§ r β£ s := by
constructor
Β· rintro β¨x, hxβ©
rw [MvPolynomial.ext_iff] at hx
have hj := hx j
have hi := hx i
classical
simp_rw [coeff_monomial, if_pos] at hj hi
simp_rw [coeff_monomial_mul'] at hi hj
split_ifs at hi hj with hi hi
Β· exact β¨Or.inr hi, _, hjβ©
Β· exact β¨Or.inl hj, hj.symm βΈ dvd_zero _β©
-- Porting note: two goals remain at this point in Lean 4
Β· simp_all only [or_true, dvd_mul_right, and_self]
Β· simp_all only [ite_self, le_refl, ite_true, dvd_mul_right, or_false, and_self]
Β· rintro β¨h | hij, d, rflβ©
Β· simp_rw [h, monomial_zero, dvd_zero]
Β· refine β¨monomial (j - i) d, ?_β©
rw [monomial_mul, add_tsub_cancel_of_le hij]
#align mv_polynomial.monomial_dvd_monomial MvPolynomial.monomial_dvd_monomial
@[simp]
| Mathlib/Algebra/MvPolynomial/Division.lean | 244 | 247 | theorem monomial_one_dvd_monomial_one [Nontrivial R] {i j : Ο ββ β} :
monomial i (1 : R) β£ monomial j 1 β i β€ j := by |
rw [monomial_dvd_monomial]
simp_rw [one_ne_zero, false_or_iff, dvd_rfl, and_true_iff]
| 0.09375 |
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.Algebra.Star.Unitary
import Mathlib.Data.Nat.ModEq
import Mathlib.NumberTheory.Zsqrtd.Basic
import Mathlib.Tactic.Monotonicity
#align_import number_theory.pell_matiyasevic from "leanprover-community/mathlib"@"795b501869b9fa7aa716d5fdadd00c03f983a605"
namespace Pell
open Nat
section
variable {d : β€}
def IsPell : β€βd β Prop
| β¨x, yβ© => x * x - d * y * y = 1
#align pell.is_pell Pell.IsPell
theorem isPell_norm : β {b : β€βd}, IsPell b β b * star b = 1
| β¨x, yβ© => by simp [Zsqrtd.ext_iff, IsPell, mul_comm]; ring_nf
#align pell.is_pell_norm Pell.isPell_norm
theorem isPell_iff_mem_unitary : β {b : β€βd}, IsPell b β b β unitary (β€βd)
| β¨x, yβ© => by rw [unitary.mem_iff, isPell_norm, mul_comm (star _), and_self_iff]
#align pell.is_pell_iff_mem_unitary Pell.isPell_iff_mem_unitary
theorem isPell_mul {b c : β€βd} (hb : IsPell b) (hc : IsPell c) : IsPell (b * c) :=
isPell_norm.2 (by simp [mul_comm, mul_left_comm c, mul_assoc,
star_mul, isPell_norm.1 hb, isPell_norm.1 hc])
#align pell.is_pell_mul Pell.isPell_mul
theorem isPell_star : β {b : β€βd}, IsPell b β IsPell (star b)
| β¨x, yβ© => by simp [IsPell, Zsqrtd.star_mk]
#align pell.is_pell_star Pell.isPell_star
end
section
-- Porting note: was parameter in Lean3
variable {a : β} (a1 : 1 < a)
private def d (_a1 : 1 < a) :=
a * a - 1
@[simp]
theorem d_pos : 0 < d a1 :=
tsub_pos_of_lt (mul_lt_mul a1 (le_of_lt a1) (by decide) (Nat.zero_le _) : 1 * 1 < a * a)
#align pell.d_pos Pell.d_pos
-- TODO(lint): Fix double namespace issue
--@[nolint dup_namespace]
def pell : β β β Γ β
-- Porting note: used pattern matching because `Nat.recOn` is noncomputable
| 0 => (1, 0)
| n+1 => ((pell n).1 * a + d a1 * (pell n).2, (pell n).1 + (pell n).2 * a)
#align pell.pell Pell.pell
def xn (n : β) : β :=
(pell a1 n).1
#align pell.xn Pell.xn
def yn (n : β) : β :=
(pell a1 n).2
#align pell.yn Pell.yn
@[simp]
theorem pell_val (n : β) : pell a1 n = (xn a1 n, yn a1 n) :=
show pell a1 n = ((pell a1 n).1, (pell a1 n).2) from
match pell a1 n with
| (_, _) => rfl
#align pell.pell_val Pell.pell_val
@[simp]
theorem xn_zero : xn a1 0 = 1 :=
rfl
#align pell.xn_zero Pell.xn_zero
@[simp]
theorem yn_zero : yn a1 0 = 0 :=
rfl
#align pell.yn_zero Pell.yn_zero
@[simp]
theorem xn_succ (n : β) : xn a1 (n + 1) = xn a1 n * a + d a1 * yn a1 n :=
rfl
#align pell.xn_succ Pell.xn_succ
@[simp]
theorem yn_succ (n : β) : yn a1 (n + 1) = xn a1 n + yn a1 n * a :=
rfl
#align pell.yn_succ Pell.yn_succ
--@[simp] Porting note (#10618): `simp` can prove it
| Mathlib/NumberTheory/PellMatiyasevic.lean | 151 | 151 | theorem xn_one : xn a1 1 = a := by | simp
| 0.09375 |
import Mathlib.LinearAlgebra.Span
import Mathlib.RingTheory.Ideal.IsPrimary
import Mathlib.RingTheory.Ideal.QuotientOperations
import Mathlib.RingTheory.Noetherian
#align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M]
def IsAssociatedPrime : Prop :=
I.IsPrime β§ β x : M, I = (R β x).annihilator
#align is_associated_prime IsAssociatedPrime
variable (R)
def associatedPrimes : Set (Ideal R) :=
{ I | IsAssociatedPrime I M }
#align associated_primes associatedPrimes
variable {I J M R}
variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M ββ[R] M')
theorem AssociatePrimes.mem_iff : I β associatedPrimes R M β IsAssociatedPrime I M := Iff.rfl
#align associate_primes.mem_iff AssociatePrimes.mem_iff
theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1
#align is_associated_prime.is_prime IsAssociatedPrime.isPrime
theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) :
IsAssociatedPrime I M' := by
obtain β¨x, rflβ© := h.2
refine β¨h.1, β¨f x, ?_β©β©
ext r
rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, β
map_smul, β f.map_zero, hf.eq_iff]
#align is_associated_prime.map_of_injective IsAssociatedPrime.map_of_injective
theorem LinearEquiv.isAssociatedPrime_iff (l : M ββ[R] M') :
IsAssociatedPrime I M β IsAssociatedPrime I M' :=
β¨fun h => h.map_of_injective l l.injective,
fun h => h.map_of_injective l.symm l.symm.injectiveβ©
#align linear_equiv.is_associated_prime_iff LinearEquiv.isAssociatedPrime_iff
theorem not_isAssociatedPrime_of_subsingleton [Subsingleton M] : Β¬IsAssociatedPrime I M := by
rintro β¨hI, x, hxβ©
apply hI.ne_top
rwa [Subsingleton.elim x 0, Submodule.span_singleton_eq_bot.mpr rfl, Submodule.annihilator_bot]
at hx
#align not_is_associated_prime_of_subsingleton not_isAssociatedPrime_of_subsingleton
variable (R)
theorem exists_le_isAssociatedPrime_of_isNoetherianRing [H : IsNoetherianRing R] (x : M)
(hx : x β 0) : β P : Ideal R, IsAssociatedPrime P M β§ (R β x).annihilator β€ P := by
have : (R β x).annihilator β β€ := by
rwa [Ne, Ideal.eq_top_iff_one, Submodule.mem_annihilator_span_singleton, one_smul]
obtain β¨P, β¨l, hβ, y, rflβ©, hββ© :=
set_has_maximal_iff_noetherian.mpr H
{ P | (R β x).annihilator β€ P β§ P β β€ β§ β y : M, P = (R β y).annihilator }
β¨(R β x).annihilator, rfl.le, this, x, rflβ©
refine β¨_, β¨β¨hβ, ?_β©, y, rflβ©, lβ©
intro a b hab
rw [or_iff_not_imp_left]
intro ha
rw [Submodule.mem_annihilator_span_singleton] at ha hab
have Hβ : (R β y).annihilator β€ (R β a β’ y).annihilator := by
intro c hc
rw [Submodule.mem_annihilator_span_singleton] at hc β’
rw [smul_comm, hc, smul_zero]
have Hβ : (Submodule.span R {a β’ y}).annihilator β β€ := by
rwa [Ne, Submodule.annihilator_eq_top_iff, Submodule.span_singleton_eq_bot]
rwa [Hβ.eq_of_not_lt (hβ (R β a β’ y).annihilator β¨l.trans Hβ, Hβ, _, rflβ©),
Submodule.mem_annihilator_span_singleton, smul_comm, smul_smul]
#align exists_le_is_associated_prime_of_is_noetherian_ring exists_le_isAssociatedPrime_of_isNoetherianRing
variable {R}
theorem associatedPrimes.subset_of_injective (hf : Function.Injective f) :
associatedPrimes R M β associatedPrimes R M' := fun _I h => h.map_of_injective f hf
#align associated_primes.subset_of_injective associatedPrimes.subset_of_injective
theorem LinearEquiv.AssociatedPrimes.eq (l : M ββ[R] M') :
associatedPrimes R M = associatedPrimes R M' :=
le_antisymm (associatedPrimes.subset_of_injective l l.injective)
(associatedPrimes.subset_of_injective l.symm l.symm.injective)
#align linear_equiv.associated_primes.eq LinearEquiv.AssociatedPrimes.eq
| Mathlib/RingTheory/Ideal/AssociatedPrime.lean | 118 | 120 | theorem associatedPrimes.eq_empty_of_subsingleton [Subsingleton M] : associatedPrimes R M = β
:= by |
ext; simp only [Set.mem_empty_iff_false, iff_false_iff];
apply not_isAssociatedPrime_of_subsingleton
| 0.09375 |
import Mathlib.Combinatorics.SimpleGraph.Basic
namespace SimpleGraph
variable {V : Type*} (G : SimpleGraph V)
structure Dart extends V Γ V where
adj : G.Adj fst snd
deriving DecidableEq
#align simple_graph.dart SimpleGraph.Dart
initialize_simps_projections Dart (+toProd, -fst, -snd)
attribute [simp] Dart.adj
variable {G}
theorem Dart.ext_iff (dβ dβ : G.Dart) : dβ = dβ β dβ.toProd = dβ.toProd := by
cases dβ; cases dβ; simp
#align simple_graph.dart.ext_iff SimpleGraph.Dart.ext_iff
@[ext]
theorem Dart.ext (dβ dβ : G.Dart) (h : dβ.toProd = dβ.toProd) : dβ = dβ :=
(Dart.ext_iff dβ dβ).mpr h
#align simple_graph.dart.ext SimpleGraph.Dart.ext
-- Porting note: deleted `Dart.fst` and `Dart.snd` since they are now invalid declaration names,
-- even though there is not actually a `SimpleGraph.Dart.fst` or `SimpleGraph.Dart.snd`.
theorem Dart.toProd_injective : Function.Injective (Dart.toProd : G.Dart β V Γ V) :=
Dart.ext
#align simple_graph.dart.to_prod_injective SimpleGraph.Dart.toProd_injective
instance Dart.fintype [Fintype V] [DecidableRel G.Adj] : Fintype G.Dart :=
Fintype.ofEquiv (Ξ£ v, G.neighborSet v)
{ toFun := fun s => β¨(s.fst, s.snd), s.snd.propertyβ©
invFun := fun d => β¨d.fst, d.snd, d.adjβ©
left_inv := fun s => by ext <;> simp
right_inv := fun d => by ext <;> simp }
#align simple_graph.dart.fintype SimpleGraph.Dart.fintype
def Dart.edge (d : G.Dart) : Sym2 V :=
Sym2.mk d.toProd
#align simple_graph.dart.edge SimpleGraph.Dart.edge
@[simp]
theorem Dart.edge_mk {p : V Γ V} (h : G.Adj p.1 p.2) : (Dart.mk p h).edge = Sym2.mk p :=
rfl
#align simple_graph.dart.edge_mk SimpleGraph.Dart.edge_mk
@[simp]
theorem Dart.edge_mem (d : G.Dart) : d.edge β G.edgeSet :=
d.adj
#align simple_graph.dart.edge_mem SimpleGraph.Dart.edge_mem
@[simps]
def Dart.symm (d : G.Dart) : G.Dart :=
β¨d.toProd.swap, G.symm d.adjβ©
#align simple_graph.dart.symm SimpleGraph.Dart.symm
@[simp]
theorem Dart.symm_mk {p : V Γ V} (h : G.Adj p.1 p.2) : (Dart.mk p h).symm = Dart.mk p.swap h.symm :=
rfl
#align simple_graph.dart.symm_mk SimpleGraph.Dart.symm_mk
@[simp]
theorem Dart.edge_symm (d : G.Dart) : d.symm.edge = d.edge :=
Sym2.mk_prod_swap_eq
#align simple_graph.dart.edge_symm SimpleGraph.Dart.edge_symm
@[simp]
theorem Dart.edge_comp_symm : Dart.edge β Dart.symm = (Dart.edge : G.Dart β Sym2 V) :=
funext Dart.edge_symm
#align simple_graph.dart.edge_comp_symm SimpleGraph.Dart.edge_comp_symm
@[simp]
theorem Dart.symm_symm (d : G.Dart) : d.symm.symm = d :=
Dart.ext _ _ <| Prod.swap_swap _
#align simple_graph.dart.symm_symm SimpleGraph.Dart.symm_symm
@[simp]
theorem Dart.symm_involutive : Function.Involutive (Dart.symm : G.Dart β G.Dart) :=
Dart.symm_symm
#align simple_graph.dart.symm_involutive SimpleGraph.Dart.symm_involutive
theorem Dart.symm_ne (d : G.Dart) : d.symm β d :=
ne_of_apply_ne (Prod.snd β Dart.toProd) d.adj.ne
#align simple_graph.dart.symm_ne SimpleGraph.Dart.symm_ne
theorem dart_edge_eq_iff : β dβ dβ : G.Dart, dβ.edge = dβ.edge β dβ = dβ β¨ dβ = dβ.symm := by
rintro β¨p, hpβ© β¨q, hqβ©
simp
#align simple_graph.dart_edge_eq_iff SimpleGraph.dart_edge_eq_iff
theorem dart_edge_eq_mk'_iff :
β {d : G.Dart} {p : V Γ V}, d.edge = Sym2.mk p β d.toProd = p β¨ d.toProd = p.swap := by
rintro β¨p, hβ©
apply Sym2.mk_eq_mk_iff
#align simple_graph.dart_edge_eq_mk_iff SimpleGraph.dart_edge_eq_mk'_iff
| Mathlib/Combinatorics/SimpleGraph/Dart.lean | 118 | 123 | theorem dart_edge_eq_mk'_iff' :
β {d : G.Dart} {u v : V},
d.edge = s(u, v) β d.fst = u β§ d.snd = v β¨ d.fst = v β§ d.snd = u := by |
rintro β¨β¨a, bβ©, hβ© u v
rw [dart_edge_eq_mk'_iff]
simp
| 0.09375 |
import Mathlib.MeasureTheory.Measure.VectorMeasure
import Mathlib.MeasureTheory.Function.AEEqOfIntegral
#align_import measure_theory.measure.with_density_vector_measure from "leanprover-community/mathlib"@"d1bd9c5df2867c1cb463bc6364446d57bdd9f7f1"
noncomputable section
open scoped Classical MeasureTheory NNReal ENNReal
variable {Ξ± Ξ² : Type*} {m : MeasurableSpace Ξ±}
namespace MeasureTheory
open TopologicalSpace
variable {ΞΌ Ξ½ : Measure Ξ±}
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E]
def Measure.withDensityα΅₯ {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (f : Ξ± β E) : VectorMeasure Ξ± E :=
if hf : Integrable f ΞΌ then
{ measureOf' := fun s => if MeasurableSet s then β« x in s, f x βΞΌ else 0
empty' := by simp
not_measurable' := fun s hs => if_neg hs
m_iUnion' := fun s hsβ hsβ => by
dsimp only
convert hasSum_integral_iUnion hsβ hsβ hf.integrableOn with n
Β· rw [if_pos (hsβ n)]
Β· rw [if_pos (MeasurableSet.iUnion hsβ)] }
else 0
#align measure_theory.measure.with_densityα΅₯ MeasureTheory.Measure.withDensityα΅₯
open Measure
variable {f g : Ξ± β E}
theorem withDensityα΅₯_apply (hf : Integrable f ΞΌ) {s : Set Ξ±} (hs : MeasurableSet s) :
ΞΌ.withDensityα΅₯ f s = β« x in s, f x βΞΌ := by rw [withDensityα΅₯, dif_pos hf]; exact dif_pos hs
#align measure_theory.with_densityα΅₯_apply MeasureTheory.withDensityα΅₯_apply
@[simp]
theorem withDensityα΅₯_zero : ΞΌ.withDensityα΅₯ (0 : Ξ± β E) = 0 := by
ext1 s hs; erw [withDensityα΅₯_apply (integrable_zero Ξ± E ΞΌ) hs]; simp
#align measure_theory.with_densityα΅₯_zero MeasureTheory.withDensityα΅₯_zero
@[simp]
| Mathlib/MeasureTheory/Measure/WithDensityVectorMeasure.lean | 69 | 76 | theorem withDensityα΅₯_neg : ΞΌ.withDensityα΅₯ (-f) = -ΞΌ.withDensityα΅₯ f := by |
by_cases hf : Integrable f ΞΌ
Β· ext1 i hi
rw [VectorMeasure.neg_apply, withDensityα΅₯_apply hf hi, β integral_neg,
withDensityα΅₯_apply hf.neg hi]
rfl
Β· rw [withDensityα΅₯, withDensityα΅₯, dif_neg hf, dif_neg, neg_zero]
rwa [integrable_neg_iff]
| 0.09375 |
import Mathlib.Topology.Algebra.GroupWithZero
import Mathlib.Topology.Order.OrderClosed
#align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064"
open Topology Filter TopologicalSpace Filter Set Function
namespace WithZeroTopology
variable {Ξ± Ξβ : Type*} [LinearOrderedCommGroupWithZero Ξβ] {Ξ³ Ξ³β Ξ³β : Ξβ} {l : Filter Ξ±}
{f : Ξ± β Ξβ}
scoped instance (priority := 100) topologicalSpace : TopologicalSpace Ξβ :=
nhdsAdjoint 0 <| β¨
Ξ³ β 0, π (Iio Ξ³)
#align with_zero_topology.topological_space WithZeroTopology.topologicalSpace
theorem nhds_eq_update : (π : Ξβ β Filter Ξβ) = update pure 0 (β¨
Ξ³ β 0, π (Iio Ξ³)) := by
rw [nhds_nhdsAdjoint, sup_of_le_right]
exact le_iInfβ fun Ξ³ hΞ³ β¦ le_principal_iff.2 <| zero_lt_iff.2 hΞ³
#align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update
theorem nhds_zero : π (0 : Ξβ) = β¨
Ξ³ β 0, π (Iio Ξ³) := by
rw [nhds_eq_update, update_same]
#align with_zero_topology.nhds_zero WithZeroTopology.nhds_zero
theorem hasBasis_nhds_zero : (π (0 : Ξβ)).HasBasis (fun Ξ³ : Ξβ => Ξ³ β 0) Iio := by
rw [nhds_zero]
refine hasBasis_biInf_principal ?_ β¨1, one_ne_zeroβ©
exact directedOn_iff_directed.2 (Monotone.directed_ge fun a b hab => Iio_subset_Iio hab)
#align with_zero_topology.has_basis_nhds_zero WithZeroTopology.hasBasis_nhds_zero
theorem Iio_mem_nhds_zero (hΞ³ : Ξ³ β 0) : Iio Ξ³ β π (0 : Ξβ) :=
hasBasis_nhds_zero.mem_of_mem hΞ³
#align with_zero_topology.Iio_mem_nhds_zero WithZeroTopology.Iio_mem_nhds_zero
theorem nhds_zero_of_units (Ξ³ : ΞβΛ£) : Iio βΞ³ β π (0 : Ξβ) :=
Iio_mem_nhds_zero Ξ³.ne_zero
#align with_zero_topology.nhds_zero_of_units WithZeroTopology.nhds_zero_of_units
theorem tendsto_zero : Tendsto f l (π (0 : Ξβ)) β β (Ξ³β) (_ : Ξ³β β 0), βαΆ x in l, f x < Ξ³β := by
simp [nhds_zero]
#align with_zero_topology.tendsto_zero WithZeroTopology.tendsto_zero
@[simp]
theorem nhds_of_ne_zero {Ξ³ : Ξβ} (hβ : Ξ³ β 0) : π Ξ³ = pure Ξ³ :=
nhds_nhdsAdjoint_of_ne _ hβ
#align with_zero_topology.nhds_of_ne_zero WithZeroTopology.nhds_of_ne_zero
theorem nhds_coe_units (Ξ³ : ΞβΛ£) : π (Ξ³ : Ξβ) = pure (Ξ³ : Ξβ) :=
nhds_of_ne_zero Ξ³.ne_zero
#align with_zero_topology.nhds_coe_units WithZeroTopology.nhds_coe_units
theorem singleton_mem_nhds_of_units (Ξ³ : ΞβΛ£) : ({βΞ³} : Set Ξβ) β π (Ξ³ : Ξβ) := by simp
#align with_zero_topology.singleton_mem_nhds_of_units WithZeroTopology.singleton_mem_nhds_of_units
theorem singleton_mem_nhds_of_ne_zero (h : Ξ³ β 0) : ({Ξ³} : Set Ξβ) β π (Ξ³ : Ξβ) := by simp [h]
#align with_zero_topology.singleton_mem_nhds_of_ne_zero WithZeroTopology.singleton_mem_nhds_of_ne_zero
theorem hasBasis_nhds_of_ne_zero {x : Ξβ} (h : x β 0) :
HasBasis (π x) (fun _ : Unit => True) fun _ => {x} := by
rw [nhds_of_ne_zero h]
exact hasBasis_pure _
#align with_zero_topology.has_basis_nhds_of_ne_zero WithZeroTopology.hasBasis_nhds_of_ne_zero
theorem hasBasis_nhds_units (Ξ³ : ΞβΛ£) :
HasBasis (π (Ξ³ : Ξβ)) (fun _ : Unit => True) fun _ => {βΞ³} :=
hasBasis_nhds_of_ne_zero Ξ³.ne_zero
#align with_zero_topology.has_basis_nhds_units WithZeroTopology.hasBasis_nhds_units
theorem tendsto_of_ne_zero {Ξ³ : Ξβ} (h : Ξ³ β 0) : Tendsto f l (π Ξ³) β βαΆ x in l, f x = Ξ³ := by
rw [nhds_of_ne_zero h, tendsto_pure]
#align with_zero_topology.tendsto_of_ne_zero WithZeroTopology.tendsto_of_ne_zero
theorem tendsto_units {Ξ³β : ΞβΛ£} : Tendsto f l (π (Ξ³β : Ξβ)) β βαΆ x in l, f x = Ξ³β :=
tendsto_of_ne_zero Ξ³β.ne_zero
#align with_zero_topology.tendsto_units WithZeroTopology.tendsto_units
theorem Iio_mem_nhds (h : Ξ³β < Ξ³β) : Iio Ξ³β β π Ξ³β := by
rcases eq_or_ne Ξ³β 0 with (rfl | hβ) <;> simp [*, h.ne', Iio_mem_nhds_zero]
#align with_zero_topology.Iio_mem_nhds WithZeroTopology.Iio_mem_nhds
theorem isOpen_iff {s : Set Ξβ} : IsOpen s β (0 : Ξβ) β s β¨ β Ξ³, Ξ³ β 0 β§ Iio Ξ³ β s := by
rw [isOpen_iff_mem_nhds, β and_forall_ne (0 : Ξβ)]
simp (config := { contextual := true }) [nhds_of_ne_zero, imp_iff_not_or,
hasBasis_nhds_zero.mem_iff]
#align with_zero_topology.is_open_iff WithZeroTopology.isOpen_iff
| Mathlib/Topology/Algebra/WithZeroTopology.lean | 142 | 144 | theorem isClosed_iff {s : Set Ξβ} : IsClosed s β (0 : Ξβ) β s β¨ β Ξ³, Ξ³ β 0 β§ s β Ici Ξ³ := by |
simp only [β isOpen_compl_iff, isOpen_iff, mem_compl_iff, not_not, β compl_Ici,
compl_subset_compl]
| 0.09375 |
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp
#align_import measure_theory.integral.set_to_l1 from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical Topology NNReal ENNReal MeasureTheory Pointwise
open Set Filter TopologicalSpace ENNReal EMetric
namespace MeasureTheory
variable {Ξ± E F F' G π : Type*} {p : ββ₯0β} [NormedAddCommGroup E] [NormedSpace β E]
[NormedAddCommGroup F] [NormedSpace β F] [NormedAddCommGroup F'] [NormedSpace β F']
[NormedAddCommGroup G] {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±}
local infixr:25 " ββ " => SimpleFunc
open Finset
section FinMeasAdditive
def FinMeasAdditive {Ξ²} [AddMonoid Ξ²] {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (T : Set Ξ± β Ξ²) :
Prop :=
β s t, MeasurableSet s β MeasurableSet t β ΞΌ s β β β ΞΌ t β β β s β© t = β
β T (s βͺ t) = T s + T t
#align measure_theory.fin_meas_additive MeasureTheory.FinMeasAdditive
namespace FinMeasAdditive
variable {Ξ² : Type*} [AddCommMonoid Ξ²] {T T' : Set Ξ± β Ξ²}
theorem zero : FinMeasAdditive ΞΌ (0 : Set Ξ± β Ξ²) := fun s t _ _ _ _ _ => by simp
#align measure_theory.fin_meas_additive.zero MeasureTheory.FinMeasAdditive.zero
theorem add (hT : FinMeasAdditive ΞΌ T) (hT' : FinMeasAdditive ΞΌ T') :
FinMeasAdditive ΞΌ (T + T') := by
intro s t hs ht hΞΌs hΞΌt hst
simp only [hT s t hs ht hΞΌs hΞΌt hst, hT' s t hs ht hΞΌs hΞΌt hst, Pi.add_apply]
abel
#align measure_theory.fin_meas_additive.add MeasureTheory.FinMeasAdditive.add
theorem smul [Monoid π] [DistribMulAction π Ξ²] (hT : FinMeasAdditive ΞΌ T) (c : π) :
FinMeasAdditive ΞΌ fun s => c β’ T s := fun s t hs ht hΞΌs hΞΌt hst => by
simp [hT s t hs ht hΞΌs hΞΌt hst]
#align measure_theory.fin_meas_additive.smul MeasureTheory.FinMeasAdditive.smul
theorem of_eq_top_imp_eq_top {ΞΌ' : Measure Ξ±} (h : β s, MeasurableSet s β ΞΌ s = β β ΞΌ' s = β)
(hT : FinMeasAdditive ΞΌ T) : FinMeasAdditive ΞΌ' T := fun s t hs ht hΞΌ's hΞΌ't hst =>
hT s t hs ht (mt (h s hs) hΞΌ's) (mt (h t ht) hΞΌ't) hst
#align measure_theory.fin_meas_additive.of_eq_top_imp_eq_top MeasureTheory.FinMeasAdditive.of_eq_top_imp_eq_top
theorem of_smul_measure (c : ββ₯0β) (hc_ne_top : c β β) (hT : FinMeasAdditive (c β’ ΞΌ) T) :
FinMeasAdditive ΞΌ T := by
refine of_eq_top_imp_eq_top (fun s _ hΞΌs => ?_) hT
rw [Measure.smul_apply, smul_eq_mul, ENNReal.mul_eq_top] at hΞΌs
simp only [hc_ne_top, or_false_iff, Ne, false_and_iff] at hΞΌs
exact hΞΌs.2
#align measure_theory.fin_meas_additive.of_smul_measure MeasureTheory.FinMeasAdditive.of_smul_measure
| Mathlib/MeasureTheory/Integral/SetToL1.lean | 130 | 135 | theorem smul_measure (c : ββ₯0β) (hc_ne_zero : c β 0) (hT : FinMeasAdditive ΞΌ T) :
FinMeasAdditive (c β’ ΞΌ) T := by |
refine of_eq_top_imp_eq_top (fun s _ hΞΌs => ?_) hT
rw [Measure.smul_apply, smul_eq_mul, ENNReal.mul_eq_top]
simp only [hc_ne_zero, true_and_iff, Ne, not_false_iff]
exact Or.inl hΞΌs
| 0.09375 |
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Finset.Powerset
#align_import data.fintype.list from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
variable {Ξ± : Type*} [DecidableEq Ξ±]
open List
namespace Multiset
def lists : Multiset Ξ± β Finset (List Ξ±) := fun s =>
Quotient.liftOn s (fun l => l.permutations.toFinset) fun l l' (h : l ~ l') => by
ext sl
simp only [mem_permutations, List.mem_toFinset]
exact β¨fun hs => hs.trans h, fun hs => hs.trans h.symmβ©
#align multiset.lists Multiset.lists
@[simp]
theorem lists_coe (l : List Ξ±) : lists (l : Multiset Ξ±) = l.permutations.toFinset :=
rfl
#align multiset.lists_coe Multiset.lists_coe
@[simp]
| Mathlib/Data/Fintype/List.lean | 51 | 53 | theorem mem_lists_iff (s : Multiset Ξ±) (l : List Ξ±) : l β lists s β s = β¦lβ§ := by |
induction s using Quotient.inductionOn
simpa using perm_comm
| 0.09375 |
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic
import Mathlib.Analysis.NormedSpace.Pointwise
#align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
open Metric
variable {π : Type*} [RCLike π] {E : Type*} [NormedAddCommGroup E]
theorem RCLike.norm_coe_norm {z : E} : β(βzβ : π)β = βzβ := by simp
#align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm
variable [NormedSpace π E]
@[simp]
theorem norm_smul_inv_norm {x : E} (hx : x β 0) : β(βxββ»ΒΉ : π) β’ xβ = 1 := by
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul]
#align norm_smul_inv_norm norm_smul_inv_norm
theorem norm_smul_inv_norm' {r : β} (r_nonneg : 0 β€ r) {x : E} (hx : x β 0) :
β((r : π) * (βxβ : π)β»ΒΉ) β’ xβ = r := by
have : βxβ β 0 := by simp [hx]
field_simp [norm_smul, r_nonneg, rclike_simps]
#align norm_smul_inv_norm' norm_smul_inv_norm'
theorem LinearMap.bound_of_sphere_bound {r : β} (r_pos : 0 < r) (c : β) (f : E ββ[π] π)
(h : β z β sphere (0 : E) r, βf zβ β€ c) (z : E) : βf zβ β€ c / r * βzβ := by
by_cases z_zero : z = 0
Β· rw [z_zero]
simp only [LinearMap.map_zero, norm_zero, mul_zero]
exact le_rfl
set zβ := ((r : π) * (βzβ : π)β»ΒΉ) β’ z with hzβ
have norm_f_zβ : βf zββ β€ c := by
apply h
rw [mem_sphere_zero_iff_norm]
exact norm_smul_inv_norm' r_pos.le z_zero
have r_ne_zero : (r : π) β 0 := RCLike.ofReal_ne_zero.mpr r_pos.ne'
have eq : f z = βzβ / r * f zβ := by
rw [hzβ, LinearMap.map_smul, smul_eq_mul]
rw [β mul_assoc, β mul_assoc, div_mul_cancelβ _ r_ne_zero, mul_inv_cancel, one_mul]
simp only [z_zero, RCLike.ofReal_eq_zero, norm_eq_zero, Ne, not_false_iff]
rw [eq, norm_mul, norm_div, RCLike.norm_coe_norm, RCLike.norm_of_nonneg r_pos.le,
div_mul_eq_mul_div, div_mul_eq_mul_div, mul_comm]
apply div_le_div _ _ r_pos rfl.ge
Β· exact mul_nonneg ((norm_nonneg _).trans norm_f_zβ) (norm_nonneg z)
apply mul_le_mul norm_f_zβ rfl.le (norm_nonneg z) ((norm_nonneg _).trans norm_f_zβ)
#align linear_map.bound_of_sphere_bound LinearMap.bound_of_sphere_bound
theorem LinearMap.bound_of_ball_bound' {r : β} (r_pos : 0 < r) (c : β) (f : E ββ[π] π)
(h : β z β closedBall (0 : E) r, βf zβ β€ c) (z : E) : βf zβ β€ c / r * βzβ :=
f.bound_of_sphere_bound r_pos c (fun z hz => h z hz.le) z
#align linear_map.bound_of_ball_bound' LinearMap.bound_of_ball_bound'
| Mathlib/Analysis/NormedSpace/RCLike.lean | 85 | 93 | theorem ContinuousLinearMap.opNorm_bound_of_ball_bound {r : β} (r_pos : 0 < r) (c : β)
(f : E βL[π] π) (h : β z β closedBall (0 : E) r, βf zβ β€ c) : βfβ β€ c / r := by |
apply ContinuousLinearMap.opNorm_le_bound
Β· apply div_nonneg _ r_pos.le
exact
(norm_nonneg _).trans
(h 0 (by simp only [norm_zero, mem_closedBall, dist_zero_left, r_pos.le]))
apply LinearMap.bound_of_ball_bound' r_pos
exact fun z hz => h z hz
| 0.09375 |
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic
import Mathlib.Topology.Order.ProjIcc
#align_import analysis.special_functions.trigonometric.inverse from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical
open Topology Filter
open Set Filter
open Real
namespace Real
variable {x y : β}
-- @[pp_nodot] Porting note: not implemented
noncomputable def arcsin : β β β :=
Subtype.val β IccExtend (neg_le_self zero_le_one) sinOrderIso.symm
#align real.arcsin Real.arcsin
theorem arcsin_mem_Icc (x : β) : arcsin x β Icc (-(Ο / 2)) (Ο / 2) :=
Subtype.coe_prop _
#align real.arcsin_mem_Icc Real.arcsin_mem_Icc
@[simp]
theorem range_arcsin : range arcsin = Icc (-(Ο / 2)) (Ο / 2) := by
rw [arcsin, range_comp Subtype.val]
simp [Icc]
#align real.range_arcsin Real.range_arcsin
theorem arcsin_le_pi_div_two (x : β) : arcsin x β€ Ο / 2 :=
(arcsin_mem_Icc x).2
#align real.arcsin_le_pi_div_two Real.arcsin_le_pi_div_two
theorem neg_pi_div_two_le_arcsin (x : β) : -(Ο / 2) β€ arcsin x :=
(arcsin_mem_Icc x).1
#align real.neg_pi_div_two_le_arcsin Real.neg_pi_div_two_le_arcsin
theorem arcsin_projIcc (x : β) :
arcsin (projIcc (-1) 1 (neg_le_self zero_le_one) x) = arcsin x := by
rw [arcsin, Function.comp_apply, IccExtend_val, Function.comp_apply, IccExtend,
Function.comp_apply]
#align real.arcsin_proj_Icc Real.arcsin_projIcc
theorem sin_arcsin' {x : β} (hx : x β Icc (-1 : β) 1) : sin (arcsin x) = x := by
simpa [arcsin, IccExtend_of_mem _ _ hx, -OrderIso.apply_symm_apply] using
Subtype.ext_iff.1 (sinOrderIso.apply_symm_apply β¨x, hxβ©)
#align real.sin_arcsin' Real.sin_arcsin'
theorem sin_arcsin {x : β} (hxβ : -1 β€ x) (hxβ : x β€ 1) : sin (arcsin x) = x :=
sin_arcsin' β¨hxβ, hxββ©
#align real.sin_arcsin Real.sin_arcsin
theorem arcsin_sin' {x : β} (hx : x β Icc (-(Ο / 2)) (Ο / 2)) : arcsin (sin x) = x :=
injOn_sin (arcsin_mem_Icc _) hx <| by rw [sin_arcsin (neg_one_le_sin _) (sin_le_one _)]
#align real.arcsin_sin' Real.arcsin_sin'
theorem arcsin_sin {x : β} (hxβ : -(Ο / 2) β€ x) (hxβ : x β€ Ο / 2) : arcsin (sin x) = x :=
arcsin_sin' β¨hxβ, hxββ©
#align real.arcsin_sin Real.arcsin_sin
theorem strictMonoOn_arcsin : StrictMonoOn arcsin (Icc (-1) 1) :=
(Subtype.strictMono_coe _).comp_strictMonoOn <|
sinOrderIso.symm.strictMono.strictMonoOn_IccExtend _
#align real.strict_mono_on_arcsin Real.strictMonoOn_arcsin
theorem monotone_arcsin : Monotone arcsin :=
(Subtype.mono_coe _).comp <| sinOrderIso.symm.monotone.IccExtend _
#align real.monotone_arcsin Real.monotone_arcsin
theorem injOn_arcsin : InjOn arcsin (Icc (-1) 1) :=
strictMonoOn_arcsin.injOn
#align real.inj_on_arcsin Real.injOn_arcsin
theorem arcsin_inj {x y : β} (hxβ : -1 β€ x) (hxβ : x β€ 1) (hyβ : -1 β€ y) (hyβ : y β€ 1) :
arcsin x = arcsin y β x = y :=
injOn_arcsin.eq_iff β¨hxβ, hxββ© β¨hyβ, hyββ©
#align real.arcsin_inj Real.arcsin_inj
@[continuity]
theorem continuous_arcsin : Continuous arcsin :=
continuous_subtype_val.comp sinOrderIso.symm.continuous.Icc_extend'
#align real.continuous_arcsin Real.continuous_arcsin
theorem continuousAt_arcsin {x : β} : ContinuousAt arcsin x :=
continuous_arcsin.continuousAt
#align real.continuous_at_arcsin Real.continuousAt_arcsin
| Mathlib/Analysis/SpecialFunctions/Trigonometric/Inverse.lean | 108 | 111 | theorem arcsin_eq_of_sin_eq {x y : β} (hβ : sin x = y) (hβ : x β Icc (-(Ο / 2)) (Ο / 2)) :
arcsin y = x := by |
subst y
exact injOn_sin (arcsin_mem_Icc _) hβ (sin_arcsin' (sin_mem_Icc x))
| 0.09375 |
import Mathlib.CategoryTheory.Filtered.Connected
import Mathlib.CategoryTheory.Limits.TypesFiltered
import Mathlib.CategoryTheory.Limits.Final
universe vβ vβ uβ uβ
namespace CategoryTheory
open CategoryTheory.Limits CategoryTheory.Functor Opposite
section ArbitraryUniverses
variable {C : Type uβ} [Category.{vβ} C] {D : Type uβ} [Category.{vβ} D] (F : C β₯€ D)
theorem Functor.final_of_isFiltered_structuredArrow [β d, IsFiltered (StructuredArrow d F)] :
Final F where
out _ := IsFiltered.isConnected _
theorem Functor.initial_of_isCofiltered_costructuredArrow
[β d, IsCofiltered (CostructuredArrow F d)] : Initial F where
out _ := IsCofiltered.isConnected _
theorem isFiltered_structuredArrow_of_isFiltered_of_exists [IsFilteredOrEmpty C]
(hβ : β d, β c, Nonempty (d βΆ F.obj c)) (hβ : β {d : D} {c : C} (s s' : d βΆ F.obj c),
β (c' : C) (t : c βΆ c'), s β« F.map t = s' β« F.map t) (d : D) :
IsFiltered (StructuredArrow d F) := by
have : Nonempty (StructuredArrow d F) := by
obtain β¨c, β¨fβ©β© := hβ d
exact β¨.mk fβ©
suffices IsFilteredOrEmpty (StructuredArrow d F) from IsFiltered.mk
refine β¨fun f g => ?_, fun f g Ξ· ΞΌ => ?_β©
Β· obtain β¨c, β¨t, htβ©β© := hβ (f.hom β« F.map (IsFiltered.leftToMax f.right g.right))
(g.hom β« F.map (IsFiltered.rightToMax f.right g.right))
refine β¨.mk (f.hom β« F.map (IsFiltered.leftToMax f.right g.right β« t)), ?_, ?_, trivialβ©
Β· exact StructuredArrow.homMk (IsFiltered.leftToMax _ _ β« t) rfl
Β· exact StructuredArrow.homMk (IsFiltered.rightToMax _ _ β« t) (by simpa using ht.symm)
Β· refine β¨.mk (f.hom β« F.map (Ξ·.right β« IsFiltered.coeqHom Ξ·.right ΞΌ.right)),
StructuredArrow.homMk (IsFiltered.coeqHom Ξ·.right ΞΌ.right) (by simp), ?_β©
simpa using IsFiltered.coeq_condition _ _
theorem isCofiltered_costructuredArrow_of_isCofiltered_of_exists [IsCofilteredOrEmpty C]
(hβ : β d, β c, Nonempty (F.obj c βΆ d)) (hβ : β {d : D} {c : C} (s s' : F.obj c βΆ d),
β (c' : C) (t : c' βΆ c), F.map t β« s = F.map t β« s') (d : D) :
IsCofiltered (CostructuredArrow F d) := by
suffices IsFiltered (CostructuredArrow F d)α΅α΅ from isCofiltered_of_isFiltered_op _
suffices IsFiltered (StructuredArrow (op d) F.op) from
IsFiltered.of_equivalence (costructuredArrowOpEquivalence _ _).symm
apply isFiltered_structuredArrow_of_isFiltered_of_exists
Β· intro d
obtain β¨c, β¨tβ©β© := hβ d.unop
exact β¨op c, β¨Quiver.Hom.op tβ©β©
Β· intro d c s s'
obtain β¨c', t, htβ© := hβ s.unop s'.unop
exact β¨op c', Quiver.Hom.op t, Quiver.Hom.unop_inj htβ©
| Mathlib/CategoryTheory/Filtered/Final.lean | 91 | 95 | theorem Functor.final_of_exists_of_isFiltered [IsFilteredOrEmpty C]
(hβ : β d, β c, Nonempty (d βΆ F.obj c)) (hβ : β {d : D} {c : C} (s s' : d βΆ F.obj c),
β (c' : C) (t : c βΆ c'), s β« F.map t = s' β« F.map t) : Functor.Final F := by |
suffices β d, IsFiltered (StructuredArrow d F) from final_of_isFiltered_structuredArrow F
exact isFiltered_structuredArrow_of_isFiltered_of_exists F hβ hβ
| 0.09375 |
import Mathlib.Algebra.DirectSum.Module
import Mathlib.Analysis.Complex.Basic
import Mathlib.Analysis.Convex.Uniform
import Mathlib.Analysis.NormedSpace.Completion
import Mathlib.Analysis.NormedSpace.BoundedLinearMaps
#align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
noncomputable section
open RCLike Real Filter
open Topology ComplexConjugate
open LinearMap (BilinForm)
variable {π E F : Type*} [RCLike π]
class Inner (π E : Type*) where
inner : E β E β π
#align has_inner Inner
export Inner (inner)
notation3:max "βͺ" x ", " y "β«_" π:max => @inner π _ _ x y
class InnerProductSpace (π : Type*) (E : Type*) [RCLike π] [NormedAddCommGroup E] extends
NormedSpace π E, Inner π E where
norm_sq_eq_inner : β x : E, βxβ ^ 2 = re (inner x x)
conj_symm : β x y, conj (inner y x) = inner x y
add_left : β x y z, inner (x + y) z = inner x z + inner y z
smul_left : β x y r, inner (r β’ x) y = conj r * inner x y
#align inner_product_space InnerProductSpace
-- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore
structure InnerProductSpace.Core (π : Type*) (F : Type*) [RCLike π] [AddCommGroup F]
[Module π F] extends Inner π F where
conj_symm : β x y, conj (inner y x) = inner x y
nonneg_re : β x, 0 β€ re (inner x x)
definite : β x, inner x x = 0 β x = 0
add_left : β x y z, inner (x + y) z = inner x z + inner y z
smul_left : β x y r, inner (r β’ x) y = conj r * inner x y
#align inner_product_space.core InnerProductSpace.Core
attribute [class] InnerProductSpace.Core
def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π E] :
InnerProductSpace.Core π E :=
{ c with
nonneg_re := fun x => by
rw [β InnerProductSpace.norm_sq_eq_inner]
apply sq_nonneg
definite := fun x hx =>
norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by
rw [InnerProductSpace.norm_sq_eq_inner (π := π) x, hx, map_zero] }
#align inner_product_space.to_core InnerProductSpace.toCore
namespace InnerProductSpace.Core
variable [AddCommGroup F] [Module π F] [c : InnerProductSpace.Core π F]
local notation "βͺ" x ", " y "β«" => @inner π F _ x y
local notation "normSqK" => @RCLike.normSq π _
local notation "reK" => @RCLike.re π _
local notation "ext_iff" => @RCLike.ext_iff π _
local postfix:90 "β " => starRingEnd _
def toInner' : Inner π F :=
c.toInner
#align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner'
attribute [local instance] toInner'
def normSq (x : F) :=
reK βͺx, xβ«
#align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq
local notation "normSqF" => @normSq π F _ _ _ _
theorem inner_conj_symm (x y : F) : βͺy, xβ«β = βͺx, yβ« :=
c.conj_symm x y
#align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm
theorem inner_self_nonneg {x : F} : 0 β€ re βͺx, xβ« :=
c.nonneg_re _
#align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg
theorem inner_self_im (x : F) : im βͺx, xβ« = 0 := by
rw [β @ofReal_inj π, im_eq_conj_sub]
simp [inner_conj_symm]
#align inner_product_space.core.inner_self_im InnerProductSpace.Core.inner_self_im
theorem inner_add_left (x y z : F) : βͺx + y, zβ« = βͺx, zβ« + βͺy, zβ« :=
c.add_left _ _ _
#align inner_product_space.core.inner_add_left InnerProductSpace.Core.inner_add_left
theorem inner_add_right (x y z : F) : βͺx, y + zβ« = βͺx, yβ« + βͺx, zβ« := by
rw [β inner_conj_symm, inner_add_left, RingHom.map_add]; simp only [inner_conj_symm]
#align inner_product_space.core.inner_add_right InnerProductSpace.Core.inner_add_right
| Mathlib/Analysis/InnerProductSpace/Basic.lean | 224 | 226 | theorem ofReal_normSq_eq_inner_self (x : F) : (normSqF x : π) = βͺx, xβ« := by |
rw [ext_iff]
exact β¨by simp only [ofReal_re]; rfl, by simp only [inner_self_im, ofReal_im]β©
| 0.09375 |
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Combinatorics.SimpleGraph.Basic
import Mathlib.Data.Rat.Cast.Order
import Mathlib.Order.Partition.Finpartition
import Mathlib.Tactic.GCongr
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
#align_import combinatorics.simple_graph.density from "leanprover-community/mathlib"@"a4ec43f53b0bd44c697bcc3f5a62edd56f269ef1"
open Finset
variable {π ΞΉ ΞΊ Ξ± Ξ² : Type*}
namespace Rel
section Asymmetric
variable [LinearOrderedField π] (r : Ξ± β Ξ² β Prop) [β a, DecidablePred (r a)] {s sβ sβ : Finset Ξ±}
{t tβ tβ : Finset Ξ²} {a : Ξ±} {b : Ξ²} {Ξ΄ : π}
def interedges (s : Finset Ξ±) (t : Finset Ξ²) : Finset (Ξ± Γ Ξ²) :=
(s ΓΛ’ t).filter fun e β¦ r e.1 e.2
#align rel.interedges Rel.interedges
def edgeDensity (s : Finset Ξ±) (t : Finset Ξ²) : β :=
(interedges r s t).card / (s.card * t.card)
#align rel.edge_density Rel.edgeDensity
variable {r}
theorem mem_interedges_iff {x : Ξ± Γ Ξ²} : x β interedges r s t β x.1 β s β§ x.2 β t β§ r x.1 x.2 := by
rw [interedges, mem_filter, Finset.mem_product, and_assoc]
#align rel.mem_interedges_iff Rel.mem_interedges_iff
theorem mk_mem_interedges_iff : (a, b) β interedges r s t β a β s β§ b β t β§ r a b :=
mem_interedges_iff
#align rel.mk_mem_interedges_iff Rel.mk_mem_interedges_iff
@[simp]
theorem interedges_empty_left (t : Finset Ξ²) : interedges r β
t = β
:= by
rw [interedges, Finset.empty_product, filter_empty]
#align rel.interedges_empty_left Rel.interedges_empty_left
theorem interedges_mono (hs : sβ β sβ) (ht : tβ β tβ) : interedges r sβ tβ β interedges r sβ tβ :=
fun x β¦ by
simp_rw [mem_interedges_iff]
exact fun h β¦ β¨hs h.1, ht h.2.1, h.2.2β©
#align rel.interedges_mono Rel.interedges_mono
variable (r)
theorem card_interedges_add_card_interedges_compl (s : Finset Ξ±) (t : Finset Ξ²) :
(interedges r s t).card + (interedges (fun x y β¦ Β¬r x y) s t).card = s.card * t.card := by
classical
rw [β card_product, interedges, interedges, β card_union_of_disjoint, filter_union_filter_neg_eq]
exact disjoint_filter.2 fun _ _ β¦ Classical.not_not.2
#align rel.card_interedges_add_card_interedges_compl Rel.card_interedges_add_card_interedges_compl
theorem interedges_disjoint_left {s s' : Finset Ξ±} (hs : Disjoint s s') (t : Finset Ξ²) :
Disjoint (interedges r s t) (interedges r s' t) := by
rw [Finset.disjoint_left] at hs β’
intro _ hx hy
rw [mem_interedges_iff] at hx hy
exact hs hx.1 hy.1
#align rel.interedges_disjoint_left Rel.interedges_disjoint_left
theorem interedges_disjoint_right (s : Finset Ξ±) {t t' : Finset Ξ²} (ht : Disjoint t t') :
Disjoint (interedges r s t) (interedges r s t') := by
rw [Finset.disjoint_left] at ht β’
intro _ hx hy
rw [mem_interedges_iff] at hx hy
exact ht hx.2.1 hy.2.1
#align rel.interedges_disjoint_right Rel.interedges_disjoint_right
section DecidableEq
variable [DecidableEq Ξ±] [DecidableEq Ξ²]
lemma interedges_eq_biUnion :
interedges r s t = s.biUnion (fun x β¦ (t.filter (r x)).map β¨(x, Β·), Prod.mk.inj_left xβ©) := by
ext β¨x, yβ©; simp [mem_interedges_iff]
| Mathlib/Combinatorics/SimpleGraph/Density.lean | 109 | 112 | theorem interedges_biUnion_left (s : Finset ΞΉ) (t : Finset Ξ²) (f : ΞΉ β Finset Ξ±) :
interedges r (s.biUnion f) t = s.biUnion fun a β¦ interedges r (f a) t := by |
ext
simp only [mem_biUnion, mem_interedges_iff, exists_and_right, β and_assoc]
| 0.09375 |
import Mathlib.Data.List.OfFn
import Mathlib.Data.List.Nodup
import Mathlib.Data.List.Infix
#align_import data.list.sort from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
open List.Perm
universe u
namespace List
section Sorted
variable {Ξ± : Type u} {r : Ξ± β Ξ± β Prop} {a : Ξ±} {l : List Ξ±}
def Sorted :=
@Pairwise
#align list.sorted List.Sorted
instance decidableSorted [DecidableRel r] (l : List Ξ±) : Decidable (Sorted r l) :=
List.instDecidablePairwise _
#align list.decidable_sorted List.decidableSorted
protected theorem Sorted.le_of_lt [Preorder Ξ±] {l : List Ξ±} (h : l.Sorted (Β· < Β·)) :
l.Sorted (Β· β€ Β·) :=
h.imp le_of_lt
protected theorem Sorted.lt_of_le [PartialOrder Ξ±] {l : List Ξ±} (hβ : l.Sorted (Β· β€ Β·))
(hβ : l.Nodup) : l.Sorted (Β· < Β·) :=
hβ.impβ (fun _ _ => lt_of_le_of_ne) hβ
protected theorem Sorted.ge_of_gt [Preorder Ξ±] {l : List Ξ±} (h : l.Sorted (Β· > Β·)) :
l.Sorted (Β· β₯ Β·) :=
h.imp le_of_lt
protected theorem Sorted.gt_of_ge [PartialOrder Ξ±] {l : List Ξ±} (hβ : l.Sorted (Β· β₯ Β·))
(hβ : l.Nodup) : l.Sorted (Β· > Β·) :=
hβ.impβ (fun _ _ => lt_of_le_of_ne) <| by simp_rw [ne_comm]; exact hβ
@[simp]
theorem sorted_nil : Sorted r [] :=
Pairwise.nil
#align list.sorted_nil List.sorted_nil
theorem Sorted.of_cons : Sorted r (a :: l) β Sorted r l :=
Pairwise.of_cons
#align list.sorted.of_cons List.Sorted.of_cons
theorem Sorted.tail {r : Ξ± β Ξ± β Prop} {l : List Ξ±} (h : Sorted r l) : Sorted r l.tail :=
Pairwise.tail h
#align list.sorted.tail List.Sorted.tail
theorem rel_of_sorted_cons {a : Ξ±} {l : List Ξ±} : Sorted r (a :: l) β β b β l, r a b :=
rel_of_pairwise_cons
#align list.rel_of_sorted_cons List.rel_of_sorted_cons
| Mathlib/Data/List/Sort.lean | 80 | 85 | theorem Sorted.head!_le [Inhabited Ξ±] [Preorder Ξ±] {a : Ξ±} {l : List Ξ±} (h : Sorted (Β· < Β·) l)
(ha : a β l) : l.head! β€ a := by |
rw [β List.cons_head!_tail (List.ne_nil_of_mem ha)] at h ha
cases ha
Β· exact le_rfl
Β· exact le_of_lt (rel_of_sorted_cons h a (by assumption))
| 0.09375 |
import Mathlib.MeasureTheory.Integral.Lebesgue
open Set hiding restrict restrict_apply
open Filter ENNReal NNReal MeasureTheory.Measure
namespace MeasureTheory
variable {Ξ± : Type*} {m0 : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±}
noncomputable
def Measure.withDensity {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (f : Ξ± β ββ₯0β) : Measure Ξ± :=
Measure.ofMeasurable (fun s _ => β«β» a in s, f a βΞΌ) (by simp) fun s hs hd =>
lintegral_iUnion hs hd _
#align measure_theory.measure.with_density MeasureTheory.Measure.withDensity
@[simp]
theorem withDensity_apply (f : Ξ± β ββ₯0β) {s : Set Ξ±} (hs : MeasurableSet s) :
ΞΌ.withDensity f s = β«β» a in s, f a βΞΌ :=
Measure.ofMeasurable_apply s hs
#align measure_theory.with_density_apply MeasureTheory.withDensity_apply
theorem withDensity_apply_le (f : Ξ± β ββ₯0β) (s : Set Ξ±) :
β«β» a in s, f a βΞΌ β€ ΞΌ.withDensity f s := by
let t := toMeasurable (ΞΌ.withDensity f) s
calc
β«β» a in s, f a βΞΌ β€ β«β» a in t, f a βΞΌ :=
lintegral_mono_set (subset_toMeasurable (withDensity ΞΌ f) s)
_ = ΞΌ.withDensity f t :=
(withDensity_apply f (measurableSet_toMeasurable (withDensity ΞΌ f) s)).symm
_ = ΞΌ.withDensity f s := measure_toMeasurable s
theorem withDensity_apply' [SFinite ΞΌ] (f : Ξ± β ββ₯0β) (s : Set Ξ±) :
ΞΌ.withDensity f s = β«β» a in s, f a βΞΌ := by
apply le_antisymm ?_ (withDensity_apply_le f s)
let t := toMeasurable ΞΌ s
calc
ΞΌ.withDensity f s β€ ΞΌ.withDensity f t := measure_mono (subset_toMeasurable ΞΌ s)
_ = β«β» a in t, f a βΞΌ := withDensity_apply f (measurableSet_toMeasurable ΞΌ s)
_ = β«β» a in s, f a βΞΌ := by congr 1; exact restrict_toMeasurable_of_sFinite s
@[simp]
lemma withDensity_zero_left (f : Ξ± β ββ₯0β) : (0 : Measure Ξ±).withDensity f = 0 := by
ext s hs
rw [withDensity_apply _ hs]
simp
| Mathlib/MeasureTheory/Measure/WithDensity.lean | 83 | 87 | theorem withDensity_congr_ae {f g : Ξ± β ββ₯0β} (h : f =α΅[ΞΌ] g) :
ΞΌ.withDensity f = ΞΌ.withDensity g := by |
refine Measure.ext fun s hs => ?_
rw [withDensity_apply _ hs, withDensity_apply _ hs]
exact lintegral_congr_ae (ae_restrict_of_ae h)
| 0.09375 |
import Mathlib.Analysis.NormedSpace.PiLp
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open scoped NNReal Matrix
namespace Matrix
variable {R l m n Ξ± Ξ² : Type*} [Fintype l] [Fintype m] [Fintype n]
section LinfLinf
protected def normedAddCommGroup [NormedAddCommGroup Ξ±] : NormedAddCommGroup (Matrix m n Ξ±) :=
Pi.normedAddCommGroup
#align matrix.normed_add_comm_group Matrix.normedAddCommGroup
section LinftyOp
@[local instance]
protected def linftyOpSeminormedAddCommGroup [SeminormedAddCommGroup Ξ±] :
SeminormedAddCommGroup (Matrix m n Ξ±) :=
(by infer_instance : SeminormedAddCommGroup (m β PiLp 1 fun j : n => Ξ±))
#align matrix.linfty_op_seminormed_add_comm_group Matrix.linftyOpSeminormedAddCommGroup
@[local instance]
protected def linftyOpNormedAddCommGroup [NormedAddCommGroup Ξ±] :
NormedAddCommGroup (Matrix m n Ξ±) :=
(by infer_instance : NormedAddCommGroup (m β PiLp 1 fun j : n => Ξ±))
#align matrix.linfty_op_normed_add_comm_group Matrix.linftyOpNormedAddCommGroup
@[local instance]
protected theorem linftyOpBoundedSMul
[SeminormedRing R] [SeminormedAddCommGroup Ξ±] [Module R Ξ±] [BoundedSMul R Ξ±] :
BoundedSMul R (Matrix m n Ξ±) :=
(by infer_instance : BoundedSMul R (m β PiLp 1 fun j : n => Ξ±))
@[local instance]
protected def linftyOpNormedSpace [NormedField R] [SeminormedAddCommGroup Ξ±] [NormedSpace R Ξ±] :
NormedSpace R (Matrix m n Ξ±) :=
(by infer_instance : NormedSpace R (m β PiLp 1 fun j : n => Ξ±))
#align matrix.linfty_op_normed_space Matrix.linftyOpNormedSpace
section SeminormedAddCommGroup
variable [SeminormedAddCommGroup Ξ±]
theorem linfty_opNorm_def (A : Matrix m n Ξ±) :
βAβ = ((Finset.univ : Finset m).sup fun i : m => β j : n, βA i jββ : ββ₯0) := by
-- Porting note: added
change βfun i => (WithLp.equiv 1 _).symm (A i)β = _
simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
#align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def
@[deprecated (since := "2024-02-02")] alias linfty_op_norm_def := linfty_opNorm_def
theorem linfty_opNNNorm_def (A : Matrix m n Ξ±) :
βAββ = (Finset.univ : Finset m).sup fun i : m => β j : n, βA i jββ :=
Subtype.ext <| linfty_opNorm_def A
#align matrix.linfty_op_nnnorm_def Matrix.linfty_opNNNorm_def
@[deprecated (since := "2024-02-02")] alias linfty_op_nnnorm_def := linfty_opNNNorm_def
@[simp, nolint simpNF] -- Porting note: linter times out
| Mathlib/Analysis/Matrix.lean | 290 | 292 | theorem linfty_opNNNorm_col (v : m β Ξ±) : βcol vββ = βvββ := by |
rw [linfty_opNNNorm_def, Pi.nnnorm_def]
simp
| 0.09375 |
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
theorem coe_eq_zero_iff {x : π} : (x : AddCircle p) = 0 β β n : β€, n β’ p = x := by
simp [AddSubgroup.mem_zmultiples_iff]
#align add_circle.coe_eq_zero_iff AddCircle.coe_eq_zero_iff
theorem coe_eq_zero_of_pos_iff (hp : 0 < p) {x : π} (hx : 0 < x) :
(x : AddCircle p) = 0 β β n : β, n β’ p = x := by
rw [coe_eq_zero_iff]
constructor <;> rintro β¨n, rflβ©
Β· replace hx : 0 < n := by
contrapose! hx
simpa only [β neg_nonneg, β zsmul_neg, zsmul_neg'] using zsmul_nonneg hp.le (neg_nonneg.2 hx)
exact β¨n.toNat, by rw [β natCast_zsmul, Int.toNat_of_nonneg hx.le]β©
Β· exact β¨(n : β€), by simpβ©
#align add_circle.coe_eq_zero_of_pos_iff AddCircle.coe_eq_zero_of_pos_iff
theorem coe_period : (p : AddCircle p) = 0 :=
(QuotientAddGroup.eq_zero_iff p).2 <| mem_zmultiples p
#align add_circle.coe_period AddCircle.coe_period
theorem coe_add_period (x : π) : ((x + p : π) : AddCircle p) = x := by
rw [coe_add, β eq_sub_iff_add_eq', sub_self, coe_period]
#align add_circle.coe_add_period AddCircle.coe_add_period
@[continuity, nolint unusedArguments]
protected theorem continuous_mk' :
Continuous (QuotientAddGroup.mk' (zmultiples p) : π β AddCircle p) :=
continuous_coinduced_rng
#align add_circle.continuous_mk' AddCircle.continuous_mk'
variable [hp : Fact (0 < p)] (a : π) [Archimedean π]
def equivIco : AddCircle p β Ico a (a + p) :=
QuotientAddGroup.equivIcoMod hp.out a
#align add_circle.equiv_Ico AddCircle.equivIco
def equivIoc : AddCircle p β Ioc a (a + p) :=
QuotientAddGroup.equivIocMod hp.out a
#align add_circle.equiv_Ioc AddCircle.equivIoc
def liftIco (f : π β B) : AddCircle p β B :=
restrict _ f β AddCircle.equivIco p a
#align add_circle.lift_Ico AddCircle.liftIco
def liftIoc (f : π β B) : AddCircle p β B :=
restrict _ f β AddCircle.equivIoc p a
#align add_circle.lift_Ioc AddCircle.liftIoc
variable {p a}
theorem coe_eq_coe_iff_of_mem_Ico {x y : π} (hx : x β Ico a (a + p)) (hy : y β Ico a (a + p)) :
(x : AddCircle p) = y β x = y := by
refine β¨fun h => ?_, by tautoβ©
suffices (β¨x, hxβ© : Ico a (a + p)) = β¨y, hyβ© by exact Subtype.mk.inj this
apply_fun equivIco p a at h
rw [β (equivIco p a).right_inv β¨x, hxβ©, β (equivIco p a).right_inv β¨y, hyβ©]
exact h
#align add_circle.coe_eq_coe_iff_of_mem_Ico AddCircle.coe_eq_coe_iff_of_mem_Ico
theorem liftIco_coe_apply {f : π β B} {x : π} (hx : x β Ico a (a + p)) :
liftIco p a f βx = f x := by
have : (equivIco p a) x = β¨x, hxβ© := by
rw [Equiv.apply_eq_iff_eq_symm_apply]
rfl
rw [liftIco, comp_apply, this]
rfl
#align add_circle.lift_Ico_coe_apply AddCircle.liftIco_coe_apply
| Mathlib/Topology/Instances/AddCircle.lean | 231 | 237 | theorem liftIoc_coe_apply {f : π β B} {x : π} (hx : x β Ioc a (a + p)) :
liftIoc p a f βx = f x := by |
have : (equivIoc p a) x = β¨x, hxβ© := by
rw [Equiv.apply_eq_iff_eq_symm_apply]
rfl
rw [liftIoc, comp_apply, this]
rfl
| 0.09375 |
import Mathlib.Analysis.SpecialFunctions.ExpDeriv
import Mathlib.Analysis.SpecialFunctions.Complex.Circle
import Mathlib.Analysis.InnerProductSpace.l2Space
import Mathlib.MeasureTheory.Function.ContinuousMapDense
import Mathlib.MeasureTheory.Function.L2Space
import Mathlib.MeasureTheory.Group.Integral
import Mathlib.MeasureTheory.Integral.Periodic
import Mathlib.Topology.ContinuousFunction.StoneWeierstrass
import Mathlib.MeasureTheory.Integral.FundThmCalculus
#align_import analysis.fourier.add_circle from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92"
noncomputable section
open scoped ENNReal ComplexConjugate Real
open TopologicalSpace ContinuousMap MeasureTheory MeasureTheory.Measure Algebra Submodule Set
variable {T : β}
open AddCircle
section Monomials
def fourier (n : β€) : C(AddCircle T, β) where
toFun x := toCircle (n β’ x :)
continuous_toFun := continuous_induced_dom.comp <| continuous_toCircle.comp <| continuous_zsmul _
#align fourier fourier
@[simp]
theorem fourier_apply {n : β€} {x : AddCircle T} : fourier n x = toCircle (n β’ x :) :=
rfl
#align fourier_apply fourier_apply
-- @[simp] -- Porting note: simp normal form is `fourier_coe_apply'`
theorem fourier_coe_apply {n : β€} {x : β} :
fourier n (x : AddCircle T) = Complex.exp (2 * Ο * Complex.I * n * x / T) := by
rw [fourier_apply, β QuotientAddGroup.mk_zsmul, toCircle, Function.Periodic.lift_coe,
expMapCircle_apply, Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_mul, zsmul_eq_mul,
Complex.ofReal_mul, Complex.ofReal_intCast]
norm_num
congr 1; ring
#align fourier_coe_apply fourier_coe_apply
@[simp]
theorem fourier_coe_apply' {n : β€} {x : β} :
toCircle (n β’ (x : AddCircle T) :) = Complex.exp (2 * Ο * Complex.I * n * x / T) := by
rw [β fourier_apply]; exact fourier_coe_apply
-- @[simp] -- Porting note: simp normal form is `fourier_zero'`
theorem fourier_zero {x : AddCircle T} : fourier 0 x = 1 := by
induction x using QuotientAddGroup.induction_on'
simp only [fourier_coe_apply]
norm_num
#align fourier_zero fourier_zero
@[simp]
theorem fourier_zero' {x : AddCircle T} : @toCircle T 0 = (1 : β) := by
have : fourier 0 x = @toCircle T 0 := by rw [fourier_apply, zero_smul]
rw [β this]; exact fourier_zero
-- @[simp] -- Porting note: simp normal form is *also* `fourier_zero'`
theorem fourier_eval_zero (n : β€) : fourier n (0 : AddCircle T) = 1 := by
rw [β QuotientAddGroup.mk_zero, fourier_coe_apply, Complex.ofReal_zero, mul_zero,
zero_div, Complex.exp_zero]
#align fourier_eval_zero fourier_eval_zero
-- @[simp] -- Porting note (#10618): simp can prove this
theorem fourier_one {x : AddCircle T} : fourier 1 x = toCircle x := by rw [fourier_apply, one_zsmul]
#align fourier_one fourier_one
-- @[simp] -- Porting note: simp normal form is `fourier_neg'`
theorem fourier_neg {n : β€} {x : AddCircle T} : fourier (-n) x = conj (fourier n x) := by
induction x using QuotientAddGroup.induction_on'
simp_rw [fourier_apply, toCircle]
rw [β QuotientAddGroup.mk_zsmul, β QuotientAddGroup.mk_zsmul]
simp_rw [Function.Periodic.lift_coe, β coe_inv_circle_eq_conj, β expMapCircle_neg,
neg_smul, mul_neg]
#align fourier_neg fourier_neg
@[simp]
theorem fourier_neg' {n : β€} {x : AddCircle T} : @toCircle T (-(n β’ x)) = conj (fourier n x) := by
rw [β neg_smul, β fourier_apply]; exact fourier_neg
-- @[simp] -- Porting note: simp normal form is `fourier_add'`
theorem fourier_add {m n : β€} {x : AddCircle T} : fourier (m+n) x = fourier m x * fourier n x := by
simp_rw [fourier_apply, add_zsmul, toCircle_add, coe_mul_unitSphere]
#align fourier_add fourier_add
@[simp]
theorem fourier_add' {m n : β€} {x : AddCircle T} :
toCircle ((m + n) β’ x :) = fourier m x * fourier n x := by
rw [β fourier_apply]; exact fourier_add
| Mathlib/Analysis/Fourier/AddCircle.lean | 176 | 180 | theorem fourier_norm [Fact (0 < T)] (n : β€) : β@fourier T nβ = 1 := by |
rw [ContinuousMap.norm_eq_iSup_norm]
have : β x : AddCircle T, βfourier n xβ = 1 := fun x => abs_coe_circle _
simp_rw [this]
exact @ciSup_const _ _ _ Zero.instNonempty _
| 0.09375 |
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
| Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean | 72 | 91 | 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!`
| 0.0625 |
import Mathlib.Data.Rat.Cast.Defs
import Mathlib.Algebra.Field.Basic
#align_import data.rat.cast from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441"
namespace NNRat
@[simp, norm_cast]
| Mathlib/Data/Rat/Cast/Lemmas.lean | 64 | 67 | theorem cast_pow {K} [DivisionSemiring K] (q : ββ₯0) (n : β) :
NNRat.cast (q ^ n) = (NNRat.cast q : K) ^ n := by |
rw [cast_def, cast_def, den_pow, num_pow, Nat.cast_pow, Nat.cast_pow, div_eq_mul_inv, β inv_pow,
β (Nat.cast_commute _ _).mul_pow, β div_eq_mul_inv]
| 0.0625 |
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]
theorem ofPowerSeries_X : ofPowerSeries Ξ R PowerSeries.X = single 1 1 := by
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]
#align hahn_series.of_power_series_X HahnSeries.ofPowerSeries_X
| Mathlib/RingTheory/HahnSeries/PowerSeries.lean | 145 | 147 | theorem ofPowerSeries_X_pow {R} [Semiring R] (n : β) :
ofPowerSeries Ξ R (PowerSeries.X ^ n) = single (n : Ξ) 1 := by |
simp
| 0.0625 |
import Mathlib.MeasureTheory.Measure.MeasureSpace
open scoped ENNReal NNReal Topology
open Set MeasureTheory Measure Filter MeasurableSpace ENNReal Function
variable {R Ξ± Ξ² Ξ΄ Ξ³ ΞΉ : Type*}
namespace MeasureTheory
variable {m0 : MeasurableSpace Ξ±} [MeasurableSpace Ξ²] [MeasurableSpace Ξ³]
variable {ΞΌ ΞΌβ ΞΌβ ΞΌβ Ξ½ Ξ½' Ξ½β Ξ½β : Measure Ξ±} {s s' t : Set Ξ±}
namespace Measure
noncomputable def restrictβ {m0 : MeasurableSpace Ξ±} (s : Set Ξ±) : Measure Ξ± ββ[ββ₯0β] Measure Ξ± :=
liftLinear (OuterMeasure.restrict s) fun ΞΌ s' hs' t => by
suffices ΞΌ (s β© t) = ΞΌ (s β© t β© s') + ΞΌ ((s β© t) \ s') by
simpa [β Set.inter_assoc, Set.inter_comm _ s, β inter_diff_assoc]
exact le_toOuterMeasure_caratheodory _ _ hs' _
#align measure_theory.measure.restrictβ MeasureTheory.Measure.restrictβ
noncomputable def restrict {_m0 : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (s : Set Ξ±) : Measure Ξ± :=
restrictβ s ΞΌ
#align measure_theory.measure.restrict MeasureTheory.Measure.restrict
@[simp]
theorem restrictβ_apply {_m0 : MeasurableSpace Ξ±} (s : Set Ξ±) (ΞΌ : Measure Ξ±) :
restrictβ s ΞΌ = ΞΌ.restrict s :=
rfl
#align measure_theory.measure.restrictβ_apply MeasureTheory.Measure.restrictβ_apply
theorem restrict_toOuterMeasure_eq_toOuterMeasure_restrict (h : MeasurableSet s) :
(ΞΌ.restrict s).toOuterMeasure = OuterMeasure.restrict s ΞΌ.toOuterMeasure := by
simp_rw [restrict, restrictβ, liftLinear, LinearMap.coe_mk, AddHom.coe_mk,
toMeasure_toOuterMeasure, OuterMeasure.restrict_trim h, ΞΌ.trimmed]
#align measure_theory.measure.restrict_to_outer_measure_eq_to_outer_measure_restrict MeasureTheory.Measure.restrict_toOuterMeasure_eq_toOuterMeasure_restrict
| Mathlib/MeasureTheory/Measure/Restrict.lean | 62 | 64 | theorem restrict_applyβ (ht : NullMeasurableSet t (ΞΌ.restrict s)) : ΞΌ.restrict s t = ΞΌ (t β© s) := by |
rw [β restrictβ_apply, restrictβ, liftLinear_applyβ _ ht, OuterMeasure.restrict_apply,
coe_toOuterMeasure]
| 0.0625 |
import Mathlib.Topology.Order.MonotoneContinuity
import Mathlib.Topology.Algebra.Order.LiminfLimsup
import Mathlib.Topology.Instances.NNReal
import Mathlib.Topology.EMetricSpace.Lipschitz
import Mathlib.Topology.Metrizable.Basic
import Mathlib.Topology.Order.T5
#align_import topology.instances.ennreal from "leanprover-community/mathlib"@"ec4b2eeb50364487f80421c0b4c41328a611f30d"
noncomputable section
open Set Filter Metric Function
open scoped Classical Topology ENNReal NNReal Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*}
namespace ENNReal
variable {a b c d : ββ₯0β} {r p q : ββ₯0} {x y z : ββ₯0β} {Ξ΅ Ξ΅β Ξ΅β : ββ₯0β} {s : Set ββ₯0β}
section Liminf
| Mathlib/Topology/Instances/ENNReal.lean | 730 | 736 | theorem exists_frequently_lt_of_liminf_ne_top {ΞΉ : Type*} {l : Filter ΞΉ} {x : ΞΉ β β}
(hx : liminf (fun n => (Real.nnabs (x n) : ββ₯0β)) l β β) : β R, βαΆ n in l, x n < R := by |
by_contra h
simp_rw [not_exists, not_frequently, not_lt] at h
refine hx (ENNReal.eq_top_of_forall_nnreal_le fun r => le_limsInf_of_le (by isBoundedDefault) ?_)
simp only [eventually_map, ENNReal.coe_le_coe]
filter_upwards [h r] with i hi using hi.trans (le_abs_self (x i))
| 0.0625 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Fintype.Sum
#align_import combinatorics.hales_jewett from "leanprover-community/mathlib"@"1126441d6bccf98c81214a0780c73d499f6721fe"
open scoped Classical
universe u v
namespace Combinatorics
structure Line (Ξ± ΞΉ : Type*) where
idxFun : ΞΉ β Option Ξ±
proper : β i, idxFun i = none
#align combinatorics.line Combinatorics.Line
namespace Line
-- This lets us treat a line `l : Line Ξ± ΞΉ` as a function `Ξ± β ΞΉ β Ξ±`.
instance (Ξ± ΞΉ) : CoeFun (Line Ξ± ΞΉ) fun _ => Ξ± β ΞΉ β Ξ± :=
β¨fun l x i => (l.idxFun i).getD xβ©
def IsMono {Ξ± ΞΉ ΞΊ} (C : (ΞΉ β Ξ±) β ΞΊ) (l : Line Ξ± ΞΉ) : Prop :=
β c, β x, C (l x) = c
#align combinatorics.line.is_mono Combinatorics.Line.IsMono
def diagonal (Ξ± ΞΉ) [Nonempty ΞΉ] : Line Ξ± ΞΉ where
idxFun _ := none
proper := β¨Classical.arbitrary ΞΉ, rflβ©
#align combinatorics.line.diagonal Combinatorics.Line.diagonal
instance (Ξ± ΞΉ) [Nonempty ΞΉ] : Inhabited (Line Ξ± ΞΉ) :=
β¨diagonal Ξ± ΞΉβ©
structure AlmostMono {Ξ± ΞΉ ΞΊ : Type*} (C : (ΞΉ β Option Ξ±) β ΞΊ) where
line : Line (Option Ξ±) ΞΉ
color : ΞΊ
has_color : β x : Ξ±, C (line (some x)) = color
#align combinatorics.line.almost_mono Combinatorics.Line.AlmostMono
instance {Ξ± ΞΉ ΞΊ : Type*} [Nonempty ΞΉ] [Inhabited ΞΊ] :
Inhabited (AlmostMono fun _ : ΞΉ β Option Ξ± => (default : ΞΊ)) :=
β¨{ line := default
color := default
has_color := fun _ β¦ rfl}β©
structure ColorFocused {Ξ± ΞΉ ΞΊ : Type*} (C : (ΞΉ β Option Ξ±) β ΞΊ) where
lines : Multiset (AlmostMono C)
focus : ΞΉ β Option Ξ±
is_focused : β p β lines, p.line none = focus
distinct_colors : (lines.map AlmostMono.color).Nodup
#align combinatorics.line.color_focused Combinatorics.Line.ColorFocused
instance {Ξ± ΞΉ ΞΊ} (C : (ΞΉ β Option Ξ±) β ΞΊ) : Inhabited (ColorFocused C) := by
refine β¨β¨0, fun _ => none, fun h => ?_, Multiset.nodup_zeroβ©β©
simp only [Multiset.not_mem_zero, IsEmpty.forall_iff]
def map {Ξ± Ξ±' ΞΉ} (f : Ξ± β Ξ±') (l : Line Ξ± ΞΉ) : Line Ξ±' ΞΉ where
idxFun i := (l.idxFun i).map f
proper := β¨l.proper.choose, by simp only [l.proper.choose_spec, Option.map_none']β©
#align combinatorics.line.map Combinatorics.Line.map
def vertical {Ξ± ΞΉ ΞΉ'} (v : ΞΉ β Ξ±) (l : Line Ξ± ΞΉ') : Line Ξ± (Sum ΞΉ ΞΉ') where
idxFun := Sum.elim (some β v) l.idxFun
proper := β¨Sum.inr l.proper.choose, l.proper.choose_specβ©
#align combinatorics.line.vertical Combinatorics.Line.vertical
def horizontal {Ξ± ΞΉ ΞΉ'} (l : Line Ξ± ΞΉ) (v : ΞΉ' β Ξ±) : Line Ξ± (Sum ΞΉ ΞΉ') where
idxFun := Sum.elim l.idxFun (some β v)
proper := β¨Sum.inl l.proper.choose, l.proper.choose_specβ©
#align combinatorics.line.horizontal Combinatorics.Line.horizontal
def prod {Ξ± ΞΉ ΞΉ'} (l : Line Ξ± ΞΉ) (l' : Line Ξ± ΞΉ') : Line Ξ± (Sum ΞΉ ΞΉ') where
idxFun := Sum.elim l.idxFun l'.idxFun
proper := β¨Sum.inl l.proper.choose, l.proper.choose_specβ©
#align combinatorics.line.prod Combinatorics.Line.prod
theorem apply {Ξ± ΞΉ} (l : Line Ξ± ΞΉ) (x : Ξ±) : l x = fun i => (l.idxFun i).getD x :=
rfl
#align combinatorics.line.apply Combinatorics.Line.apply
theorem apply_none {Ξ± ΞΉ} (l : Line Ξ± ΞΉ) (x : Ξ±) (i : ΞΉ) (h : l.idxFun i = none) : l x i = x := by
simp only [Option.getD_none, h, l.apply]
#align combinatorics.line.apply_none Combinatorics.Line.apply_none
theorem apply_of_ne_none {Ξ± ΞΉ} (l : Line Ξ± ΞΉ) (x : Ξ±) (i : ΞΉ) (h : l.idxFun i β none) :
some (l x i) = l.idxFun i := by rw [l.apply, Option.getD_of_ne_none h]
#align combinatorics.line.apply_of_ne_none Combinatorics.Line.apply_of_ne_none
@[simp]
theorem map_apply {Ξ± Ξ±' ΞΉ} (f : Ξ± β Ξ±') (l : Line Ξ± ΞΉ) (x : Ξ±) : l.map f (f x) = f β l x := by
simp only [Line.apply, Line.map, Option.getD_map]
rfl
#align combinatorics.line.map_apply Combinatorics.Line.map_apply
@[simp]
| Mathlib/Combinatorics/HalesJewett.lean | 190 | 193 | theorem vertical_apply {Ξ± ΞΉ ΞΉ'} (v : ΞΉ β Ξ±) (l : Line Ξ± ΞΉ') (x : Ξ±) :
l.vertical v x = Sum.elim v (l x) := by |
funext i
cases i <;> rfl
| 0.0625 |
import Mathlib.Topology.Order.ProjIcc
import Mathlib.Topology.CompactOpen
import Mathlib.Topology.UnitInterval
#align_import topology.path_connected from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open scoped Classical
open Topology Filter unitInterval Set Function
variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {x y z : X} {ΞΉ : Type*}
-- porting note (#5171): removed @[nolint has_nonempty_instance]
structure Path (x y : X) extends C(I, X) where
source' : toFun 0 = x
target' : toFun 1 = y
#align path Path
instance Path.funLike : FunLike (Path x y) I X where
coe := fun Ξ³ β¦ βΞ³.toContinuousMap
coe_injective' := fun Ξ³β Ξ³β h => by
simp only [DFunLike.coe_fn_eq] at h
cases Ξ³β; cases Ξ³β; congr
-- Porting note (#10754): added this instance so that we can use `FunLike.coe` for `CoeFun`
-- this also fixed very strange `simp` timeout issues
instance Path.continuousMapClass : ContinuousMapClass (Path x y) I X where
map_continuous := fun Ξ³ => show Continuous Ξ³.toContinuousMap by continuity
-- Porting note: not necessary in light of the instance above
@[ext]
protected theorem Path.ext : β {Ξ³β Ξ³β : Path x y}, (Ξ³β : I β X) = Ξ³β β Ξ³β = Ξ³β := by
rintro β¨β¨x, h11β©, h12, h13β© β¨β¨x, h21β©, h22, h23β© rfl
rfl
#align path.ext Path.ext
namespace Path
@[simp]
theorem coe_mk_mk (f : I β X) (hβ) (hβ : f 0 = x) (hβ : f 1 = y) :
β(mk β¨f, hββ© hβ hβ : Path x y) = f :=
rfl
#align path.coe_mk Path.coe_mk_mk
-- Porting note: the name `Path.coe_mk` better refers to a new lemma below
variable (Ξ³ : Path x y)
@[continuity]
protected theorem continuous : Continuous Ξ³ :=
Ξ³.continuous_toFun
#align path.continuous Path.continuous
@[simp]
protected theorem source : Ξ³ 0 = x :=
Ξ³.source'
#align path.source Path.source
@[simp]
protected theorem target : Ξ³ 1 = y :=
Ξ³.target'
#align path.target Path.target
def simps.apply : I β X :=
Ξ³
#align path.simps.apply Path.simps.apply
initialize_simps_projections Path (toFun β simps.apply, -toContinuousMap)
@[simp]
theorem coe_toContinuousMap : βΞ³.toContinuousMap = Ξ³ :=
rfl
#align path.coe_to_continuous_map Path.coe_toContinuousMap
-- Porting note: this is needed because of the `Path.continuousMapClass` instance
@[simp]
theorem coe_mk : β(Ξ³ : C(I, X)) = Ξ³ :=
rfl
instance hasUncurryPath {X Ξ± : Type*} [TopologicalSpace X] {x y : Ξ± β X} :
HasUncurry (β a : Ξ±, Path (x a) (y a)) (Ξ± Γ I) X :=
β¨fun Ο p => Ο p.1 p.2β©
#align path.has_uncurry_path Path.hasUncurryPath
@[refl, simps]
def refl (x : X) : Path x x where
toFun _t := x
continuous_toFun := continuous_const
source' := rfl
target' := rfl
#align path.refl Path.refl
@[simp]
theorem refl_range {a : X} : range (Path.refl a) = {a} := by simp [Path.refl, CoeFun.coe]
#align path.refl_range Path.refl_range
@[symm, simps]
def symm (Ξ³ : Path x y) : Path y x where
toFun := Ξ³ β Ο
continuous_toFun := by continuity
source' := by simpa [-Path.target] using Ξ³.target
target' := by simpa [-Path.source] using Ξ³.source
#align path.symm Path.symm
@[simp]
theorem symm_symm (Ξ³ : Path x y) : Ξ³.symm.symm = Ξ³ := by
ext t
show Ξ³ (Ο (Ο t)) = Ξ³ t
rw [unitInterval.symm_symm]
#align path.symm_symm Path.symm_symm
theorem symm_bijective : Function.Bijective (Path.symm : Path x y β Path y x) :=
Function.bijective_iff_has_inverse.mpr β¨_, symm_symm, symm_symmβ©
@[simp]
theorem refl_symm {a : X} : (Path.refl a).symm = Path.refl a := by
ext
rfl
#align path.refl_symm Path.refl_symm
@[simp]
| Mathlib/Topology/Connected/PathConnected.lean | 194 | 200 | theorem symm_range {a b : X} (Ξ³ : Path a b) : range Ξ³.symm = range Ξ³ := by |
ext x
simp only [mem_range, Path.symm, DFunLike.coe, unitInterval.symm, SetCoe.exists, comp_apply,
Subtype.coe_mk]
constructor <;> rintro β¨y, hy, hxyβ© <;> refine β¨1 - y, mem_iff_one_sub_mem.mp hy, ?_β© <;>
convert hxy
simp
| 0.0625 |
import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence
import Mathlib.Algebra.ContinuedFractions.TerminatedStable
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Ring
#align_import algebra.continued_fractions.convergents_equiv from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
variable {K : Type*} {n : β}
namespace GeneralizedContinuedFraction
variable {g : GeneralizedContinuedFraction K} {s : Stream'.Seq <| Pair K}
section Squash
section WithDivisionRing
variable [DivisionRing K]
def squashSeq (s : Stream'.Seq <| Pair K) (n : β) : Stream'.Seq (Pair K) :=
match Prod.mk (s.get? n) (s.get? (n + 1)) with
| β¨some gp_n, some gp_succ_nβ© =>
Stream'.Seq.nats.zipWith
-- return the squashed value at position `n`; otherwise, do nothing.
(fun n' gp => if n' = n then β¨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.bβ© else gp) s
| _ => s
#align generalized_continued_fraction.squash_seq GeneralizedContinuedFraction.squashSeq
theorem squashSeq_eq_self_of_terminated (terminated_at_succ_n : s.TerminatedAt (n + 1)) :
squashSeq s n = s := by
change s.get? (n + 1) = none at terminated_at_succ_n
cases s_nth_eq : s.get? n <;> simp only [*, squashSeq]
#align generalized_continued_fraction.squash_seq_eq_self_of_terminated GeneralizedContinuedFraction.squashSeq_eq_self_of_terminated
| Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean | 114 | 117 | theorem squashSeq_nth_of_not_terminated {gp_n gp_succ_n : Pair K} (s_nth_eq : s.get? n = some gp_n)
(s_succ_nth_eq : s.get? (n + 1) = some gp_succ_n) :
(squashSeq s n).get? n = some β¨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.bβ© := by |
simp [*, squashSeq]
| 0.0625 |
import Mathlib.Data.Nat.Defs
import Mathlib.Data.Option.Basic
import Mathlib.Data.List.Defs
import Mathlib.Init.Data.List.Basic
import Mathlib.Init.Data.List.Instances
import Mathlib.Init.Data.List.Lemmas
import Mathlib.Logic.Unique
import Mathlib.Order.Basic
import Mathlib.Tactic.Common
#align_import data.list.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
assert_not_exists Set.range
assert_not_exists GroupWithZero
assert_not_exists Ring
open Function
open Nat hiding one_pos
namespace List
universe u v w
variable {ΞΉ : Type*} {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {lβ lβ : List Ξ±}
-- Porting note: Delete this attribute
-- attribute [inline] List.head!
instance uniqueOfIsEmpty [IsEmpty Ξ±] : Unique (List Ξ±) :=
{ instInhabitedList with
uniq := fun l =>
match l with
| [] => rfl
| a :: _ => isEmptyElim a }
#align list.unique_of_is_empty List.uniqueOfIsEmpty
instance : Std.LawfulIdentity (Ξ± := List Ξ±) Append.append [] where
left_id := nil_append
right_id := append_nil
instance : Std.Associative (Ξ± := List Ξ±) Append.append where
assoc := append_assoc
#align list.cons_ne_nil List.cons_ne_nil
#align list.cons_ne_self List.cons_ne_self
#align list.head_eq_of_cons_eq List.head_eq_of_cons_eqβ -- implicits order
#align list.tail_eq_of_cons_eq List.tail_eq_of_cons_eqβ -- implicits order
@[simp] theorem cons_injective {a : Ξ±} : Injective (cons a) := fun _ _ => tail_eq_of_cons_eq
#align list.cons_injective List.cons_injective
#align list.cons_inj List.cons_inj
#align list.cons_eq_cons List.cons_eq_cons
theorem singleton_injective : Injective fun a : Ξ± => [a] := fun _ _ h => (cons_eq_cons.1 h).1
#align list.singleton_injective List.singleton_injective
theorem singleton_inj {a b : Ξ±} : [a] = [b] β a = b :=
singleton_injective.eq_iff
#align list.singleton_inj List.singleton_inj
#align list.exists_cons_of_ne_nil List.exists_cons_of_ne_nil
theorem set_of_mem_cons (l : List Ξ±) (a : Ξ±) : { x | x β a :: l } = insert a { x | x β l } :=
Set.ext fun _ => mem_cons
#align list.set_of_mem_cons List.set_of_mem_cons
#align list.mem_singleton_self List.mem_singleton_self
#align list.eq_of_mem_singleton List.eq_of_mem_singleton
#align list.mem_singleton List.mem_singleton
#align list.mem_of_mem_cons_of_mem List.mem_of_mem_cons_of_mem
| Mathlib/Data/List/Basic.lean | 87 | 91 | theorem _root_.Decidable.List.eq_or_ne_mem_of_mem [DecidableEq Ξ±]
{a b : Ξ±} {l : List Ξ±} (h : a β b :: l) : a = b β¨ a β b β§ a β l := by |
by_cases hab : a = b
Β· exact Or.inl hab
Β· exact ((List.mem_cons.1 h).elim Or.inl (fun h => Or.inr β¨hab, hβ©))
| 0.0625 |
import Mathlib.Algebra.Algebra.Defs
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.RingTheory.Localization.Basic
import Mathlib.SetTheory.Game.Birthday
import Mathlib.SetTheory.Surreal.Basic
#align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
universe u
namespace SetTheory
namespace PGame
def powHalf : β β PGame
| 0 => 1
| n + 1 => β¨PUnit, PUnit, 0, fun _ => powHalf nβ©
#align pgame.pow_half SetTheory.PGame.powHalf
@[simp]
theorem powHalf_zero : powHalf 0 = 1 :=
rfl
#align pgame.pow_half_zero SetTheory.PGame.powHalf_zero
theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl
#align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves
theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty :=
rfl
#align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves
theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit :=
rfl
#align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves
@[simp]
theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by cases n <;> cases i <;> rfl
#align pgame.pow_half_move_left SetTheory.PGame.powHalf_moveLeft
@[simp]
theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n :=
rfl
#align pgame.pow_half_succ_move_right SetTheory.PGame.powHalf_succ_moveRight
instance uniquePowHalfLeftMoves (n) : Unique (powHalf n).LeftMoves := by
cases n <;> exact PUnit.unique
#align pgame.unique_pow_half_left_moves SetTheory.PGame.uniquePowHalfLeftMoves
instance isEmpty_powHalf_zero_rightMoves : IsEmpty (powHalf 0).RightMoves :=
inferInstanceAs (IsEmpty PEmpty)
#align pgame.is_empty_pow_half_zero_right_moves SetTheory.PGame.isEmpty_powHalf_zero_rightMoves
instance uniquePowHalfSuccRightMoves (n) : Unique (powHalf (n + 1)).RightMoves :=
PUnit.unique
#align pgame.unique_pow_half_succ_right_moves SetTheory.PGame.uniquePowHalfSuccRightMoves
@[simp]
| Mathlib/SetTheory/Surreal/Dyadic.lean | 85 | 86 | theorem birthday_half : birthday (powHalf 1) = 2 := by |
rw [birthday_def]; simp
| 0.0625 |
import Mathlib.Data.Real.Irrational
import Mathlib.Data.Nat.Fib.Basic
import Mathlib.Data.Fin.VecNotation
import Mathlib.Algebra.LinearRecurrence
import Mathlib.Tactic.NormNum.NatFib
import Mathlib.Tactic.NormNum.Prime
#align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
noncomputable section
open Polynomial
abbrev goldenRatio : β := (1 + β5) / 2
#align golden_ratio goldenRatio
abbrev goldenConj : β := (1 - β5) / 2
#align golden_conj goldenConj
@[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο" => goldenRatio
@[inherit_doc goldenConj] scoped[goldenRatio] notation "Ο" => goldenConj
open Real goldenRatio
theorem inv_gold : Οβ»ΒΉ = -Ο := by
have : 1 + β5 β 0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num))
field_simp [sub_mul, mul_add]
norm_num
#align inv_gold inv_gold
theorem inv_goldConj : Οβ»ΒΉ = -Ο := by
rw [inv_eq_iff_eq_inv, β neg_inv, β neg_eq_iff_eq_neg]
exact inv_gold.symm
#align inv_gold_conj inv_goldConj
@[simp]
theorem gold_mul_goldConj : Ο * Ο = -1 := by
field_simp
rw [β sq_sub_sq]
norm_num
#align gold_mul_gold_conj gold_mul_goldConj
@[simp]
theorem goldConj_mul_gold : Ο * Ο = -1 := by
rw [mul_comm]
exact gold_mul_goldConj
#align gold_conj_mul_gold goldConj_mul_gold
@[simp]
| Mathlib/Data/Real/GoldenRatio.lean | 70 | 72 | theorem gold_add_goldConj : Ο + Ο = 1 := by |
rw [goldenRatio, goldenConj]
ring
| 0.0625 |
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.PEquiv
#align_import data.matrix.pequiv from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1"
namespace PEquiv
open Matrix
universe u v
variable {k l m n : Type*}
variable {Ξ± : Type v}
open Matrix
def toMatrix [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) : Matrix m n Ξ± :=
of fun i j => if j β f i then (1 : Ξ±) else 0
#align pequiv.to_matrix PEquiv.toMatrix
-- TODO: set as an equation lemma for `toMatrix`, see mathlib4#3024
@[simp]
theorem toMatrix_apply [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) (i j) :
toMatrix f i j = if j β f i then (1 : Ξ±) else 0 :=
rfl
#align pequiv.to_matrix_apply PEquiv.toMatrix_apply
theorem mul_matrix_apply [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : l β. m) (M : Matrix m n Ξ±)
(i j) : (f.toMatrix * M :) i j = Option.casesOn (f i) 0 fun fi => M fi j := by
dsimp [toMatrix, Matrix.mul_apply]
cases' h : f i with fi
Β· simp [h]
Β· rw [Finset.sum_eq_single fi] <;> simp (config := { contextual := true }) [h, eq_comm]
#align pequiv.mul_matrix_apply PEquiv.mul_matrix_apply
theorem toMatrix_symm [DecidableEq m] [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m β. n) :
(f.symm.toMatrix : Matrix n m Ξ±) = f.toMatrixα΅ := by
ext
simp only [transpose, mem_iff_mem f, toMatrix_apply]
congr
#align pequiv.to_matrix_symm PEquiv.toMatrix_symm
@[simp]
theorem toMatrix_refl [DecidableEq n] [Zero Ξ±] [One Ξ±] :
((PEquiv.refl n).toMatrix : Matrix n n Ξ±) = 1 := by
ext
simp [toMatrix_apply, one_apply]
#align pequiv.to_matrix_refl PEquiv.toMatrix_refl
theorem matrix_mul_apply [Fintype m] [Semiring Ξ±] [DecidableEq n] (M : Matrix l m Ξ±) (f : m β. n)
(i j) : (M * f.toMatrix :) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj := by
dsimp [toMatrix, Matrix.mul_apply]
cases' h : f.symm j with fj
Β· simp [h, β f.eq_some_iff]
Β· rw [Finset.sum_eq_single fj]
Β· simp [h, β f.eq_some_iff]
Β· rintro b - n
simp [h, β f.eq_some_iff, n.symm]
Β· simp
#align pequiv.matrix_mul_apply PEquiv.matrix_mul_apply
| Mathlib/Data/Matrix/PEquiv.lean | 96 | 99 | theorem toPEquiv_mul_matrix [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : m β m)
(M : Matrix m n Ξ±) : f.toPEquiv.toMatrix * M = M.submatrix f id := by |
ext i j
rw [mul_matrix_apply, Equiv.toPEquiv_apply, submatrix_apply, id]
| 0.0625 |
import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax
import Mathlib.Algebra.Order.Monoid.WithTop
import Mathlib.Data.Finset.Image
import Mathlib.Data.Multiset.Fold
#align_import data.finset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
-- TODO:
-- assert_not_exists OrderedCommMonoid
assert_not_exists MonoidWithZero
namespace Finset
open Multiset
variable {Ξ± Ξ² Ξ³ : Type*}
section Fold
variable (op : Ξ² β Ξ² β Ξ²) [hc : Std.Commutative op] [ha : Std.Associative op]
local notation a " * " b => op a b
def fold (b : Ξ²) (f : Ξ± β Ξ²) (s : Finset Ξ±) : Ξ² :=
(s.1.map f).fold op b
#align finset.fold Finset.fold
variable {op} {f : Ξ± β Ξ²} {b : Ξ²} {s : Finset Ξ±} {a : Ξ±}
@[simp]
theorem fold_empty : (β
: Finset Ξ±).fold op b f = b :=
rfl
#align finset.fold_empty Finset.fold_empty
@[simp]
| Mathlib/Data/Finset/Fold.lean | 50 | 52 | theorem fold_cons (h : a β s) : (cons a s h).fold op b f = f a * s.fold op b f := by |
dsimp only [fold]
rw [cons_val, Multiset.map_cons, fold_cons_left]
| 0.0625 |
import Mathlib.LinearAlgebra.Dimension.Free
import Mathlib.Algebra.Module.Torsion
#align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5"
noncomputable section
universe u v v' uβ' w w'
variable {R S : Type u} {M : Type v} {M' : Type v'} {Mβ : Type v}
variable {ΞΉ : Type w} {ΞΉ' : Type w'} {Ξ· : Type uβ'} {Ο : Ξ· β Type*}
open Cardinal Basis Submodule Function Set FiniteDimensional DirectSum
variable [Ring R] [CommRing S] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup Mβ]
variable [Module R M] [Module R M'] [Module R Mβ]
section Finsupp
variable (R M M')
variable [StrongRankCondition R] [Module.Free R M] [Module.Free R M']
open Module.Free
@[simp]
theorem rank_finsupp (ΞΉ : Type w) :
Module.rank R (ΞΉ ββ M) = Cardinal.lift.{v} #ΞΉ * Cardinal.lift.{w} (Module.rank R M) := by
obtain β¨β¨_, bsβ©β© := Module.Free.exists_basis (R := R) (M := M)
rw [β bs.mk_eq_rank'', β (Finsupp.basis fun _ : ΞΉ => bs).mk_eq_rank'', Cardinal.mk_sigma,
Cardinal.sum_const]
#align rank_finsupp rank_finsupp
theorem rank_finsupp' (ΞΉ : Type v) : Module.rank R (ΞΉ ββ M) = #ΞΉ * Module.rank R M := by
simp [rank_finsupp]
#align rank_finsupp' rank_finsupp'
-- Porting note, this should not be `@[simp]`, as simp can prove it.
-- @[simp]
theorem rank_finsupp_self (ΞΉ : Type w) : Module.rank R (ΞΉ ββ R) = Cardinal.lift.{u} #ΞΉ := by
simp [rank_finsupp]
#align rank_finsupp_self rank_finsupp_self
theorem rank_finsupp_self' {ΞΉ : Type u} : Module.rank R (ΞΉ ββ R) = #ΞΉ := by simp
#align rank_finsupp_self' rank_finsupp_self'
@[simp]
theorem rank_directSum {ΞΉ : Type v} (M : ΞΉ β Type w) [β i : ΞΉ, AddCommGroup (M i)]
[β i : ΞΉ, Module R (M i)] [β i : ΞΉ, Module.Free R (M i)] :
Module.rank R (β¨ i, M i) = Cardinal.sum fun i => Module.rank R (M i) := by
let B i := chooseBasis R (M i)
let b : Basis _ R (β¨ i, M i) := DFinsupp.basis fun i => B i
simp [β b.mk_eq_rank'', fun i => (B i).mk_eq_rank'']
#align rank_direct_sum rank_directSum
@[simp]
theorem rank_matrix (m : Type v) (n : Type w) [Finite m] [Finite n] :
Module.rank R (Matrix m n R) =
Cardinal.lift.{max v w u, v} #m * Cardinal.lift.{max v w u, w} #n := by
cases nonempty_fintype m
cases nonempty_fintype n
have h := (Matrix.stdBasis R m n).mk_eq_rank
rw [β lift_lift.{max v w u, max v w}, lift_inj] at h
simpa using h.symm
#align rank_matrix rank_matrix
@[simp high]
theorem rank_matrix' (m n : Type v) [Finite m] [Finite n] :
Module.rank R (Matrix m n R) = Cardinal.lift.{u} (#m * #n) := by
rw [rank_matrix, lift_mul, lift_umax.{v, u}]
#align rank_matrix' rank_matrix'
-- @[simp] -- Porting note (#10618): simp can prove this
theorem rank_matrix'' (m n : Type u) [Finite m] [Finite n] :
Module.rank R (Matrix m n R) = #m * #n := by simp
#align rank_matrix'' rank_matrix''
variable [Module.Finite R M] [Module.Finite R M']
open Fintype
section SubalgebraRank
open Module
variable {F E : Type*} [CommRing F] [Ring E] [Algebra F E]
@[simp]
theorem Subalgebra.rank_toSubmodule (S : Subalgebra F E) :
Module.rank F (Subalgebra.toSubmodule S) = Module.rank F S :=
rfl
#align subalgebra.rank_to_submodule Subalgebra.rank_toSubmodule
@[simp]
theorem Subalgebra.finrank_toSubmodule (S : Subalgebra F E) :
finrank F (Subalgebra.toSubmodule S) = finrank F S :=
rfl
#align subalgebra.finrank_to_submodule Subalgebra.finrank_toSubmodule
| Mathlib/LinearAlgebra/Dimension/Constructions.lean | 538 | 541 | theorem subalgebra_top_rank_eq_submodule_top_rank :
Module.rank F (β€ : Subalgebra F E) = Module.rank F (β€ : Submodule F E) := by |
rw [β Algebra.top_toSubmodule]
rfl
| 0.0625 |
import Mathlib.Order.Filter.Bases
#align_import order.filter.pi from "leanprover-community/mathlib"@"ce64cd319bb6b3e82f31c2d38e79080d377be451"
open Set Function
open scoped Classical
open Filter
namespace Filter
variable {ΞΉ : Type*} {Ξ± : ΞΉ β Type*} {f fβ fβ : (i : ΞΉ) β Filter (Ξ± i)} {s : (i : ΞΉ) β Set (Ξ± i)}
{p : β i, Ξ± i β Prop}
section CoprodCat
-- for "Coprod"
set_option linter.uppercaseLean3 false
protected def coprodα΅’ (f : β i, Filter (Ξ± i)) : Filter (β i, Ξ± i) :=
β¨ i : ΞΉ, comap (eval i) (f i)
#align filter.Coprod Filter.coprodα΅’
theorem mem_coprodα΅’_iff {s : Set (β i, Ξ± i)} :
s β Filter.coprodα΅’ f β β i : ΞΉ, β tβ β f i, eval i β»ΒΉ' tβ β s := by simp [Filter.coprodα΅’]
#align filter.mem_Coprod_iff Filter.mem_coprodα΅’_iff
| Mathlib/Order/Filter/Pi.lean | 233 | 235 | theorem compl_mem_coprodα΅’ {s : Set (β i, Ξ± i)} :
sαΆ β Filter.coprodα΅’ f β β i, (eval i '' s)αΆ β f i := by |
simp only [Filter.coprodα΅’, mem_iSup, compl_mem_comap]
| 0.0625 |
import Mathlib.Analysis.NormedSpace.ContinuousAffineMap
import Mathlib.Analysis.Calculus.ContDiff.Basic
#align_import analysis.calculus.affine_map from "leanprover-community/mathlib"@"839b92fedff9981cf3fe1c1f623e04b0d127f57c"
namespace ContinuousAffineMap
variable {π V W : Type*} [NontriviallyNormedField π]
variable [NormedAddCommGroup V] [NormedSpace π V]
variable [NormedAddCommGroup W] [NormedSpace π W]
| Mathlib/Analysis/Calculus/AffineMap.lean | 30 | 33 | theorem contDiff {n : ββ} (f : V βᴬ[π] W) : ContDiff π n f := by |
rw [f.decomp]
apply f.contLinear.contDiff.add
exact contDiff_const
| 0.0625 |
import Mathlib.Data.Finset.Pointwise
#align_import combinatorics.additive.e_transform from "leanprover-community/mathlib"@"207c92594599a06e7c134f8d00a030a83e6c7259"
open MulOpposite
open Pointwise
variable {Ξ± : Type*} [DecidableEq Ξ±]
namespace Finset
section CommGroup
variable [CommGroup Ξ±] (e : Ξ±) (x : Finset Ξ± Γ Finset Ξ±)
@[to_additive (attr := simps) "The **Dyson e-transform**.
Turns `(s, t)` into `(s βͺ e +α΅₯ t, t β© -e +α΅₯ s)`. This reduces the sum of the two sets."]
def mulDysonETransform : Finset Ξ± Γ Finset Ξ± :=
(x.1 βͺ e β’ x.2, x.2 β© eβ»ΒΉ β’ x.1)
#align finset.mul_dyson_e_transform Finset.mulDysonETransform
#align finset.add_dyson_e_transform Finset.addDysonETransform
@[to_additive]
theorem mulDysonETransform.subset :
(mulDysonETransform e x).1 * (mulDysonETransform e x).2 β x.1 * x.2 := by
refine union_mul_inter_subset_union.trans (union_subset Subset.rfl ?_)
rw [mul_smul_comm, smul_mul_assoc, inv_smul_smul, mul_comm]
#align finset.mul_dyson_e_transform.subset Finset.mulDysonETransform.subset
#align finset.add_dyson_e_transform.subset Finset.addDysonETransform.subset
@[to_additive]
theorem mulDysonETransform.card :
(mulDysonETransform e x).1.card + (mulDysonETransform e x).2.card = x.1.card + x.2.card := by
dsimp
rw [β card_smul_finset e (_ β© _), smul_finset_inter, smul_inv_smul, inter_comm,
card_union_add_card_inter, card_smul_finset]
#align finset.mul_dyson_e_transform.card Finset.mulDysonETransform.card
#align finset.add_dyson_e_transform.card Finset.addDysonETransform.card
@[to_additive (attr := simp)]
theorem mulDysonETransform_idem :
mulDysonETransform e (mulDysonETransform e x) = mulDysonETransform e x := by
ext : 1 <;> dsimp
Β· rw [smul_finset_inter, smul_inv_smul, inter_comm, union_eq_left]
exact inter_subset_union
Β· rw [smul_finset_union, inv_smul_smul, union_comm, inter_eq_left]
exact inter_subset_union
#align finset.mul_dyson_e_transform_idem Finset.mulDysonETransform_idem
#align finset.add_dyson_e_transform_idem Finset.addDysonETransform_idem
variable {e x}
@[to_additive]
| Mathlib/Combinatorics/Additive/ETransform.lean | 88 | 92 | theorem mulDysonETransform.smul_finset_snd_subset_fst :
e β’ (mulDysonETransform e x).2 β (mulDysonETransform e x).1 := by |
dsimp
rw [smul_finset_inter, smul_inv_smul, inter_comm]
exact inter_subset_union
| 0.0625 |
import Mathlib.ModelTheory.Substructures
#align_import model_theory.finitely_generated from "leanprover-community/mathlib"@"0602c59878ff3d5f71dea69c2d32ccf2e93e5398"
open FirstOrder Set
namespace FirstOrder
namespace Language
open Structure
variable {L : Language} {M : Type*} [L.Structure M]
namespace Substructure
def FG (N : L.Substructure M) : Prop :=
β S : Finset M, closure L S = N
#align first_order.language.substructure.fg FirstOrder.Language.Substructure.FG
theorem fg_def {N : L.Substructure M} : N.FG β β S : Set M, S.Finite β§ closure L S = N :=
β¨fun β¨t, hβ© => β¨_, Finset.finite_toSet t, hβ©, by
rintro β¨t', h, rflβ©
rcases Finite.exists_finset_coe h with β¨t, rflβ©
exact β¨t, rflβ©β©
#align first_order.language.substructure.fg_def FirstOrder.Language.Substructure.fg_def
theorem fg_iff_exists_fin_generating_family {N : L.Substructure M} :
N.FG β β (n : β) (s : Fin n β M), closure L (range s) = N := by
rw [fg_def]
constructor
Β· rintro β¨S, Sfin, hSβ©
obtain β¨n, f, rflβ© := Sfin.fin_embedding
exact β¨n, f, hSβ©
Β· rintro β¨n, s, hsβ©
exact β¨range s, finite_range s, hsβ©
#align first_order.language.substructure.fg_iff_exists_fin_generating_family FirstOrder.Language.Substructure.fg_iff_exists_fin_generating_family
theorem fg_bot : (β₯ : L.Substructure M).FG :=
β¨β
, by rw [Finset.coe_empty, closure_empty]β©
#align first_order.language.substructure.fg_bot FirstOrder.Language.Substructure.fg_bot
theorem fg_closure {s : Set M} (hs : s.Finite) : FG (closure L s) :=
β¨hs.toFinset, by rw [hs.coe_toFinset]β©
#align first_order.language.substructure.fg_closure FirstOrder.Language.Substructure.fg_closure
theorem fg_closure_singleton (x : M) : FG (closure L ({x} : Set M)) :=
fg_closure (finite_singleton x)
#align first_order.language.substructure.fg_closure_singleton FirstOrder.Language.Substructure.fg_closure_singleton
theorem FG.sup {Nβ Nβ : L.Substructure M} (hNβ : Nβ.FG) (hNβ : Nβ.FG) : (Nβ β Nβ).FG :=
let β¨tβ, htββ© := fg_def.1 hNβ
let β¨tβ, htββ© := fg_def.1 hNβ
fg_def.2 β¨tβ βͺ tβ, htβ.1.union htβ.1, by rw [closure_union, htβ.2, htβ.2]β©
#align first_order.language.substructure.fg.sup FirstOrder.Language.Substructure.FG.sup
theorem FG.map {N : Type*} [L.Structure N] (f : M β[L] N) {s : L.Substructure M} (hs : s.FG) :
(s.map f).FG :=
let β¨t, htβ© := fg_def.1 hs
fg_def.2 β¨f '' t, ht.1.image _, by rw [closure_image, ht.2]β©
#align first_order.language.substructure.fg.map FirstOrder.Language.Substructure.FG.map
theorem FG.of_map_embedding {N : Type*} [L.Structure N] (f : M βͺ[L] N) {s : L.Substructure M}
(hs : (s.map f.toHom).FG) : s.FG := by
rcases hs with β¨t, hβ©
rw [fg_def]
refine β¨f β»ΒΉ' t, t.finite_toSet.preimage f.injective.injOn, ?_β©
have hf : Function.Injective f.toHom := f.injective
refine map_injective_of_injective hf ?_
rw [β h, map_closure, Embedding.coe_toHom, image_preimage_eq_of_subset]
intro x hx
have h' := subset_closure (L := L) hx
rw [h] at h'
exact Hom.map_le_range h'
#align first_order.language.substructure.fg.of_map_embedding FirstOrder.Language.Substructure.FG.of_map_embedding
def CG (N : L.Substructure M) : Prop :=
β S : Set M, S.Countable β§ closure L S = N
#align first_order.language.substructure.cg FirstOrder.Language.Substructure.CG
theorem cg_def {N : L.Substructure M} : N.CG β β S : Set M, S.Countable β§ closure L S = N :=
Iff.refl _
#align first_order.language.substructure.cg_def FirstOrder.Language.Substructure.cg_def
| Mathlib/ModelTheory/FinitelyGenerated.lean | 111 | 113 | theorem FG.cg {N : L.Substructure M} (h : N.FG) : N.CG := by |
obtain β¨s, hf, rflβ© := fg_def.1 h
exact β¨s, hf.countable, rflβ©
| 0.0625 |
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent
import Mathlib.Analysis.Calculus.FDeriv.Linear
import Mathlib.Analysis.Calculus.FDeriv.Comp
#align_import analysis.calculus.fderiv.equiv from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee"
open Filter Asymptotics ContinuousLinearMap Set Metric
open scoped Classical
open Topology NNReal Filter Asymptotics ENNReal
noncomputable section
section
variable {π : Type*} [NontriviallyNormedField π]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π G]
variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π G']
variable {f fβ fβ g : E β F}
variable {f' fβ' fβ' g' : E βL[π] F}
variable (e : E βL[π] F)
variable {x : E}
variable {s t : Set E}
variable {L Lβ Lβ : Filter E}
namespace ContinuousLinearEquiv
variable (iso : E βL[π] F)
@[fun_prop]
protected theorem hasStrictFDerivAt : HasStrictFDerivAt iso (iso : E βL[π] F) x :=
iso.toContinuousLinearMap.hasStrictFDerivAt
#align continuous_linear_equiv.has_strict_fderiv_at ContinuousLinearEquiv.hasStrictFDerivAt
@[fun_prop]
protected theorem hasFDerivWithinAt : HasFDerivWithinAt iso (iso : E βL[π] F) s x :=
iso.toContinuousLinearMap.hasFDerivWithinAt
#align continuous_linear_equiv.has_fderiv_within_at ContinuousLinearEquiv.hasFDerivWithinAt
@[fun_prop]
protected theorem hasFDerivAt : HasFDerivAt iso (iso : E βL[π] F) x :=
iso.toContinuousLinearMap.hasFDerivAtFilter
#align continuous_linear_equiv.has_fderiv_at ContinuousLinearEquiv.hasFDerivAt
@[fun_prop]
protected theorem differentiableAt : DifferentiableAt π iso x :=
iso.hasFDerivAt.differentiableAt
#align continuous_linear_equiv.differentiable_at ContinuousLinearEquiv.differentiableAt
@[fun_prop]
protected theorem differentiableWithinAt : DifferentiableWithinAt π iso s x :=
iso.differentiableAt.differentiableWithinAt
#align continuous_linear_equiv.differentiable_within_at ContinuousLinearEquiv.differentiableWithinAt
protected theorem fderiv : fderiv π iso x = iso :=
iso.hasFDerivAt.fderiv
#align continuous_linear_equiv.fderiv ContinuousLinearEquiv.fderiv
protected theorem fderivWithin (hxs : UniqueDiffWithinAt π s x) : fderivWithin π iso s x = iso :=
iso.toContinuousLinearMap.fderivWithin hxs
#align continuous_linear_equiv.fderiv_within ContinuousLinearEquiv.fderivWithin
@[fun_prop]
protected theorem differentiable : Differentiable π iso := fun _ => iso.differentiableAt
#align continuous_linear_equiv.differentiable ContinuousLinearEquiv.differentiable
@[fun_prop]
protected theorem differentiableOn : DifferentiableOn π iso s :=
iso.differentiable.differentiableOn
#align continuous_linear_equiv.differentiable_on ContinuousLinearEquiv.differentiableOn
theorem comp_differentiableWithinAt_iff {f : G β E} {s : Set G} {x : G} :
DifferentiableWithinAt π (iso β f) s x β DifferentiableWithinAt π f s x := by
refine
β¨fun H => ?_, fun H => iso.differentiable.differentiableAt.comp_differentiableWithinAt x Hβ©
have : DifferentiableWithinAt π (iso.symm β iso β f) s x :=
iso.symm.differentiable.differentiableAt.comp_differentiableWithinAt x H
rwa [β Function.comp.assoc iso.symm iso f, iso.symm_comp_self] at this
#align continuous_linear_equiv.comp_differentiable_within_at_iff ContinuousLinearEquiv.comp_differentiableWithinAt_iff
theorem comp_differentiableAt_iff {f : G β E} {x : G} :
DifferentiableAt π (iso β f) x β DifferentiableAt π f x := by
rw [β differentiableWithinAt_univ, β differentiableWithinAt_univ,
iso.comp_differentiableWithinAt_iff]
#align continuous_linear_equiv.comp_differentiable_at_iff ContinuousLinearEquiv.comp_differentiableAt_iff
theorem comp_differentiableOn_iff {f : G β E} {s : Set G} :
DifferentiableOn π (iso β f) s β DifferentiableOn π f s := by
rw [DifferentiableOn, DifferentiableOn]
simp only [iso.comp_differentiableWithinAt_iff]
#align continuous_linear_equiv.comp_differentiable_on_iff ContinuousLinearEquiv.comp_differentiableOn_iff
theorem comp_differentiable_iff {f : G β E} : Differentiable π (iso β f) β Differentiable π f := by
rw [β differentiableOn_univ, β differentiableOn_univ]
exact iso.comp_differentiableOn_iff
#align continuous_linear_equiv.comp_differentiable_iff ContinuousLinearEquiv.comp_differentiable_iff
| Mathlib/Analysis/Calculus/FDeriv/Equiv.lean | 121 | 130 | theorem comp_hasFDerivWithinAt_iff {f : G β E} {s : Set G} {x : G} {f' : G βL[π] E} :
HasFDerivWithinAt (iso β f) ((iso : E βL[π] F).comp f') s x β HasFDerivWithinAt f f' s x := by |
refine β¨fun H => ?_, fun H => iso.hasFDerivAt.comp_hasFDerivWithinAt x Hβ©
have A : f = iso.symm β iso β f := by
rw [β Function.comp.assoc, iso.symm_comp_self]
rfl
have B : f' = (iso.symm : F βL[π] E).comp ((iso : E βL[π] F).comp f') := by
rw [β ContinuousLinearMap.comp_assoc, iso.coe_symm_comp_coe, ContinuousLinearMap.id_comp]
rw [A, B]
exact iso.symm.hasFDerivAt.comp_hasFDerivWithinAt x H
| 0.0625 |
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff
import Mathlib.FieldTheory.Finite.Basic
import Mathlib.Data.Matrix.CharP
#align_import linear_algebra.matrix.charpoly.finite_field from "leanprover-community/mathlib"@"b95b8c7a484a298228805c72c142f6b062eb0d70"
noncomputable section
open Polynomial Matrix
open scoped Polynomial
variable {n : Type*} [DecidableEq n] [Fintype n]
@[simp]
theorem FiniteField.Matrix.charpoly_pow_card {K : Type*} [Field K] [Fintype K] (M : Matrix n n K) :
(M ^ Fintype.card K).charpoly = M.charpoly := by
cases (isEmpty_or_nonempty n).symm
Β· cases' CharP.exists K with p hp; letI := hp
rcases FiniteField.card K p with β¨β¨k, kposβ©, β¨hp, hkβ©β©
haveI : Fact p.Prime := β¨hpβ©
dsimp at hk; rw [hk]
apply (frobenius_inj K[X] p).iterate k
repeat' rw [iterate_frobenius (R := K[X])]; rw [β hk]
rw [β FiniteField.expand_card]
unfold charpoly
rw [AlgHom.map_det, β coe_detMonoidHom, β (detMonoidHom : Matrix n n K[X] β* K[X]).map_pow]
apply congr_arg det
refine matPolyEquiv.injective ?_
rw [AlgEquiv.map_pow, matPolyEquiv_charmatrix, hk, sub_pow_char_pow_of_commute, β C_pow]
Β· exact (id (matPolyEquiv_eq_X_pow_sub_C (p ^ k) M) : _)
Β· exact (C M).commute_X
Β· exact congr_arg _ (Subsingleton.elim _ _)
#align finite_field.matrix.charpoly_pow_card FiniteField.Matrix.charpoly_pow_card
@[simp]
theorem ZMod.charpoly_pow_card {p : β} [Fact p.Prime] (M : Matrix n n (ZMod p)) :
(M ^ p).charpoly = M.charpoly := by
have h := FiniteField.Matrix.charpoly_pow_card M
rwa [ZMod.card] at h
#align zmod.charpoly_pow_card ZMod.charpoly_pow_card
| Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean | 53 | 58 | theorem FiniteField.trace_pow_card {K : Type*} [Field K] [Fintype K] (M : Matrix n n K) :
trace (M ^ Fintype.card K) = trace M ^ Fintype.card K := by |
cases isEmpty_or_nonempty n
Β· simp [Matrix.trace]
rw [Matrix.trace_eq_neg_charpoly_coeff, Matrix.trace_eq_neg_charpoly_coeff,
FiniteField.Matrix.charpoly_pow_card, FiniteField.pow_card]
| 0.0625 |
import Mathlib.CategoryTheory.Adjunction.Whiskering
import Mathlib.CategoryTheory.Sites.PreservesSheafification
#align_import category_theory.sites.adjunction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
namespace CategoryTheory
open GrothendieckTopology CategoryTheory Limits Opposite
universe v u
variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C)
variable {D : Type*} [Category D]
variable {E : Type*} [Category E]
variable {F : D β₯€ E} {G : E β₯€ D}
variable [HasWeakSheafify J D]
abbrev sheafForget [ConcreteCategory D] [HasSheafCompose J (forget D)] :
Sheaf J D β₯€ SheafOfTypes J :=
sheafCompose J (forget D) β (sheafEquivSheafOfTypes J).functor
set_option linter.uppercaseLean3 false in
#align category_theory.Sheaf_forget CategoryTheory.sheafForget
namespace Sheaf
noncomputable section
@[simps]
def composeEquiv [HasSheafCompose J F] (adj : G β£ F) (X : Sheaf J E) (Y : Sheaf J D) :
((composeAndSheafify J G).obj X βΆ Y) β (X βΆ (sheafCompose J F).obj Y) :=
let A := adj.whiskerRight Cα΅α΅
{ toFun := fun Ξ· => β¨A.homEquiv _ _ (toSheafify J _ β« Ξ·.val)β©
invFun := fun Ξ³ => β¨sheafifyLift J ((A.homEquiv _ _).symm ((sheafToPresheaf _ _).map Ξ³)) Y.2β©
left_inv := by
intro Ξ·
ext1
dsimp
symm
apply sheafifyLift_unique
rw [Equiv.symm_apply_apply]
right_inv := by
intro Ξ³
ext1
dsimp
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [toSheafify_sheafifyLift, Equiv.apply_symm_apply] }
set_option linter.uppercaseLean3 false in
#align category_theory.Sheaf.compose_equiv CategoryTheory.Sheaf.composeEquiv
-- These lemmas have always been bad (#7657), but leanprover/lean4#2644 made `simp` start noticing
attribute [nolint simpNF] CategoryTheory.Sheaf.composeEquiv_apply_val
CategoryTheory.Sheaf.composeEquiv_symm_apply_val
@[simps! unit_app_val counit_app_val]
def adjunction [HasSheafCompose J F] (adj : G β£ F) :
composeAndSheafify J G β£ sheafCompose J F :=
Adjunction.mkOfHomEquiv
{ homEquiv := composeEquiv J adj
homEquiv_naturality_left_symm := fun f g => by
ext1
dsimp [composeEquiv]
rw [sheafifyMap_sheafifyLift]
erw [Adjunction.homEquiv_naturality_left_symm]
rw [whiskeringRight_obj_map]
rfl
homEquiv_naturality_right := fun f g => by
ext
dsimp [composeEquiv]
erw [Adjunction.homEquiv_unit, Adjunction.homEquiv_unit]
dsimp
simp }
set_option linter.uppercaseLean3 false in
#align category_theory.Sheaf.adjunction CategoryTheory.Sheaf.adjunction
instance [F.IsRightAdjoint] : (sheafCompose J F).IsRightAdjoint :=
(adjunction J (Adjunction.ofIsRightAdjoint F)).isRightAdjoint
instance [G.IsLeftAdjoint] : (composeAndSheafify J G).IsLeftAdjoint :=
(adjunction J (Adjunction.ofIsLeftAdjoint G)).isLeftAdjoint
lemma preservesSheafification_of_adjunction (adj : G β£ F) :
J.PreservesSheafification G where
le P Q f hf := by
have := adj.isRightAdjoint
rw [MorphismProperty.inverseImage_iff]
dsimp
intro R hR
rw [β ((adj.whiskerRight Cα΅α΅).homEquiv P R).comp_bijective]
convert (((adj.whiskerRight Cα΅α΅).homEquiv Q R).trans
(hf.homEquiv (R β F) ((sheafCompose J F).obj β¨R, hRβ©).cond)).bijective
ext g X
dsimp [Adjunction.whiskerRight, Adjunction.mkOfUnitCounit]
simp
instance [G.IsLeftAdjoint] : J.PreservesSheafification G :=
preservesSheafification_of_adjunction J (Adjunction.ofIsLeftAdjoint G)
section ForgetToType
variable [ConcreteCategory D] [HasSheafCompose J (forget D)]
abbrev composeAndSheafifyFromTypes (G : Type max v u β₯€ D) : SheafOfTypes J β₯€ Sheaf J D :=
(sheafEquivSheafOfTypes J).inverse β composeAndSheafify _ G
set_option linter.uppercaseLean3 false in
#align category_theory.Sheaf.compose_and_sheafify_from_types CategoryTheory.Sheaf.composeAndSheafifyFromTypes
def adjunctionToTypes {G : Type max v u β₯€ D} (adj : G β£ forget D) :
composeAndSheafifyFromTypes J G β£ sheafForget J :=
(sheafEquivSheafOfTypes J).symm.toAdjunction.comp (adjunction J adj)
set_option linter.uppercaseLean3 false in
#align category_theory.Sheaf.adjunction_to_types CategoryTheory.Sheaf.adjunctionToTypes
@[simp]
| Mathlib/CategoryTheory/Sites/Adjunction.lean | 136 | 143 | theorem adjunctionToTypes_unit_app_val {G : Type max v u β₯€ D} (adj : G β£ forget D)
(Y : SheafOfTypes J) :
((adjunctionToTypes J adj).unit.app Y).val =
(adj.whiskerRight _).unit.app ((sheafOfTypesToPresheaf J).obj Y) β«
whiskerRight (toSheafify J _) (forget D) := by |
dsimp [adjunctionToTypes, Adjunction.comp]
simp
rfl
| 0.0625 |
import Mathlib.Data.List.Nodup
#align_import data.list.duplicate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
variable {Ξ± : Type*}
namespace List
inductive Duplicate (x : Ξ±) : List Ξ± β Prop
| cons_mem {l : List Ξ±} : x β l β Duplicate x (x :: l)
| cons_duplicate {y : Ξ±} {l : List Ξ±} : Duplicate x l β Duplicate x (y :: l)
#align list.duplicate List.Duplicate
local infixl:50 " β+ " => List.Duplicate
variable {l : List Ξ±} {x : Ξ±}
theorem Mem.duplicate_cons_self (h : x β l) : x β+ x :: l :=
Duplicate.cons_mem h
#align list.mem.duplicate_cons_self List.Mem.duplicate_cons_self
theorem Duplicate.duplicate_cons (h : x β+ l) (y : Ξ±) : x β+ y :: l :=
Duplicate.cons_duplicate h
#align list.duplicate.duplicate_cons List.Duplicate.duplicate_cons
theorem Duplicate.mem (h : x β+ l) : x β l := by
induction' h with l' _ y l' _ hm
Β· exact mem_cons_self _ _
Β· exact mem_cons_of_mem _ hm
#align list.duplicate.mem List.Duplicate.mem
theorem Duplicate.mem_cons_self (h : x β+ x :: l) : x β l := by
cases' h with _ h _ _ h
Β· exact h
Β· exact h.mem
#align list.duplicate.mem_cons_self List.Duplicate.mem_cons_self
@[simp]
theorem duplicate_cons_self_iff : x β+ x :: l β x β l :=
β¨Duplicate.mem_cons_self, Mem.duplicate_cons_selfβ©
#align list.duplicate_cons_self_iff List.duplicate_cons_self_iff
theorem Duplicate.ne_nil (h : x β+ l) : l β [] := fun H => (mem_nil_iff x).mp (H βΈ h.mem)
#align list.duplicate.ne_nil List.Duplicate.ne_nil
@[simp]
theorem not_duplicate_nil (x : Ξ±) : Β¬x β+ [] := fun H => H.ne_nil rfl
#align list.not_duplicate_nil List.not_duplicate_nil
theorem Duplicate.ne_singleton (h : x β+ l) (y : Ξ±) : l β [y] := by
induction' h with l' h z l' h _
Β· simp [ne_nil_of_mem h]
Β· simp [ne_nil_of_mem h.mem]
#align list.duplicate.ne_singleton List.Duplicate.ne_singleton
@[simp]
theorem not_duplicate_singleton (x y : Ξ±) : Β¬x β+ [y] := fun H => H.ne_singleton _ rfl
#align list.not_duplicate_singleton List.not_duplicate_singleton
theorem Duplicate.elim_nil (h : x β+ []) : False :=
not_duplicate_nil x h
#align list.duplicate.elim_nil List.Duplicate.elim_nil
theorem Duplicate.elim_singleton {y : Ξ±} (h : x β+ [y]) : False :=
not_duplicate_singleton x y h
#align list.duplicate.elim_singleton List.Duplicate.elim_singleton
theorem duplicate_cons_iff {y : Ξ±} : x β+ y :: l β y = x β§ x β l β¨ x β+ l := by
refine β¨fun h => ?_, fun h => ?_β©
Β· cases' h with _ hm _ _ hm
Β· exact Or.inl β¨rfl, hmβ©
Β· exact Or.inr hm
Β· rcases h with (β¨rfl | hβ© | h)
Β· simpa
Β· exact h.cons_duplicate
#align list.duplicate_cons_iff List.duplicate_cons_iff
theorem Duplicate.of_duplicate_cons {y : Ξ±} (h : x β+ y :: l) (hx : x β y) : x β+ l := by
simpa [duplicate_cons_iff, hx.symm] using h
#align list.duplicate.of_duplicate_cons List.Duplicate.of_duplicate_cons
theorem duplicate_cons_iff_of_ne {y : Ξ±} (hne : x β y) : x β+ y :: l β x β+ l := by
simp [duplicate_cons_iff, hne.symm]
#align list.duplicate_cons_iff_of_ne List.duplicate_cons_iff_of_ne
| Mathlib/Data/List/Duplicate.lean | 106 | 113 | theorem Duplicate.mono_sublist {l' : List Ξ±} (hx : x β+ l) (h : l <+ l') : x β+ l' := by |
induction' h with lβ lβ y _ IH lβ lβ y h IH
Β· exact hx
Β· exact (IH hx).duplicate_cons _
Β· rw [duplicate_cons_iff] at hx β’
rcases hx with (β¨rfl, hxβ© | hx)
Β· simp [h.subset hx]
Β· simp [IH hx]
| 0.0625 |
import Mathlib.Topology.Algebra.Algebra
import Mathlib.Topology.ContinuousFunction.Compact
import Mathlib.Topology.UrysohnsLemma
import Mathlib.Analysis.RCLike.Basic
import Mathlib.Analysis.NormedSpace.Units
import Mathlib.Topology.Algebra.Module.CharacterSpace
#align_import topology.continuous_function.ideals from "leanprover-community/mathlib"@"c2258f7bf086b17eac0929d635403780c39e239f"
open scoped NNReal
namespace ContinuousMap
open TopologicalSpace
section TopologicalRing
variable {X R : Type*} [TopologicalSpace X] [Semiring R]
variable [TopologicalSpace R] [TopologicalSemiring R]
variable (R)
def idealOfSet (s : Set X) : Ideal C(X, R) where
carrier := {f : C(X, R) | β x β sαΆ, f x = 0}
add_mem' {f g} hf hg x hx := by simp [hf x hx, hg x hx, coe_add, Pi.add_apply, add_zero]
zero_mem' _ _ := rfl
smul_mem' c f hf x hx := mul_zero (c x) βΈ congr_arg (fun y => c x * y) (hf x hx)
#align continuous_map.ideal_of_set ContinuousMap.idealOfSet
theorem idealOfSet_closed [T2Space R] (s : Set X) :
IsClosed (idealOfSet R s : Set C(X, R)) := by
simp only [idealOfSet, Submodule.coe_set_mk, Set.setOf_forall]
exact isClosed_iInter fun x => isClosed_iInter fun _ =>
isClosed_eq (continuous_eval_const x) continuous_const
#align continuous_map.ideal_of_set_closed ContinuousMap.idealOfSet_closed
variable {R}
theorem mem_idealOfSet {s : Set X} {f : C(X, R)} :
f β idealOfSet R s β β β¦x : Xβ¦, x β sαΆ β f x = 0 := by
convert Iff.rfl
#align continuous_map.mem_ideal_of_set ContinuousMap.mem_idealOfSet
theorem not_mem_idealOfSet {s : Set X} {f : C(X, R)} : f β idealOfSet R s β β x β sαΆ, f x β 0 := by
simp_rw [mem_idealOfSet]; push_neg; rfl
#align continuous_map.not_mem_ideal_of_set ContinuousMap.not_mem_idealOfSet
def setOfIdeal (I : Ideal C(X, R)) : Set X :=
{x : X | β f β I, (f : C(X, R)) x = 0}αΆ
#align continuous_map.set_of_ideal ContinuousMap.setOfIdeal
theorem not_mem_setOfIdeal {I : Ideal C(X, R)} {x : X} :
x β setOfIdeal I β β β¦f : C(X, R)β¦, f β I β f x = 0 := by
rw [β Set.mem_compl_iff, setOfIdeal, compl_compl, Set.mem_setOf]
#align continuous_map.not_mem_set_of_ideal ContinuousMap.not_mem_setOfIdeal
theorem mem_setOfIdeal {I : Ideal C(X, R)} {x : X} :
x β setOfIdeal I β β f β I, (f : C(X, R)) x β 0 := by
simp_rw [setOfIdeal, Set.mem_compl_iff, Set.mem_setOf]; push_neg; rfl
#align continuous_map.mem_set_of_ideal ContinuousMap.mem_setOfIdeal
theorem setOfIdeal_open [T2Space R] (I : Ideal C(X, R)) : IsOpen (setOfIdeal I) := by
simp only [setOfIdeal, Set.setOf_forall, isOpen_compl_iff]
exact
isClosed_iInter fun f =>
isClosed_iInter fun _ => isClosed_eq (map_continuous f) continuous_const
#align continuous_map.set_of_ideal_open ContinuousMap.setOfIdeal_open
@[simps]
def opensOfIdeal [T2Space R] (I : Ideal C(X, R)) : Opens X :=
β¨setOfIdeal I, setOfIdeal_open Iβ©
#align continuous_map.opens_of_ideal ContinuousMap.opensOfIdeal
@[simp]
theorem setOfTop_eq_univ [Nontrivial R] : setOfIdeal (β€ : Ideal C(X, R)) = Set.univ :=
Set.univ_subset_iff.mp fun _ _ => mem_setOfIdeal.mpr β¨1, Submodule.mem_top, one_ne_zeroβ©
#align continuous_map.set_of_top_eq_univ ContinuousMap.setOfTop_eq_univ
@[simp]
theorem idealOfEmpty_eq_bot : idealOfSet R (β
: Set X) = β₯ :=
Ideal.ext fun f => by
simp only [mem_idealOfSet, Set.compl_empty, Set.mem_univ, forall_true_left, Ideal.mem_bot,
DFunLike.ext_iff, zero_apply]
#align continuous_map.ideal_of_empty_eq_bot ContinuousMap.idealOfEmpty_eq_bot
@[simp]
| Mathlib/Topology/ContinuousFunction/Ideals.lean | 154 | 156 | theorem mem_idealOfSet_compl_singleton (x : X) (f : C(X, R)) :
f β idealOfSet R ({x}αΆ : Set X) β f x = 0 := by |
simp only [mem_idealOfSet, compl_compl, Set.mem_singleton_iff, forall_eq]
| 0.0625 |
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.Order.Ring.Abs
import Mathlib.Data.Nat.Choose.Sum
import Mathlib.RingTheory.PowerSeries.Basic
#align_import ring_theory.power_series.well_known from "leanprover-community/mathlib"@"8199f6717c150a7fe91c4534175f4cf99725978f"
namespace PowerSeries
section Ring
variable {R S : Type*} [Ring R] [Ring S]
def invUnitsSub (u : RΛ£) : PowerSeries R :=
mk fun n => 1 /β u ^ (n + 1)
#align power_series.inv_units_sub PowerSeries.invUnitsSub
@[simp]
theorem coeff_invUnitsSub (u : RΛ£) (n : β) : coeff R n (invUnitsSub u) = 1 /β u ^ (n + 1) :=
coeff_mk _ _
#align power_series.coeff_inv_units_sub PowerSeries.coeff_invUnitsSub
@[simp]
theorem constantCoeff_invUnitsSub (u : RΛ£) : constantCoeff R (invUnitsSub u) = 1 /β u := by
rw [β coeff_zero_eq_constantCoeff_apply, coeff_invUnitsSub, zero_add, pow_one]
#align power_series.constant_coeff_inv_units_sub PowerSeries.constantCoeff_invUnitsSub
@[simp]
| Mathlib/RingTheory/PowerSeries/WellKnown.lean | 52 | 55 | theorem invUnitsSub_mul_X (u : RΛ£) : invUnitsSub u * X = invUnitsSub u * C R u - 1 := by |
ext (_ | n)
Β· simp
Β· simp [n.succ_ne_zero, pow_succ']
| 0.0625 |
import Mathlib.Probability.Notation
import Mathlib.Probability.Process.Stopping
#align_import probability.martingale.basic from "leanprover-community/mathlib"@"ba074af83b6cf54c3104e59402b39410ddbd6dca"
open TopologicalSpace Filter
open scoped NNReal ENNReal MeasureTheory ProbabilityTheory
namespace MeasureTheory
variable {Ξ© E ΞΉ : Type*} [Preorder ΞΉ] {m0 : MeasurableSpace Ξ©} {ΞΌ : Measure Ξ©}
[NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E] {f g : ΞΉ β Ξ© β E} {β± : Filtration ΞΉ m0}
def Martingale (f : ΞΉ β Ξ© β E) (β± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop :=
Adapted β± f β§ β i j, i β€ j β ΞΌ[f j|β± i] =α΅[ΞΌ] f i
#align measure_theory.martingale MeasureTheory.Martingale
def Supermartingale [LE E] (f : ΞΉ β Ξ© β E) (β± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop :=
Adapted β± f β§ (β i j, i β€ j β ΞΌ[f j|β± i] β€α΅[ΞΌ] f i) β§ β i, Integrable (f i) ΞΌ
#align measure_theory.supermartingale MeasureTheory.Supermartingale
def Submartingale [LE E] (f : ΞΉ β Ξ© β E) (β± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop :=
Adapted β± f β§ (β i j, i β€ j β f i β€α΅[ΞΌ] ΞΌ[f j|β± i]) β§ β i, Integrable (f i) ΞΌ
#align measure_theory.submartingale MeasureTheory.Submartingale
theorem martingale_const (β± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] (x : E) :
Martingale (fun _ _ => x) β± ΞΌ :=
β¨adapted_const β± _, fun i j _ => by rw [condexp_const (β±.le _)]β©
#align measure_theory.martingale_const MeasureTheory.martingale_const
theorem martingale_const_fun [OrderBot ΞΉ] (β± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ]
{f : Ξ© β E} (hf : StronglyMeasurable[β± β₯] f) (hfint : Integrable f ΞΌ) :
Martingale (fun _ => f) β± ΞΌ := by
refine β¨fun i => hf.mono <| β±.mono bot_le, fun i j _ => ?_β©
rw [condexp_of_stronglyMeasurable (β±.le _) (hf.mono <| β±.mono bot_le) hfint]
#align measure_theory.martingale_const_fun MeasureTheory.martingale_const_fun
variable (E)
theorem martingale_zero (β± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Martingale (0 : ΞΉ β Ξ© β E) β± ΞΌ :=
β¨adapted_zero E β±, fun i j _ => by rw [Pi.zero_apply, condexp_zero]; simpβ©
#align measure_theory.martingale_zero MeasureTheory.martingale_zero
variable {E}
namespace Martingale
protected theorem adapted (hf : Martingale f β± ΞΌ) : Adapted β± f :=
hf.1
#align measure_theory.martingale.adapted MeasureTheory.Martingale.adapted
protected theorem stronglyMeasurable (hf : Martingale f β± ΞΌ) (i : ΞΉ) :
StronglyMeasurable[β± i] (f i) :=
hf.adapted i
#align measure_theory.martingale.strongly_measurable MeasureTheory.Martingale.stronglyMeasurable
theorem condexp_ae_eq (hf : Martingale f β± ΞΌ) {i j : ΞΉ} (hij : i β€ j) : ΞΌ[f j|β± i] =α΅[ΞΌ] f i :=
hf.2 i j hij
#align measure_theory.martingale.condexp_ae_eq MeasureTheory.Martingale.condexp_ae_eq
protected theorem integrable (hf : Martingale f β± ΞΌ) (i : ΞΉ) : Integrable (f i) ΞΌ :=
integrable_condexp.congr (hf.condexp_ae_eq (le_refl i))
#align measure_theory.martingale.integrable MeasureTheory.Martingale.integrable
theorem setIntegral_eq [SigmaFiniteFiltration ΞΌ β±] (hf : Martingale f β± ΞΌ) {i j : ΞΉ} (hij : i β€ j)
{s : Set Ξ©} (hs : MeasurableSet[β± i] s) : β« Ο in s, f i Ο βΞΌ = β« Ο in s, f j Ο βΞΌ := by
rw [β @setIntegral_condexp _ _ _ _ _ (β± i) m0 _ _ _ (β±.le i) _ (hf.integrable j) hs]
refine setIntegral_congr_ae (β±.le i s hs) ?_
filter_upwards [hf.2 i j hij] with _ heq _ using heq.symm
#align measure_theory.martingale.set_integral_eq MeasureTheory.Martingale.setIntegral_eq
@[deprecated (since := "2024-04-17")]
alias set_integral_eq := setIntegral_eq
| Mathlib/Probability/Martingale/Basic.lean | 119 | 121 | theorem add (hf : Martingale f β± ΞΌ) (hg : Martingale g β± ΞΌ) : Martingale (f + g) β± ΞΌ := by |
refine β¨hf.adapted.add hg.adapted, fun i j hij => ?_β©
exact (condexp_add (hf.integrable j) (hg.integrable j)).trans ((hf.2 i j hij).add (hg.2 i j hij))
| 0.0625 |
import Mathlib.Algebra.GroupWithZero.NonZeroDivisors
import Mathlib.LinearAlgebra.BilinearForm.Properties
open LinearMap (BilinForm)
universe u v w
variable {R : Type*} {M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
variable {Rβ : Type*} {Mβ : Type*} [CommRing Rβ] [AddCommGroup Mβ] [Module Rβ Mβ]
variable {V : Type*} {K : Type*} [Field K] [AddCommGroup V] [Module K V]
variable {B : BilinForm R M} {Bβ : BilinForm Rβ Mβ}
namespace LinearMap
namespace BilinForm
def IsOrtho (B : BilinForm R M) (x y : M) : Prop :=
B x y = 0
#align bilin_form.is_ortho LinearMap.BilinForm.IsOrtho
theorem isOrtho_def {B : BilinForm R M} {x y : M} : B.IsOrtho x y β B x y = 0 :=
Iff.rfl
#align bilin_form.is_ortho_def LinearMap.BilinForm.isOrtho_def
theorem isOrtho_zero_left (x : M) : IsOrtho B (0 : M) x := LinearMap.isOrtho_zero_left B x
#align bilin_form.is_ortho_zero_left LinearMap.BilinForm.isOrtho_zero_left
theorem isOrtho_zero_right (x : M) : IsOrtho B x (0 : M) :=
zero_right x
#align bilin_form.is_ortho_zero_right LinearMap.BilinForm.isOrtho_zero_right
theorem ne_zero_of_not_isOrtho_self {B : BilinForm K V} (x : V) (hxβ : Β¬B.IsOrtho x x) : x β 0 :=
fun hxβ => hxβ (hxβ.symm βΈ isOrtho_zero_left _)
#align bilin_form.ne_zero_of_not_is_ortho_self LinearMap.BilinForm.ne_zero_of_not_isOrtho_self
theorem IsRefl.ortho_comm (H : B.IsRefl) {x y : M} : IsOrtho B x y β IsOrtho B y x :=
β¨eq_zero H, eq_zero Hβ©
#align bilin_form.is_refl.ortho_comm LinearMap.BilinForm.IsRefl.ortho_comm
theorem IsAlt.ortho_comm (H : Bβ.IsAlt) {x y : Mβ} : IsOrtho Bβ x y β IsOrtho Bβ y x :=
LinearMap.IsAlt.ortho_comm H
#align bilin_form.is_alt.ortho_comm LinearMap.BilinForm.IsAlt.ortho_comm
theorem IsSymm.ortho_comm (H : B.IsSymm) {x y : M} : IsOrtho B x y β IsOrtho B y x :=
LinearMap.IsSymm.ortho_comm H
#align bilin_form.is_symm.ortho_comm LinearMap.BilinForm.IsSymm.ortho_comm
def iIsOrtho {n : Type w} (B : BilinForm R M) (v : n β M) : Prop :=
B.IsOrthoα΅’ v
set_option linter.uppercaseLean3 false in
#align bilin_form.is_Ortho LinearMap.BilinForm.iIsOrtho
theorem iIsOrtho_def {n : Type w} {B : BilinForm R M} {v : n β M} :
B.iIsOrtho v β β i j : n, i β j β B (v i) (v j) = 0 :=
Iff.rfl
set_option linter.uppercaseLean3 false in
#align bilin_form.is_Ortho_def LinearMap.BilinForm.iIsOrtho_def
section
variable {Rβ Mβ : Type*} [CommRing Rβ] [IsDomain Rβ]
variable [AddCommGroup Mβ] [Module Rβ Mβ] {G : BilinForm Rβ Mβ}
@[simp]
| Mathlib/LinearAlgebra/BilinearForm/Orthogonal.lean | 100 | 105 | theorem isOrtho_smul_left {x y : Mβ} {a : Rβ} (ha : a β 0) :
IsOrtho G (a β’ x) y β IsOrtho G x y := by |
dsimp only [IsOrtho]
rw [map_smul]
simp only [LinearMap.smul_apply, smul_eq_mul, mul_eq_zero, or_iff_right_iff_imp]
exact fun a β¦ (ha a).elim
| 0.0625 |
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]
| Mathlib/GroupTheory/Perm/Option.lean | 27 | 34 | 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]
| 0.0625 |
import Mathlib.Algebra.DirectSum.Module
import Mathlib.Analysis.Complex.Basic
import Mathlib.Analysis.Convex.Uniform
import Mathlib.Analysis.NormedSpace.Completion
import Mathlib.Analysis.NormedSpace.BoundedLinearMaps
#align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b"
noncomputable section
open RCLike Real Filter
open Topology ComplexConjugate
open LinearMap (BilinForm)
variable {π E F : Type*} [RCLike π]
class Inner (π E : Type*) where
inner : E β E β π
#align has_inner Inner
export Inner (inner)
notation3:max "βͺ" x ", " y "β«_" π:max => @inner π _ _ x y
class InnerProductSpace (π : Type*) (E : Type*) [RCLike π] [NormedAddCommGroup E] extends
NormedSpace π E, Inner π E where
norm_sq_eq_inner : β x : E, βxβ ^ 2 = re (inner x x)
conj_symm : β x y, conj (inner y x) = inner x y
add_left : β x y z, inner (x + y) z = inner x z + inner y z
smul_left : β x y r, inner (r β’ x) y = conj r * inner x y
#align inner_product_space InnerProductSpace
-- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore
structure InnerProductSpace.Core (π : Type*) (F : Type*) [RCLike π] [AddCommGroup F]
[Module π F] extends Inner π F where
conj_symm : β x y, conj (inner y x) = inner x y
nonneg_re : β x, 0 β€ re (inner x x)
definite : β x, inner x x = 0 β x = 0
add_left : β x y z, inner (x + y) z = inner x z + inner y z
smul_left : β x y r, inner (r β’ x) y = conj r * inner x y
#align inner_product_space.core InnerProductSpace.Core
attribute [class] InnerProductSpace.Core
def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π E] :
InnerProductSpace.Core π E :=
{ c with
nonneg_re := fun x => by
rw [β InnerProductSpace.norm_sq_eq_inner]
apply sq_nonneg
definite := fun x hx =>
norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by
rw [InnerProductSpace.norm_sq_eq_inner (π := π) x, hx, map_zero] }
#align inner_product_space.to_core InnerProductSpace.toCore
namespace InnerProductSpace.Core
variable [AddCommGroup F] [Module π F] [c : InnerProductSpace.Core π F]
local notation "βͺ" x ", " y "β«" => @inner π F _ x y
local notation "normSqK" => @RCLike.normSq π _
local notation "reK" => @RCLike.re π _
local notation "ext_iff" => @RCLike.ext_iff π _
local postfix:90 "β " => starRingEnd _
def toInner' : Inner π F :=
c.toInner
#align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner'
attribute [local instance] toInner'
def normSq (x : F) :=
reK βͺx, xβ«
#align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq
local notation "normSqF" => @normSq π F _ _ _ _
theorem inner_conj_symm (x y : F) : βͺy, xβ«β = βͺx, yβ« :=
c.conj_symm x y
#align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm
theorem inner_self_nonneg {x : F} : 0 β€ re βͺx, xβ« :=
c.nonneg_re _
#align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg
theorem inner_self_im (x : F) : im βͺx, xβ« = 0 := by
rw [β @ofReal_inj π, im_eq_conj_sub]
simp [inner_conj_symm]
#align inner_product_space.core.inner_self_im InnerProductSpace.Core.inner_self_im
theorem inner_add_left (x y z : F) : βͺx + y, zβ« = βͺx, zβ« + βͺy, zβ« :=
c.add_left _ _ _
#align inner_product_space.core.inner_add_left InnerProductSpace.Core.inner_add_left
theorem inner_add_right (x y z : F) : βͺx, y + zβ« = βͺx, yβ« + βͺx, zβ« := by
rw [β inner_conj_symm, inner_add_left, RingHom.map_add]; simp only [inner_conj_symm]
#align inner_product_space.core.inner_add_right InnerProductSpace.Core.inner_add_right
theorem ofReal_normSq_eq_inner_self (x : F) : (normSqF x : π) = βͺx, xβ« := by
rw [ext_iff]
exact β¨by simp only [ofReal_re]; rfl, by simp only [inner_self_im, ofReal_im]β©
#align inner_product_space.core.coe_norm_sq_eq_inner_self InnerProductSpace.Core.ofReal_normSq_eq_inner_self
theorem inner_re_symm (x y : F) : re βͺx, yβ« = re βͺy, xβ« := by rw [β inner_conj_symm, conj_re]
#align inner_product_space.core.inner_re_symm InnerProductSpace.Core.inner_re_symm
| Mathlib/Analysis/InnerProductSpace/Basic.lean | 232 | 232 | theorem inner_im_symm (x y : F) : im βͺx, yβ« = -im βͺy, xβ« := by | rw [β inner_conj_symm, conj_im]
| 0.0625 |
import Mathlib.Data.List.Basic
namespace List
variable {Ξ± Ξ² : Type*}
@[simp]
theorem reduceOption_cons_of_some (x : Ξ±) (l : List (Option Ξ±)) :
reduceOption (some x :: l) = x :: l.reduceOption := by
simp only [reduceOption, filterMap, id, eq_self_iff_true, and_self_iff]
#align list.reduce_option_cons_of_some List.reduceOption_cons_of_some
@[simp]
theorem reduceOption_cons_of_none (l : List (Option Ξ±)) :
reduceOption (none :: l) = l.reduceOption := by simp only [reduceOption, filterMap, id]
#align list.reduce_option_cons_of_none List.reduceOption_cons_of_none
@[simp]
theorem reduceOption_nil : @reduceOption Ξ± [] = [] :=
rfl
#align list.reduce_option_nil List.reduceOption_nil
@[simp]
theorem reduceOption_map {l : List (Option Ξ±)} {f : Ξ± β Ξ²} :
reduceOption (map (Option.map f) l) = map f (reduceOption l) := by
induction' l with hd tl hl
Β· simp only [reduceOption_nil, map_nil]
Β· cases hd <;>
simpa [true_and_iff, Option.map_some', map, eq_self_iff_true,
reduceOption_cons_of_some] using hl
#align list.reduce_option_map List.reduceOption_map
theorem reduceOption_append (l l' : List (Option Ξ±)) :
(l ++ l').reduceOption = l.reduceOption ++ l'.reduceOption :=
filterMap_append l l' id
#align list.reduce_option_append List.reduceOption_append
theorem reduceOption_length_eq {l : List (Option Ξ±)} :
l.reduceOption.length = (l.filter Option.isSome).length := by
induction' l with hd tl hl
Β· simp_rw [reduceOption_nil, filter_nil, length]
Β· cases hd <;> simp [hl]
theorem length_eq_reduceOption_length_add_filter_none {l : List (Option Ξ±)} :
l.length = l.reduceOption.length + (l.filter Option.isNone).length := by
simp_rw [reduceOption_length_eq, l.length_eq_length_filter_add Option.isSome, Option.bnot_isSome]
theorem reduceOption_length_le (l : List (Option Ξ±)) : l.reduceOption.length β€ l.length := by
rw [length_eq_reduceOption_length_add_filter_none]
apply Nat.le_add_right
#align list.reduce_option_length_le List.reduceOption_length_le
theorem reduceOption_length_eq_iff {l : List (Option Ξ±)} :
l.reduceOption.length = l.length β β x β l, Option.isSome x := by
rw [reduceOption_length_eq, List.filter_length_eq_length]
#align list.reduce_option_length_eq_iff List.reduceOption_length_eq_iff
theorem reduceOption_length_lt_iff {l : List (Option Ξ±)} :
l.reduceOption.length < l.length β none β l := by
rw [Nat.lt_iff_le_and_ne, and_iff_right (reduceOption_length_le l), Ne,
reduceOption_length_eq_iff]
induction l <;> simp [*]
rw [@eq_comm _ none, β Option.not_isSome_iff_eq_none, Decidable.imp_iff_not_or]
#align list.reduce_option_length_lt_iff List.reduceOption_length_lt_iff
theorem reduceOption_singleton (x : Option Ξ±) : [x].reduceOption = x.toList := by cases x <;> rfl
#align list.reduce_option_singleton List.reduceOption_singleton
theorem reduceOption_concat (l : List (Option Ξ±)) (x : Option Ξ±) :
(l.concat x).reduceOption = l.reduceOption ++ x.toList := by
induction' l with hd tl hl generalizing x
Β· cases x <;> simp [Option.toList]
Β· simp only [concat_eq_append, reduceOption_append] at hl
cases hd <;> simp [hl, reduceOption_append]
#align list.reduce_option_concat List.reduceOption_concat
| Mathlib/Data/List/ReduceOption.lean | 88 | 90 | theorem reduceOption_concat_of_some (l : List (Option Ξ±)) (x : Ξ±) :
(l.concat (some x)).reduceOption = l.reduceOption.concat x := by |
simp only [reduceOption_nil, concat_eq_append, reduceOption_append, reduceOption_cons_of_some]
| 0.0625 |
import Mathlib.Order.Filter.Ultrafilter
import Mathlib.Order.Filter.Germ
#align_import order.filter.filter_product from "leanprover-community/mathlib"@"2738d2ca56cbc63be80c3bd48e9ed90ad94e947d"
universe u v
variable {Ξ± : Type u} {Ξ² : Type v} {Ο : Ultrafilter Ξ±}
open scoped Classical
namespace Filter
local notation3 "β* "(...)", "r:(scoped p => Filter.Eventually p (Ultrafilter.toFilter Ο)) => r
namespace Germ
open Ultrafilter
local notation "Ξ²*" => Germ (Ο : Filter Ξ±) Ξ²
instance instGroupWithZero [GroupWithZero Ξ²] : GroupWithZero Ξ²* where
__ := instDivInvMonoid
__ := instMonoidWithZero
mul_inv_cancel f := inductionOn f fun f hf β¦ coe_eq.2 <| (Ο.em fun y β¦ f y = 0).elim
(fun H β¦ (hf <| coe_eq.2 H).elim) fun H β¦ H.mono fun x β¦ mul_inv_cancel
inv_zero := coe_eq.2 <| by simp only [Function.comp, inv_zero, EventuallyEq.rfl]
instance instDivisionSemiring [DivisionSemiring Ξ²] : DivisionSemiring Ξ²* where
toSemiring := instSemiring
__ := instGroupWithZero
nnqsmul := _
instance instDivisionRing [DivisionRing Ξ²] : DivisionRing Ξ²* where
__ := instRing
__ := instDivisionSemiring
qsmul := _
instance instSemifield [Semifield Ξ²] : Semifield Ξ²* where
__ := instCommSemiring
__ := instDivisionSemiring
instance instField [Field Ξ²] : Field Ξ²* where
__ := instCommRing
__ := instDivisionRing
| Mathlib/Order/Filter/FilterProduct.lean | 65 | 66 | theorem coe_lt [Preorder Ξ²] {f g : Ξ± β Ξ²} : (f : Ξ²*) < g β β* x, f x < g x := by |
simp only [lt_iff_le_not_le, eventually_and, coe_le, eventually_not, EventuallyLE]
| 0.0625 |
import Mathlib.Analysis.InnerProductSpace.Dual
import Mathlib.Analysis.Calculus.FDeriv.Basic
import Mathlib.Analysis.Calculus.Deriv.Basic
open Topology InnerProductSpace Set
noncomputable section
variable {π F : Type*} [RCLike π]
variable [NormedAddCommGroup F] [InnerProductSpace π F] [CompleteSpace F]
variable {f : F β π} {f' x : F}
def HasGradientAtFilter (f : F β π) (f' x : F) (L : Filter F) :=
HasFDerivAtFilter f (toDual π F f') x L
def HasGradientWithinAt (f : F β π) (f' : F) (s : Set F) (x : F) :=
HasGradientAtFilter f f' x (π[s] x)
def HasGradientAt (f : F β π) (f' x : F) :=
HasGradientAtFilter f f' x (π x)
def gradientWithin (f : F β π) (s : Set F) (x : F) : F :=
(toDual π F).symm (fderivWithin π f s x)
def gradient (f : F β π) (x : F) : F :=
(toDual π F).symm (fderiv π f x)
@[inherit_doc]
scoped[Gradient] notation "β" => gradient
local notation "βͺ" x ", " y "β«" => @inner π _ _ x y
open scoped Gradient
variable {s : Set F} {L : Filter F}
theorem hasGradientWithinAt_iff_hasFDerivWithinAt {s : Set F} :
HasGradientWithinAt f f' s x β HasFDerivWithinAt f (toDual π F f') s x :=
Iff.rfl
theorem hasFDerivWithinAt_iff_hasGradientWithinAt {frechet : F βL[π] π} {s : Set F} :
HasFDerivWithinAt f frechet s x β HasGradientWithinAt f ((toDual π F).symm frechet) s x := by
rw [hasGradientWithinAt_iff_hasFDerivWithinAt, (toDual π F).apply_symm_apply frechet]
theorem hasGradientAt_iff_hasFDerivAt :
HasGradientAt f f' x β HasFDerivAt f (toDual π F f') x :=
Iff.rfl
theorem hasFDerivAt_iff_hasGradientAt {frechet : F βL[π] π} :
HasFDerivAt f frechet x β HasGradientAt f ((toDual π F).symm frechet) x := by
rw [hasGradientAt_iff_hasFDerivAt, (toDual π F).apply_symm_apply frechet]
alias β¨HasGradientWithinAt.hasFDerivWithinAt, _β© := hasGradientWithinAt_iff_hasFDerivWithinAt
alias β¨HasFDerivWithinAt.hasGradientWithinAt, _β© := hasFDerivWithinAt_iff_hasGradientWithinAt
alias β¨HasGradientAt.hasFDerivAt, _β© := hasGradientAt_iff_hasFDerivAt
alias β¨HasFDerivAt.hasGradientAt, _β© := hasFDerivAt_iff_hasGradientAt
theorem gradient_eq_zero_of_not_differentiableAt (h : Β¬DifferentiableAt π f x) : β f x = 0 := by
rw [gradient, fderiv_zero_of_not_differentiableAt h, map_zero]
theorem HasGradientAt.unique {gradf gradg : F}
(hf : HasGradientAt f gradf x) (hg : HasGradientAt f gradg x) :
gradf = gradg :=
(toDual π F).injective (hf.hasFDerivAt.unique hg.hasFDerivAt)
theorem DifferentiableAt.hasGradientAt (h : DifferentiableAt π f x) :
HasGradientAt f (β f x) x := by
rw [hasGradientAt_iff_hasFDerivAt, gradient, (toDual π F).apply_symm_apply (fderiv π f x)]
exact h.hasFDerivAt
theorem HasGradientAt.differentiableAt (h : HasGradientAt f f' x) :
DifferentiableAt π f x :=
h.hasFDerivAt.differentiableAt
theorem DifferentiableWithinAt.hasGradientWithinAt (h : DifferentiableWithinAt π f s x) :
HasGradientWithinAt f (gradientWithin f s x) s x := by
rw [hasGradientWithinAt_iff_hasFDerivWithinAt, gradientWithin,
(toDual π F).apply_symm_apply (fderivWithin π f s x)]
exact h.hasFDerivWithinAt
theorem HasGradientWithinAt.differentiableWithinAt (h : HasGradientWithinAt f f' s x) :
DifferentiableWithinAt π f s x :=
h.hasFDerivWithinAt.differentiableWithinAt
@[simp]
theorem hasGradientWithinAt_univ : HasGradientWithinAt f f' univ x β HasGradientAt f f' x := by
rw [hasGradientWithinAt_iff_hasFDerivWithinAt, hasGradientAt_iff_hasFDerivAt]
exact hasFDerivWithinAt_univ
theorem DifferentiableOn.hasGradientAt (h : DifferentiableOn π f s) (hs : s β π x) :
HasGradientAt f (β f x) x :=
(h.hasFDerivAt hs).hasGradientAt
theorem HasGradientAt.gradient (h : HasGradientAt f f' x) : β f x = f' :=
h.differentiableAt.hasGradientAt.unique h
theorem gradient_eq {f' : F β F} (h : β x, HasGradientAt f (f' x) x) : β f = f' :=
funext fun x => (h x).gradient
section OneDimension
variable {g : π β π} {g' u : π} {L' : Filter π}
theorem HasGradientAtFilter.hasDerivAtFilter (h : HasGradientAtFilter g g' u L') :
HasDerivAtFilter g (starRingEnd π g') u L' := by
have : ContinuousLinearMap.smulRight (1 : π βL[π] π) (starRingEnd π g') = (toDual π π) g' := by
ext; simp
rwa [HasDerivAtFilter, this]
| Mathlib/Analysis/Calculus/Gradient/Basic.lean | 162 | 166 | theorem HasDerivAtFilter.hasGradientAtFilter (h : HasDerivAtFilter g g' u L') :
HasGradientAtFilter g (starRingEnd π g') u L' := by |
have : ContinuousLinearMap.smulRight (1 : π βL[π] π) g' = (toDual π π) (starRingEnd π g') := by
ext; simp
rwa [HasGradientAtFilter, β this]
| 0.0625 |
import Mathlib.FieldTheory.SeparableClosure
import Mathlib.Algebra.CharP.IntermediateField
open FiniteDimensional Polynomial IntermediateField Field
noncomputable section
universe u v w
variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E]
variable (K : Type w) [Field K] [Algebra F K]
section perfectClosure
def perfectClosure : IntermediateField F E where
carrier := {x : E | β n : β, x ^ (ringExpChar F) ^ n β (algebraMap F E).range}
add_mem' := by
rintro x y β¨n, hxβ© β¨m, hyβ©
use n + m
have := expChar_of_injective_algebraMap (algebraMap F E).injective (ringExpChar F)
rw [add_pow_expChar_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul]
exact add_mem (pow_mem hx _) (pow_mem hy _)
mul_mem' := by
rintro x y β¨n, hxβ© β¨m, hyβ©
use n + m
rw [mul_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul]
exact mul_mem (pow_mem hx _) (pow_mem hy _)
inv_mem' := by
rintro x β¨n, hxβ©
use n; rw [inv_pow]
apply inv_mem (id hx : _ β (β₯ : IntermediateField F E))
algebraMap_mem' := fun x β¦ β¨0, by rw [pow_zero, pow_one]; exact β¨x, rflβ©β©
variable {F E}
theorem mem_perfectClosure_iff {x : E} :
x β perfectClosure F E β β n : β, x ^ (ringExpChar F) ^ n β (algebraMap F E).range := Iff.rfl
theorem mem_perfectClosure_iff_pow_mem (q : β) [ExpChar F q] {x : E} :
x β perfectClosure F E β β n : β, x ^ q ^ n β (algebraMap F E).range := by
rw [mem_perfectClosure_iff, ringExpChar.eq F q]
| Mathlib/FieldTheory/PurelyInseparable.lean | 287 | 289 | theorem mem_perfectClosure_iff_natSepDegree_eq_one {x : E} :
x β perfectClosure F E β (minpoly F x).natSepDegree = 1 := by |
rw [mem_perfectClosure_iff, minpoly.natSepDegree_eq_one_iff_pow_mem (ringExpChar F)]
| 0.0625 |
import Mathlib.Data.Set.Pointwise.SMul
#align_import algebra.add_torsor from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
class AddTorsor (G : outParam Type*) (P : Type*) [AddGroup G] extends AddAction G P,
VSub G P where
[nonempty : Nonempty P]
vsub_vadd' : β pβ pβ : P, (pβ -α΅₯ pβ : G) +α΅₯ pβ = pβ
vadd_vsub' : β (g : G) (p : P), g +α΅₯ p -α΅₯ p = g
#align add_torsor AddTorsor
-- Porting note(#12096): removed `nolint instance_priority`; lint not ported yet
attribute [instance 100] AddTorsor.nonempty
-- Porting note(#12094): removed nolint; dangerous_instance linter not ported yet
--attribute [nolint dangerous_instance] AddTorsor.toVSub
-- Porting note(#12096): linter not ported yet
--@[nolint instance_priority]
instance addGroupIsAddTorsor (G : Type*) [AddGroup G] : AddTorsor G G where
vsub := Sub.sub
vsub_vadd' := sub_add_cancel
vadd_vsub' := add_sub_cancel_right
#align add_group_is_add_torsor addGroupIsAddTorsor
@[simp]
theorem vsub_eq_sub {G : Type*} [AddGroup G] (gβ gβ : G) : gβ -α΅₯ gβ = gβ - gβ :=
rfl
#align vsub_eq_sub vsub_eq_sub
section General
variable {G : Type*} {P : Type*} [AddGroup G] [T : AddTorsor G P]
@[simp]
theorem vsub_vadd (pβ pβ : P) : pβ -α΅₯ pβ +α΅₯ pβ = pβ :=
AddTorsor.vsub_vadd' pβ pβ
#align vsub_vadd vsub_vadd
@[simp]
theorem vadd_vsub (g : G) (p : P) : g +α΅₯ p -α΅₯ p = g :=
AddTorsor.vadd_vsub' g p
#align vadd_vsub vadd_vsub
theorem vadd_right_cancel {gβ gβ : G} (p : P) (h : gβ +α΅₯ p = gβ +α΅₯ p) : gβ = gβ := by
-- Porting note: vadd_vsub gβ β vadd_vsub gβ p
rw [β vadd_vsub gβ p, h, vadd_vsub]
#align vadd_right_cancel vadd_right_cancel
@[simp]
theorem vadd_right_cancel_iff {gβ gβ : G} (p : P) : gβ +α΅₯ p = gβ +α΅₯ p β gβ = gβ :=
β¨vadd_right_cancel p, fun h => h βΈ rflβ©
#align vadd_right_cancel_iff vadd_right_cancel_iff
theorem vadd_right_injective (p : P) : Function.Injective ((Β· +α΅₯ p) : G β P) := fun _ _ =>
vadd_right_cancel p
#align vadd_right_injective vadd_right_injective
theorem vadd_vsub_assoc (g : G) (pβ pβ : P) : g +α΅₯ pβ -α΅₯ pβ = g + (pβ -α΅₯ pβ) := by
apply vadd_right_cancel pβ
rw [vsub_vadd, add_vadd, vsub_vadd]
#align vadd_vsub_assoc vadd_vsub_assoc
@[simp]
| Mathlib/Algebra/AddTorsor.lean | 124 | 125 | theorem vsub_self (p : P) : p -α΅₯ p = (0 : G) := by |
rw [β zero_add (p -α΅₯ p), β vadd_vsub_assoc, vadd_vsub]
| 0.0625 |
import Mathlib.Data.List.Defs
import Mathlib.Data.Option.Basic
import Mathlib.Data.Nat.Defs
import Mathlib.Init.Data.List.Basic
import Mathlib.Util.AssertExists
-- Make sure we haven't imported `Data.Nat.Order.Basic`
assert_not_exists OrderedSub
namespace List
universe u v
variable {Ξ± : Type u} {Ξ² : Type v} (l : List Ξ±) (x : Ξ±) (xs : List Ξ±) (n : β)
section getD
variable (d : Ξ±)
#align list.nthd_nil List.getD_nilβ -- argument order
#align list.nthd_cons_zero List.getD_cons_zeroβ -- argument order
#align list.nthd_cons_succ List.getD_cons_succβ -- argument order
theorem getD_eq_get {n : β} (hn : n < l.length) : l.getD n d = l.get β¨n, hnβ© := by
induction l generalizing n with
| nil => simp at hn
| cons head tail ih =>
cases n
Β· exact getD_cons_zero
Β· exact ih _
@[simp]
theorem getD_map {n : β} (f : Ξ± β Ξ²) : (map f l).getD n (f d) = f (l.getD n d) := by
induction l generalizing n with
| nil => rfl
| cons head tail ih =>
cases n
Β· rfl
Β· simp [ih]
#align list.nthd_eq_nth_le List.getD_eq_get
theorem getD_eq_default {n : β} (hn : l.length β€ n) : l.getD n d = d := by
induction l generalizing n with
| nil => exact getD_nil
| cons head tail ih =>
cases n
Β· simp at hn
Β· exact ih (Nat.le_of_succ_le_succ hn)
#align list.nthd_eq_default List.getD_eq_defaultβ -- argument order
def decidableGetDNilNe (a : Ξ±) : DecidablePred fun i : β => getD ([] : List Ξ±) i a β a :=
fun _ => isFalse fun H => H getD_nil
#align list.decidable_nthd_nil_ne List.decidableGetDNilNeβ -- argument order
@[simp]
theorem getD_singleton_default_eq (n : β) : [d].getD n d = d := by cases n <;> simp
#align list.nthd_singleton_default_eq List.getD_singleton_default_eqβ -- argument order
@[simp]
theorem getD_replicate_default_eq (r n : β) : (replicate r d).getD n d = d := by
induction r generalizing n with
| zero => simp
| succ n ih => cases n <;> simp [ih]
#align list.nthd_replicate_default_eq List.getD_replicate_default_eqβ -- argument order
| Mathlib/Data/List/GetD.lean | 83 | 86 | theorem getD_append (l l' : List Ξ±) (d : Ξ±) (n : β) (h : n < l.length) :
(l ++ l').getD n d = l.getD n d := by |
rw [getD_eq_get _ _ (Nat.lt_of_lt_of_le h (length_append _ _ βΈ Nat.le_add_right _ _)),
get_append _ h, getD_eq_get]
| 0.0625 |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.BigOperators.Finsupp
#align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*}
-- the same local notation used in `Algebra.Associated`
local infixl:50 " ~α΅€ " => Associated
theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M Γ N} :
x ~α΅€ z β x.1 ~α΅€ z.1 β§ x.2 ~α΅€ z.2 :=
β¨fun β¨u, huβ© => β¨β¨(MulEquiv.prodUnits.toFun u).1, (Prod.eq_iff_fst_eq_snd_eq.1 hu).1β©,
β¨(MulEquiv.prodUnits.toFun u).2, (Prod.eq_iff_fst_eq_snd_eq.1 hu).2β©β©,
fun β¨β¨uβ, hββ©, β¨uβ, hββ©β© =>
β¨MulEquiv.prodUnits.invFun (uβ, uβ), Prod.eq_iff_fst_eq_snd_eq.2 β¨hβ, hββ©β©β©
theorem Associated.prod {M : Type*} [CommMonoid M] {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β M)
(g : ΞΉ β M) (h : β i, i β s β (f i) ~α΅€ (g i)) : (β i β s, f i) ~α΅€ (β i β s, g i) := by
induction s using Finset.induction with
| empty =>
simp only [Finset.prod_empty]
rfl
| @insert j s hjs IH =>
classical
convert_to (β i β insert j s, f i) ~α΅€ (β i β insert j s, g i)
rw [Finset.prod_insert hjs, Finset.prod_insert hjs]
exact Associated.mul_mul (h j (Finset.mem_insert_self j s))
(IH (fun i hi β¦ h i (Finset.mem_insert_of_mem hi)))
theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero Ξ±] {p : Ξ±} (hp : Prime p)
{s : Multiset Ξ±} : (β r β s, Prime r) β p β£ s.prod β β q β s, p ~α΅€ q :=
Multiset.induction_on s (by simp [mt isUnit_iff_dvd_one.2 hp.not_unit]) fun a s ih hs hps => by
rw [Multiset.prod_cons] at hps
cases' hp.dvd_or_dvd hps with h h
Β· have hap := hs a (Multiset.mem_cons.2 (Or.inl rfl))
exact β¨a, Multiset.mem_cons_self a _, hp.associated_of_dvd hap hβ©
Β· rcases ih (fun r hr => hs _ (Multiset.mem_cons.2 (Or.inr hr))) h with β¨q, hqβ, hqββ©
exact β¨q, Multiset.mem_cons.2 (Or.inr hqβ), hqββ©
#align exists_associated_mem_of_dvd_prod exists_associated_mem_of_dvd_prod
theorem Multiset.prod_primes_dvd [CancelCommMonoidWithZero Ξ±]
[β a : Ξ±, DecidablePred (Associated a)] {s : Multiset Ξ±} (n : Ξ±) (h : β a β s, Prime a)
(div : β a β s, a β£ n) (uniq : β a, s.countP (Associated a) β€ 1) : s.prod β£ n := by
induction' s using Multiset.induction_on with a s induct n primes divs generalizing n
Β· simp only [Multiset.prod_zero, one_dvd]
Β· rw [Multiset.prod_cons]
obtain β¨k, rflβ© : a β£ n := div a (Multiset.mem_cons_self a s)
apply mul_dvd_mul_left a
refine induct _ (fun a ha => h a (Multiset.mem_cons_of_mem ha)) (fun b b_in_s => ?_)
fun a => (Multiset.countP_le_of_le _ (Multiset.le_cons_self _ _)).trans (uniq a)
have b_div_n := div b (Multiset.mem_cons_of_mem b_in_s)
have a_prime := h a (Multiset.mem_cons_self a s)
have b_prime := h b (Multiset.mem_cons_of_mem b_in_s)
refine (b_prime.dvd_or_dvd b_div_n).resolve_left fun b_div_a => ?_
have assoc := b_prime.associated_of_dvd a_prime b_div_a
have := uniq a
rw [Multiset.countP_cons_of_pos _ (Associated.refl _), Nat.succ_le_succ_iff, β not_lt,
Multiset.countP_pos] at this
exact this β¨b, b_in_s, assoc.symmβ©
#align multiset.prod_primes_dvd Multiset.prod_primes_dvd
theorem Finset.prod_primes_dvd [CancelCommMonoidWithZero Ξ±] [Unique Ξ±Λ£] {s : Finset Ξ±} (n : Ξ±)
(h : β a β s, Prime a) (div : β a β s, a β£ n) : (β p β s, p) β£ n := by
classical
exact
Multiset.prod_primes_dvd n (by simpa only [Multiset.map_id', Finset.mem_def] using h)
(by simpa only [Multiset.map_id', Finset.mem_def] using div)
(by
simp only [Multiset.map_id', associated_eq_eq, Multiset.countP_eq_card_filter,
β s.val.count_eq_card_filter_eq, β Multiset.nodup_iff_count_le_one, s.nodup])
#align finset.prod_primes_dvd Finset.prod_primes_dvd
namespace Associates
section CommMonoid
variable [CommMonoid Ξ±]
theorem prod_mk {p : Multiset Ξ±} : (p.map Associates.mk).prod = Associates.mk p.prod :=
Multiset.induction_on p (by simp) fun a s ih => by simp [ih, Associates.mk_mul_mk]
#align associates.prod_mk Associates.prod_mk
| Mathlib/Algebra/BigOperators/Associated.lean | 124 | 130 | theorem finset_prod_mk {p : Finset Ξ²} {f : Ξ² β Ξ±} :
(β i β p, Associates.mk (f i)) = Associates.mk (β i β p, f i) := by |
-- Porting note: added
have : (fun i => Associates.mk (f i)) = Associates.mk β f :=
funext fun x => Function.comp_apply
rw [Finset.prod_eq_multiset_prod, this, β Multiset.map_map, prod_mk,
β Finset.prod_eq_multiset_prod]
| 0.0625 |
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
theorem toMultiset_map (f : Ξ± ββ β) (g : Ξ± β Ξ²) :
f.toMultiset.map g = toMultiset (f.mapDomain g) := by
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
#align finsupp.to_multiset_map Finsupp.toMultiset_map
@[to_additive (attr := simp)]
| Mathlib/Data/Finsupp/Multiset.lean | 83 | 90 | theorem prod_toMultiset [CommMonoid Ξ±] (f : Ξ± ββ β) :
f.toMultiset.prod = f.prod fun a n => a ^ n := by |
refine f.induction ?_ ?_
Β· rw [toMultiset_zero, Multiset.prod_zero, Finsupp.prod_zero_index]
Β· intro a n f _ _ ih
rw [toMultiset_add, Multiset.prod_add, ih, toMultiset_single, Multiset.prod_nsmul,
Finsupp.prod_add_index' pow_zero pow_add, Finsupp.prod_single_index, Multiset.prod_singleton]
exact pow_zero a
| 0.0625 |
import Mathlib.Combinatorics.SimpleGraph.Finite
import Mathlib.Combinatorics.SimpleGraph.Maps
open Finset
namespace SimpleGraph
variable {V : Type*} [DecidableEq V] (G : SimpleGraph V) (s t : V)
section ReplaceVertex
def replaceVertex : SimpleGraph V where
Adj v w := if v = t then if w = t then False else G.Adj s w
else if w = t then G.Adj v s else G.Adj v w
symm v w := by dsimp only; split_ifs <;> simp [adj_comm]
lemma not_adj_replaceVertex_same : Β¬(G.replaceVertex s t).Adj s t := by simp [replaceVertex]
@[simp] lemma replaceVertex_self : G.replaceVertex s s = G := by
ext; unfold replaceVertex; aesop (add simp or_iff_not_imp_left)
variable {t}
lemma adj_replaceVertex_iff_of_ne_left {w : V} (hw : w β t) :
(G.replaceVertex s t).Adj s w β G.Adj s w := by simp [replaceVertex, hw]
lemma adj_replaceVertex_iff_of_ne_right {w : V} (hw : w β t) :
(G.replaceVertex s t).Adj t w β G.Adj s w := by simp [replaceVertex, hw]
lemma adj_replaceVertex_iff_of_ne {v w : V} (hv : v β t) (hw : w β t) :
(G.replaceVertex s t).Adj v w β G.Adj v w := by simp [replaceVertex, hv, hw]
variable {s}
theorem edgeSet_replaceVertex_of_not_adj (hn : Β¬G.Adj s t) : (G.replaceVertex s t).edgeSet =
G.edgeSet \ G.incidenceSet t βͺ (s(Β·, t)) '' (G.neighborSet s) := by
ext e; refine e.inductionOn ?_
simp only [replaceVertex, mem_edgeSet, Set.mem_union, Set.mem_diff, mk'_mem_incidenceSet_iff]
intros; split_ifs; exacts [by simp_all, by aesop, by rw [adj_comm]; aesop, by aesop]
theorem edgeSet_replaceVertex_of_adj (ha : G.Adj s t) : (G.replaceVertex s t).edgeSet =
(G.edgeSet \ G.incidenceSet t βͺ (s(Β·, t)) '' (G.neighborSet s)) \ {s(t, t)} := by
ext e; refine e.inductionOn ?_
simp only [replaceVertex, mem_edgeSet, Set.mem_union, Set.mem_diff, mk'_mem_incidenceSet_iff]
intros; split_ifs; exacts [by simp_all, by aesop, by rw [adj_comm]; aesop, by aesop]
variable [Fintype V] [DecidableRel G.Adj]
instance : DecidableRel (G.replaceVertex s t).Adj := by unfold replaceVertex; infer_instance
| Mathlib/Combinatorics/SimpleGraph/Operations.lean | 92 | 96 | theorem edgeFinset_replaceVertex_of_not_adj (hn : Β¬G.Adj s t) : (G.replaceVertex s t).edgeFinset =
G.edgeFinset \ G.incidenceFinset t βͺ (G.neighborFinset s).image (s(Β·, t)) := by |
simp only [incidenceFinset, neighborFinset, β Set.toFinset_diff, β Set.toFinset_image,
β Set.toFinset_union]
exact Set.toFinset_congr (G.edgeSet_replaceVertex_of_not_adj hn)
| 0.0625 |
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)]
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]
#align finset.mem_mul_antidiagonal Finset.mem_mulAntidiagonal
#align finset.mem_add_antidiagonal Finset.mem_addAntidiagonal
@[to_additive]
theorem mulAntidiagonal_mono_left (h : u β s) : mulAntidiagonal hu ht a β mulAntidiagonal hs ht a :=
Set.Finite.toFinset_mono <| Set.mulAntidiagonal_mono_left h
#align finset.mul_antidiagonal_mono_left Finset.mulAntidiagonal_mono_left
#align finset.add_antidiagonal_mono_left Finset.addAntidiagonal_mono_left
@[to_additive]
theorem mulAntidiagonal_mono_right (h : u β t) :
mulAntidiagonal hs hu a β mulAntidiagonal hs ht a :=
Set.Finite.toFinset_mono <| Set.mulAntidiagonal_mono_right h
#align finset.mul_antidiagonal_mono_right Finset.mulAntidiagonal_mono_right
#align finset.add_antidiagonal_mono_right Finset.addAntidiagonal_mono_right
-- Porting note: removed `(attr := simp)`. simp can prove this.
@[to_additive]
| Mathlib/Data/Finset/MulAntidiagonal.lean | 92 | 95 | theorem swap_mem_mulAntidiagonal :
x.swap β Finset.mulAntidiagonal hs ht a β x β Finset.mulAntidiagonal ht hs a := by |
simp only [mem_mulAntidiagonal, Prod.fst_swap, Prod.snd_swap, Set.swap_mem_mulAntidiagonal_aux,
Set.mem_mulAntidiagonal]
| 0.0625 |
import Mathlib.Algebra.Polynomial.AlgebraMap
import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed
import Mathlib.RingTheory.PowerBasis
#align_import ring_theory.is_adjoin_root from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
open scoped Polynomial
open Polynomial
noncomputable section
universe u v
-- Porting note: this looks like something that should not be here
-- -- This class doesn't really make sense on a predicate
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure IsAdjoinRoot {R : Type u} (S : Type v) [CommSemiring R] [Semiring S] [Algebra R S]
(f : R[X]) : Type max u v where
map : R[X] β+* S
map_surjective : Function.Surjective map
ker_map : RingHom.ker map = Ideal.span {f}
algebraMap_eq : algebraMap R S = map.comp Polynomial.C
#align is_adjoin_root IsAdjoinRoot
-- This class doesn't really make sense on a predicate
-- @[nolint has_nonempty_instance] -- Porting note: This linter does not exist yet.
structure IsAdjoinRootMonic {R : Type u} (S : Type v) [CommSemiring R] [Semiring S] [Algebra R S]
(f : R[X]) extends IsAdjoinRoot S f where
Monic : Monic f
#align is_adjoin_root_monic IsAdjoinRootMonic
section Ring
variable {R : Type u} {S : Type v} [CommRing R] [Ring S] {f : R[X]} [Algebra R S]
namespace IsAdjoinRoot
def root (h : IsAdjoinRoot S f) : S :=
h.map X
#align is_adjoin_root.root IsAdjoinRoot.root
theorem subsingleton (h : IsAdjoinRoot S f) [Subsingleton R] : Subsingleton S :=
h.map_surjective.subsingleton
#align is_adjoin_root.subsingleton IsAdjoinRoot.subsingleton
theorem algebraMap_apply (h : IsAdjoinRoot S f) (x : R) :
algebraMap R S x = h.map (Polynomial.C x) := by rw [h.algebraMap_eq, RingHom.comp_apply]
#align is_adjoin_root.algebra_map_apply IsAdjoinRoot.algebraMap_apply
@[simp]
theorem mem_ker_map (h : IsAdjoinRoot S f) {p} : p β RingHom.ker h.map β f β£ p := by
rw [h.ker_map, Ideal.mem_span_singleton]
#align is_adjoin_root.mem_ker_map IsAdjoinRoot.mem_ker_map
theorem map_eq_zero_iff (h : IsAdjoinRoot S f) {p} : h.map p = 0 β f β£ p := by
rw [β h.mem_ker_map, RingHom.mem_ker]
#align is_adjoin_root.map_eq_zero_iff IsAdjoinRoot.map_eq_zero_iff
@[simp]
theorem map_X (h : IsAdjoinRoot S f) : h.map X = h.root := rfl
set_option linter.uppercaseLean3 false in
#align is_adjoin_root.map_X IsAdjoinRoot.map_X
@[simp]
theorem map_self (h : IsAdjoinRoot S f) : h.map f = 0 := h.map_eq_zero_iff.mpr dvd_rfl
#align is_adjoin_root.map_self IsAdjoinRoot.map_self
@[simp]
theorem aeval_eq (h : IsAdjoinRoot S f) (p : R[X]) : aeval h.root p = h.map p :=
Polynomial.induction_on p (fun x => by rw [aeval_C, h.algebraMap_apply])
(fun p q ihp ihq => by rw [AlgHom.map_add, RingHom.map_add, ihp, ihq]) fun n x _ => by
rw [AlgHom.map_mul, aeval_C, AlgHom.map_pow, aeval_X, RingHom.map_mul, β h.algebraMap_apply,
RingHom.map_pow, map_X]
#align is_adjoin_root.aeval_eq IsAdjoinRoot.aeval_eq
-- @[simp] -- Porting note (#10618): simp can prove this
theorem aeval_root (h : IsAdjoinRoot S f) : aeval h.root f = 0 := by rw [aeval_eq, map_self]
#align is_adjoin_root.aeval_root IsAdjoinRoot.aeval_root
def repr (h : IsAdjoinRoot S f) (x : S) : R[X] :=
(h.map_surjective x).choose
#align is_adjoin_root.repr IsAdjoinRoot.repr
theorem map_repr (h : IsAdjoinRoot S f) (x : S) : h.map (h.repr x) = x :=
(h.map_surjective x).choose_spec
#align is_adjoin_root.map_repr IsAdjoinRoot.map_repr
theorem repr_zero_mem_span (h : IsAdjoinRoot S f) : h.repr 0 β Ideal.span ({f} : Set R[X]) := by
rw [β h.ker_map, RingHom.mem_ker, h.map_repr]
#align is_adjoin_root.repr_zero_mem_span IsAdjoinRoot.repr_zero_mem_span
| Mathlib/RingTheory/IsAdjoinRoot.lean | 179 | 181 | theorem repr_add_sub_repr_add_repr_mem_span (h : IsAdjoinRoot S f) (x y : S) :
h.repr (x + y) - (h.repr x + h.repr y) β Ideal.span ({f} : Set R[X]) := by |
rw [β h.ker_map, RingHom.mem_ker, map_sub, h.map_repr, map_add, h.map_repr, h.map_repr, sub_self]
| 0.0625 |
import Mathlib.LinearAlgebra.DFinsupp
import Mathlib.LinearAlgebra.StdBasis
#align_import linear_algebra.finsupp_vector_space from "leanprover-community/mathlib"@"59628387770d82eb6f6dd7b7107308aa2509ec95"
noncomputable section
open Set LinearMap Submodule
open scoped Cardinal
universe u v w
namespace Finsupp
namespace Basis
variable {R M n : Type*}
variable [DecidableEq n]
variable [Semiring R] [AddCommMonoid M] [Module R M]
| Mathlib/LinearAlgebra/FinsuppVectorSpace.lean | 161 | 164 | theorem _root_.Finset.sum_single_ite [Fintype n] (a : R) (i : n) :
(β x : n, Finsupp.single x (if i = x then a else 0)) = Finsupp.single i a := by |
simp only [apply_ite (Finsupp.single _), Finsupp.single_zero, Finset.sum_ite_eq,
if_pos (Finset.mem_univ _)]
| 0.0625 |
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.Analysis.MeanInequalities
import Mathlib.Analysis.MeanInequalitiesPow
import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic
#align_import measure_theory.integral.mean_inequalities from "leanprover-community/mathlib"@"13bf7613c96a9fd66a81b9020a82cad9a6ea1fcf"
section LIntegral
noncomputable section
open scoped Classical
open NNReal ENNReal MeasureTheory Finset
set_option linter.uppercaseLean3 false
variable {Ξ± : Type*} [MeasurableSpace Ξ±] {ΞΌ : Measure Ξ±}
namespace ENNReal
theorem lintegral_mul_le_one_of_lintegral_rpow_eq_one {p q : β} (hpq : p.IsConjExponent q)
{f g : Ξ± β ββ₯0β} (hf : AEMeasurable f ΞΌ) (hf_norm : β«β» a, f a ^ p βΞΌ = 1)
(hg_norm : β«β» a, g a ^ q βΞΌ = 1) : (β«β» a, (f * g) a βΞΌ) β€ 1 := by
calc
(β«β» a : Ξ±, (f * g) a βΞΌ) β€
β«β» a : Ξ±, f a ^ p / ENNReal.ofReal p + g a ^ q / ENNReal.ofReal q βΞΌ :=
lintegral_mono fun a => young_inequality (f a) (g a) hpq
_ = 1 := by
simp only [div_eq_mul_inv]
rw [lintegral_add_left']
Β· rw [lintegral_mul_const'' _ (hf.pow_const p), lintegral_mul_const', hf_norm, hg_norm,
one_mul, one_mul, hpq.inv_add_inv_conj_ennreal]
simp [hpq.symm.pos]
Β· exact (hf.pow_const _).mul_const _
#align ennreal.lintegral_mul_le_one_of_lintegral_rpow_eq_one ENNReal.lintegral_mul_le_one_of_lintegral_rpow_eq_one
def funMulInvSnorm (f : Ξ± β ββ₯0β) (p : β) (ΞΌ : Measure Ξ±) : Ξ± β ββ₯0β := fun a =>
f a * ((β«β» c, f c ^ p βΞΌ) ^ (1 / p))β»ΒΉ
#align ennreal.fun_mul_inv_snorm ENNReal.funMulInvSnorm
theorem fun_eq_funMulInvSnorm_mul_snorm {p : β} (f : Ξ± β ββ₯0β) (hf_nonzero : (β«β» a, f a ^ p βΞΌ) β 0)
(hf_top : (β«β» a, f a ^ p βΞΌ) β β€) {a : Ξ±} :
f a = funMulInvSnorm f p ΞΌ a * (β«β» c, f c ^ p βΞΌ) ^ (1 / p) := by
simp [funMulInvSnorm, mul_assoc, ENNReal.inv_mul_cancel, hf_nonzero, hf_top]
#align ennreal.fun_eq_fun_mul_inv_snorm_mul_snorm ENNReal.fun_eq_funMulInvSnorm_mul_snorm
| Mathlib/MeasureTheory/Integral/MeanInequalities.lean | 93 | 98 | theorem funMulInvSnorm_rpow {p : β} (hp0 : 0 < p) {f : Ξ± β ββ₯0β} {a : Ξ±} :
funMulInvSnorm f p ΞΌ a ^ p = f a ^ p * (β«β» c, f c ^ p βΞΌ)β»ΒΉ := by |
rw [funMulInvSnorm, mul_rpow_of_nonneg _ _ (le_of_lt hp0)]
suffices h_inv_rpow : ((β«β» c : Ξ±, f c ^ p βΞΌ) ^ (1 / p))β»ΒΉ ^ p = (β«β» c : Ξ±, f c ^ p βΞΌ)β»ΒΉ by
rw [h_inv_rpow]
rw [inv_rpow, β rpow_mul, one_div_mul_cancel hp0.ne', rpow_one]
| 0.0625 |
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.CategoryTheory.Limits.Preserves.Basic
#align_import category_theory.limits.preserves.shapes.pullbacks from "leanprover-community/mathlib"@"f11e306adb9f2a393539d2bb4293bf1b42caa7ac"
noncomputable section
universe vβ vβ uβ uβ
-- Porting note: need Functor namespace for mapCone
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Functor
namespace CategoryTheory.Limits
section Pushout
variable {C : Type uβ} [Category.{vβ} C]
variable {D : Type uβ} [Category.{vβ} D]
variable (G : C β₯€ D)
variable {W X Y Z : C} {h : X βΆ Z} {k : Y βΆ Z} {f : W βΆ X} {g : W βΆ Y} (comm : f β« h = g β« k)
def isColimitMapCoconePushoutCoconeEquiv :
IsColimit (mapCocone G (PushoutCocone.mk h k comm)) β
IsColimit
(PushoutCocone.mk (G.map h) (G.map k) (by simp only [β G.map_comp, comm]) :
PushoutCocone (G.map f) (G.map g)) :=
(IsColimit.precomposeHomEquiv (diagramIsoSpan.{vβ} _).symm _).symm.trans <|
IsColimit.equivIsoColimit <|
Cocones.ext (Iso.refl _) <| by
rintro (_ | _ | _) <;> dsimp <;>
simp only [Category.comp_id, Category.id_comp, β G.map_comp]
#align category_theory.limits.is_colimit_map_cocone_pushout_cocone_equiv CategoryTheory.Limits.isColimitMapCoconePushoutCoconeEquiv
def isColimitPushoutCoconeMapOfIsColimit [PreservesColimit (span f g) G]
(l : IsColimit (PushoutCocone.mk h k comm)) :
IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f β« G.map h = G.map g β« G.map k
from by simp only [β G.map_comp,comm] )) :=
isColimitMapCoconePushoutCoconeEquiv G comm (PreservesColimit.preserves l)
#align category_theory.limits.is_colimit_pushout_cocone_map_of_is_colimit CategoryTheory.Limits.isColimitPushoutCoconeMapOfIsColimit
def isColimitOfIsColimitPushoutCoconeMap [ReflectsColimit (span f g) G]
(l : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f β« G.map h =
G.map g β« G.map k from by simp only [β G.map_comp,comm]))) :
IsColimit (PushoutCocone.mk h k comm) :=
ReflectsColimit.reflects ((isColimitMapCoconePushoutCoconeEquiv G comm).symm l)
#align category_theory.limits.is_colimit_of_is_colimit_pushout_cocone_map CategoryTheory.Limits.isColimitOfIsColimitPushoutCoconeMap
variable (f g) [PreservesColimit (span f g) G]
def isColimitOfHasPushoutOfPreservesColimit [i : HasPushout f g] :
IsColimit (PushoutCocone.mk (G.map pushout.inl) (G.map (@pushout.inr _ _ _ _ _ f g i))
(show G.map f β« G.map pushout.inl = G.map g β« G.map pushout.inr from by
simp only [β G.map_comp, pushout.condition])) :=
isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout f g)
#align category_theory.limits.is_colimit_of_has_pushout_of_preserves_colimit CategoryTheory.Limits.isColimitOfHasPushoutOfPreservesColimit
def preservesPushoutSymmetry : PreservesColimit (span g f) G where
preserves {c} hc := by
apply (IsColimit.precomposeHomEquiv (diagramIsoSpan.{vβ} _).symm _).toFun
apply IsColimit.ofIsoColimit _ (PushoutCocone.isoMk _).symm
apply PushoutCocone.isColimitOfFlip
apply (isColimitMapCoconePushoutCoconeEquiv _ _).toFun
Β· refine @PreservesColimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_ -- Porting note: more TC coddling
Β· dsimp
infer_instance
Β· exact PushoutCocone.flipIsColimit hc
#align category_theory.limits.preserves_pushout_symmetry CategoryTheory.Limits.preservesPushoutSymmetry
theorem hasPushout_of_preservesPushout [HasPushout f g] : HasPushout (G.map f) (G.map g) :=
β¨β¨β¨_, isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout _ _)β©β©β©
#align category_theory.limits.has_pushout_of_preserves_pushout CategoryTheory.Limits.hasPushout_of_preservesPushout
variable [HasPushout f g] [HasPushout (G.map f) (G.map g)]
def PreservesPushout.iso : pushout (G.map f) (G.map g) β
G.obj (pushout f g) :=
IsColimit.coconePointUniqueUpToIso (colimit.isColimit _)
(isColimitOfHasPushoutOfPreservesColimit G f g)
#align category_theory.limits.preserves_pushout.iso CategoryTheory.Limits.PreservesPushout.iso
@[simp]
theorem PreservesPushout.iso_hom : (PreservesPushout.iso G f g).hom = pushoutComparison G f g :=
rfl
#align category_theory.limits.preserves_pushout.iso_hom CategoryTheory.Limits.PreservesPushout.iso_hom
@[reassoc]
theorem PreservesPushout.inl_iso_hom :
pushout.inl β« (PreservesPushout.iso G f g).hom = G.map pushout.inl := by
delta PreservesPushout.iso
simp
#align category_theory.limits.preserves_pushout.inl_iso_hom CategoryTheory.Limits.PreservesPushout.inl_iso_hom
@[reassoc]
theorem PreservesPushout.inr_iso_hom :
pushout.inr β« (PreservesPushout.iso G f g).hom = G.map pushout.inr := by
delta PreservesPushout.iso
simp
#align category_theory.limits.preserves_pushout.inr_iso_hom CategoryTheory.Limits.PreservesPushout.inr_iso_hom
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean | 239 | 241 | theorem PreservesPushout.inl_iso_inv :
G.map pushout.inl β« (PreservesPushout.iso G f g).inv = pushout.inl := by |
simp [PreservesPushout.iso, Iso.comp_inv_eq]
| 0.0625 |
import Mathlib.NumberTheory.BernoulliPolynomials
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Analysis.Calculus.Deriv.Polynomial
import Mathlib.Analysis.Fourier.AddCircle
import Mathlib.Analysis.PSeries
#align_import number_theory.zeta_values from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
noncomputable section
open scoped Nat Real Interval
open Complex MeasureTheory Set intervalIntegral
local notation "π" => UnitAddCircle
section BernoulliFunProps
def bernoulliFun (k : β) (x : β) : β :=
(Polynomial.map (algebraMap β β) (Polynomial.bernoulli k)).eval x
#align bernoulli_fun bernoulliFun
theorem bernoulliFun_eval_zero (k : β) : bernoulliFun k 0 = bernoulli k := by
rw [bernoulliFun, Polynomial.eval_zero_map, Polynomial.bernoulli_eval_zero, eq_ratCast]
#align bernoulli_fun_eval_zero bernoulliFun_eval_zero
| Mathlib/NumberTheory/ZetaValues.lean | 53 | 56 | theorem bernoulliFun_endpoints_eq_of_ne_one {k : β} (hk : k β 1) :
bernoulliFun k 1 = bernoulliFun k 0 := by |
rw [bernoulliFun_eval_zero, bernoulliFun, Polynomial.eval_one_map, Polynomial.bernoulli_eval_one,
bernoulli_eq_bernoulli'_of_ne_one hk, eq_ratCast]
| 0.0625 |
import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace
#align_import geometry.manifold.vector_bundle.fiberwise_linear from "leanprover-community/mathlib"@"be2c24f56783935652cefffb4bfca7e4b25d167e"
noncomputable section
open Set TopologicalSpace
open scoped Manifold Topology
variable {π B F : Type*} [TopologicalSpace B]
variable [NontriviallyNormedField π] [NormedAddCommGroup F] [NormedSpace π F]
namespace FiberwiseLinear
variable {Ο Ο' : B β F βL[π] F} {U U' : Set B}
def partialHomeomorph (Ο : B β F βL[π] F) (hU : IsOpen U)
(hΟ : ContinuousOn (fun x => Ο x : B β F βL[π] F) U)
(h2Ο : ContinuousOn (fun x => (Ο x).symm : B β F βL[π] F) U) :
PartialHomeomorph (B Γ F) (B Γ F) where
toFun x := (x.1, Ο x.1 x.2)
invFun x := (x.1, (Ο x.1).symm x.2)
source := U ΓΛ’ univ
target := U ΓΛ’ univ
map_source' _x hx := mk_mem_prod hx.1 (mem_univ _)
map_target' _x hx := mk_mem_prod hx.1 (mem_univ _)
left_inv' _ _ := Prod.ext rfl (ContinuousLinearEquiv.symm_apply_apply _ _)
right_inv' _ _ := Prod.ext rfl (ContinuousLinearEquiv.apply_symm_apply _ _)
open_source := hU.prod isOpen_univ
open_target := hU.prod isOpen_univ
continuousOn_toFun :=
have : ContinuousOn (fun p : B Γ F => ((Ο p.1 : F βL[π] F), p.2)) (U ΓΛ’ univ) :=
hΟ.prod_map continuousOn_id
continuousOn_fst.prod (isBoundedBilinearMap_apply.continuous.comp_continuousOn this)
continuousOn_invFun :=
haveI : ContinuousOn (fun p : B Γ F => (((Ο p.1).symm : F βL[π] F), p.2)) (U ΓΛ’ univ) :=
h2Ο.prod_map continuousOn_id
continuousOn_fst.prod (isBoundedBilinearMap_apply.continuous.comp_continuousOn this)
#align fiberwise_linear.local_homeomorph FiberwiseLinear.partialHomeomorph
theorem trans_partialHomeomorph_apply (hU : IsOpen U)
(hΟ : ContinuousOn (fun x => Ο x : B β F βL[π] F) U)
(h2Ο : ContinuousOn (fun x => (Ο x).symm : B β F βL[π] F) U) (hU' : IsOpen U')
(hΟ' : ContinuousOn (fun x => Ο' x : B β F βL[π] F) U')
(h2Ο' : ContinuousOn (fun x => (Ο' x).symm : B β F βL[π] F) U') (b : B) (v : F) :
(FiberwiseLinear.partialHomeomorph Ο hU hΟ h2Ο β«β
FiberwiseLinear.partialHomeomorph Ο' hU' hΟ' h2Ο')
β¨b, vβ© =
β¨b, Ο' b (Ο b v)β© :=
rfl
#align fiberwise_linear.trans_local_homeomorph_apply FiberwiseLinear.trans_partialHomeomorph_apply
| Mathlib/Geometry/Manifold/VectorBundle/FiberwiseLinear.lean | 74 | 82 | theorem source_trans_partialHomeomorph (hU : IsOpen U)
(hΟ : ContinuousOn (fun x => Ο x : B β F βL[π] F) U)
(h2Ο : ContinuousOn (fun x => (Ο x).symm : B β F βL[π] F) U) (hU' : IsOpen U')
(hΟ' : ContinuousOn (fun x => Ο' x : B β F βL[π] F) U')
(h2Ο' : ContinuousOn (fun x => (Ο' x).symm : B β F βL[π] F) U') :
(FiberwiseLinear.partialHomeomorph Ο hU hΟ h2Ο β«β
FiberwiseLinear.partialHomeomorph Ο' hU' hΟ' h2Ο').source =
(U β© U') ΓΛ’ univ := by |
dsimp only [FiberwiseLinear.partialHomeomorph]; mfld_set_tac
| 0.0625 |
import Mathlib.Algebra.ContinuedFractions.Computation.Basic
import Mathlib.Algebra.ContinuedFractions.Translations
#align_import algebra.continued_fractions.computation.translations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
namespace GeneralizedContinuedFraction
open GeneralizedContinuedFraction (of)
-- Fix a discrete linear ordered floor field and a value `v`.
variable {K : Type*} [LinearOrderedField K] [FloorRing K] {v : K}
namespace IntFractPair
theorem stream_zero (v : K) : IntFractPair.stream v 0 = some (IntFractPair.of v) :=
rfl
#align generalized_continued_fraction.int_fract_pair.stream_zero GeneralizedContinuedFraction.IntFractPair.stream_zero
variable {n : β}
theorem stream_eq_none_of_fr_eq_zero {ifp_n : IntFractPair K}
(stream_nth_eq : IntFractPair.stream v n = some ifp_n) (nth_fr_eq_zero : ifp_n.fr = 0) :
IntFractPair.stream v (n + 1) = none := by
cases' ifp_n with _ fr
change fr = 0 at nth_fr_eq_zero
simp [IntFractPair.stream, stream_nth_eq, nth_fr_eq_zero]
#align generalized_continued_fraction.int_fract_pair.stream_eq_none_of_fr_eq_zero GeneralizedContinuedFraction.IntFractPair.stream_eq_none_of_fr_eq_zero
theorem succ_nth_stream_eq_none_iff :
IntFractPair.stream v (n + 1) = none β
IntFractPair.stream v n = none β¨ β ifp, IntFractPair.stream v n = some ifp β§ ifp.fr = 0 := by
rw [IntFractPair.stream]
cases IntFractPair.stream v n <;> simp [imp_false]
#align generalized_continued_fraction.int_fract_pair.succ_nth_stream_eq_none_iff GeneralizedContinuedFraction.IntFractPair.succ_nth_stream_eq_none_iff
| Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean | 87 | 92 | theorem succ_nth_stream_eq_some_iff {ifp_succ_n : IntFractPair K} :
IntFractPair.stream v (n + 1) = some ifp_succ_n β
β ifp_n : IntFractPair K,
IntFractPair.stream v n = some ifp_n β§
ifp_n.fr β 0 β§ IntFractPair.of ifp_n.frβ»ΒΉ = ifp_succ_n := by |
simp [IntFractPair.stream, ite_eq_iff, Option.bind_eq_some]
| 0.0625 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {Ξ± Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] {f : Ξ± β Ξ²}
variable {s : Set Ξ²} {ΞΉ : Type*} {U : ΞΉ β Opens Ξ²} (hU : iSup U = β€)
theorem Set.restrictPreimage_inducing (s : Set Ξ²) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [β inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, β @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h β’
intro a
rw [β h, β inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set Ξ²) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
β¨h.1.restrictPreimage s, h.2.restrictPreimage sβ©
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set Ξ²) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
β¨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm βΈ continuous_subtype_val.isOpen_preimage _ h.isOpen_rangeβ©
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set Ξ²) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
β¨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm βΈ inducing_subtype_val.isClosed_preimage _ h.isClosed_rangeβ©
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set Ξ²) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices β u, IsClosed u β Subtype.val β»ΒΉ' u = t β
β v, IsClosed v β§ Subtype.val β»ΒΉ' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => β¨f '' u, H u hu, by simp [β e, image_restrictPreimage]β©
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set Ξ²) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set Ξ²) :
IsOpenMap (s.restrictPreimage f) := by
intro t
suffices β u, IsOpen u β Subtype.val β»ΒΉ' u = t β
β v, IsOpen v β§ Subtype.val β»ΒΉ' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => β¨f '' u, H u hu, by simp [β e, image_restrictPreimage]β©
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isOpenMap (s : Set Ξ²) (H : IsOpenMap f) :
IsOpenMap (s.restrictPreimage f) := H.restrictPreimage s
theorem isOpen_iff_inter_of_iSup_eq_top (s : Set Ξ²) : IsOpen s β β i, IsOpen (s β© U i) := by
constructor
Β· exact fun H i => H.inter (U i).2
Β· intro H
have : β i, (U i : Set Ξ²) = Set.univ := by
convert congr_arg (SetLike.coe) hU
simp
rw [β s.inter_univ, β this, Set.inter_iUnion]
exact isOpen_iUnion H
#align is_open_iff_inter_of_supr_eq_top isOpen_iff_inter_of_iSup_eq_top
theorem isOpen_iff_coe_preimage_of_iSup_eq_top (s : Set Ξ²) :
IsOpen s β β i, IsOpen ((β) β»ΒΉ' s : Set (U i)) := by
-- Porting note: rewrote to avoid Β΄simpΒ΄ issues
rw [isOpen_iff_inter_of_iSup_eq_top hU s]
refine forall_congr' fun i => ?_
rw [(U _).2.openEmbedding_subtype_val.open_iff_image_open]
erw [Set.image_preimage_eq_inter_range]
rw [Subtype.range_coe, Opens.carrier_eq_coe]
#align is_open_iff_coe_preimage_of_supr_eq_top isOpen_iff_coe_preimage_of_iSup_eq_top
| Mathlib/Topology/LocalAtTarget.lean | 111 | 113 | theorem isClosed_iff_coe_preimage_of_iSup_eq_top (s : Set Ξ²) :
IsClosed s β β i, IsClosed ((β) β»ΒΉ' s : Set (U i)) := by |
simpa using isOpen_iff_coe_preimage_of_iSup_eq_top hU sαΆ
| 0.0625 |
import Mathlib.Topology.EMetricSpace.Basic
#align_import topology.metric_space.metric_separated from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2"
open EMetric Set
noncomputable section
def IsMetricSeparated {X : Type*} [EMetricSpace X] (s t : Set X) :=
β r, r β 0 β§ β x β s, β y β t, r β€ edist x y
#align is_metric_separated IsMetricSeparated
namespace IsMetricSeparated
variable {X : Type*} [EMetricSpace X] {s t : Set X} {x y : X}
@[symm]
theorem symm (h : IsMetricSeparated s t) : IsMetricSeparated t s :=
let β¨r, r0, hrβ© := h
β¨r, r0, fun y hy x hx => edist_comm x y βΈ hr x hx y hyβ©
#align is_metric_separated.symm IsMetricSeparated.symm
theorem comm : IsMetricSeparated s t β IsMetricSeparated t s :=
β¨symm, symmβ©
#align is_metric_separated.comm IsMetricSeparated.comm
@[simp]
theorem empty_left (s : Set X) : IsMetricSeparated β
s :=
β¨1, one_ne_zero, fun _x => False.elimβ©
#align is_metric_separated.empty_left IsMetricSeparated.empty_left
@[simp]
theorem empty_right (s : Set X) : IsMetricSeparated s β
:=
(empty_left s).symm
#align is_metric_separated.empty_right IsMetricSeparated.empty_right
protected theorem disjoint (h : IsMetricSeparated s t) : Disjoint s t :=
let β¨r, r0, hrβ© := h
Set.disjoint_left.mpr fun x hx1 hx2 => r0 <| by simpa using hr x hx1 x hx2
#align is_metric_separated.disjoint IsMetricSeparated.disjoint
theorem subset_compl_right (h : IsMetricSeparated s t) : s β tαΆ := fun _ hs ht =>
h.disjoint.le_bot β¨hs, htβ©
#align is_metric_separated.subset_compl_right IsMetricSeparated.subset_compl_right
@[mono]
theorem mono {s' t'} (hs : s β s') (ht : t β t') :
IsMetricSeparated s' t' β IsMetricSeparated s t := fun β¨r, r0, hrβ© =>
β¨r, r0, fun x hx y hy => hr x (hs hx) y (ht hy)β©
#align is_metric_separated.mono IsMetricSeparated.mono
theorem mono_left {s'} (h' : IsMetricSeparated s' t) (hs : s β s') : IsMetricSeparated s t :=
h'.mono hs Subset.rfl
#align is_metric_separated.mono_left IsMetricSeparated.mono_left
theorem mono_right {t'} (h' : IsMetricSeparated s t') (ht : t β t') : IsMetricSeparated s t :=
h'.mono Subset.rfl ht
#align is_metric_separated.mono_right IsMetricSeparated.mono_right
theorem union_left {s'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s' t) :
IsMetricSeparated (s βͺ s') t := by
rcases h, h' with β¨β¨r, r0, hrβ©, β¨r', r0', hr'β©β©
refine β¨min r r', ?_, fun x hx y hy => hx.elim ?_ ?_β©
Β· rw [β pos_iff_ne_zero] at r0 r0' β’
exact lt_min r0 r0'
Β· exact fun hx => (min_le_left _ _).trans (hr _ hx _ hy)
Β· exact fun hx => (min_le_right _ _).trans (hr' _ hx _ hy)
#align is_metric_separated.union_left IsMetricSeparated.union_left
@[simp]
theorem union_left_iff {s'} :
IsMetricSeparated (s βͺ s') t β IsMetricSeparated s t β§ IsMetricSeparated s' t :=
β¨fun h => β¨h.mono_left subset_union_left, h.mono_left subset_union_rightβ©, fun h =>
h.1.union_left h.2β©
#align is_metric_separated.union_left_iff IsMetricSeparated.union_left_iff
theorem union_right {t'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s t') :
IsMetricSeparated s (t βͺ t') :=
(h.symm.union_left h'.symm).symm
#align is_metric_separated.union_right IsMetricSeparated.union_right
@[simp]
theorem union_right_iff {t'} :
IsMetricSeparated s (t βͺ t') β IsMetricSeparated s t β§ IsMetricSeparated s t' :=
comm.trans <| union_left_iff.trans <| and_congr comm comm
#align is_metric_separated.union_right_iff IsMetricSeparated.union_right_iff
| Mathlib/Topology/MetricSpace/MetricSeparated.lean | 106 | 109 | theorem finite_iUnion_left_iff {ΞΉ : Type*} {I : Set ΞΉ} (hI : I.Finite) {s : ΞΉ β Set X}
{t : Set X} : IsMetricSeparated (β i β I, s i) t β β i β I, IsMetricSeparated (s i) t := by |
refine Finite.induction_on hI (by simp) @fun i I _ _ hI => ?_
rw [biUnion_insert, forall_mem_insert, union_left_iff, hI]
| 0.0625 |
import Mathlib.Probability.ProbabilityMassFunction.Basic
import Mathlib.Probability.ProbabilityMassFunction.Constructions
import Mathlib.MeasureTheory.Integral.Bochner
namespace PMF
open MeasureTheory ENNReal TopologicalSpace
section General
variable {Ξ± : Type*} [MeasurableSpace Ξ±] [MeasurableSingletonClass Ξ±]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] [CompleteSpace E]
theorem integral_eq_tsum (p : PMF Ξ±) (f : Ξ± β E) (hf : Integrable f p.toMeasure) :
β« a, f a β(p.toMeasure) = β' a, (p a).toReal β’ f a := calc
_ = β« a in p.support, f a β(p.toMeasure) := by rw [restrict_toMeasure_support p]
_ = β' (a : support p), (p.toMeasure {a.val}).toReal β’ f a := by
apply integral_countable f p.support_countable
rwa [restrict_toMeasure_support p]
_ = β' (a : support p), (p a).toReal β’ f a := by
congr with x; congr 2
apply PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)
_ = β' a, (p a).toReal β’ f a :=
tsum_subtype_eq_of_support_subset <| by calc
(fun a β¦ (p a).toReal β’ f a).support β (fun a β¦ (p a).toReal).support :=
Function.support_smul_subset_left _ _
_ β support p := fun x h1 h2 => h1 (by simp [h2])
| Mathlib/Probability/ProbabilityMassFunction/Integrals.lean | 43 | 47 | theorem integral_eq_sum [Fintype Ξ±] (p : PMF Ξ±) (f : Ξ± β E) :
β« a, f a β(p.toMeasure) = β a, (p a).toReal β’ f a := by |
rw [integral_fintype _ (.of_finite _ f)]
congr with x; congr 2
exact PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)
| 0.0625 |
import Mathlib.Topology.Instances.Irrational
import Mathlib.Topology.Instances.Rat
import Mathlib.Topology.Compactification.OnePoint
#align_import topology.instances.rat_lemmas from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7"
open Set Metric Filter TopologicalSpace
open Topology OnePoint
local notation "ββ" => OnePoint β
namespace Rat
variable {p q : β} {s t : Set β}
theorem interior_compact_eq_empty (hs : IsCompact s) : interior s = β
:=
denseEmbedding_coe_real.toDenseInducing.interior_compact_eq_empty dense_irrational hs
#align rat.interior_compact_eq_empty Rat.interior_compact_eq_empty
theorem dense_compl_compact (hs : IsCompact s) : Dense sαΆ :=
interior_eq_empty_iff_dense_compl.1 (interior_compact_eq_empty hs)
#align rat.dense_compl_compact Rat.dense_compl_compact
instance cocompact_inf_nhds_neBot : NeBot (cocompact β β π p) := by
refine (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 ?_
rintro β¨s, oβ© β¨hs, hpo, hoβ©; rw [inter_comm]
exact (dense_compl_compact hs).inter_open_nonempty _ ho β¨p, hpoβ©
#align rat.cocompact_inf_nhds_ne_bot Rat.cocompact_inf_nhds_neBot
| Mathlib/Topology/Instances/RatLemmas.lean | 56 | 62 | theorem not_countably_generated_cocompact : Β¬IsCountablyGenerated (cocompact β) := by |
intro H
rcases exists_seq_tendsto (cocompact β β π 0) with β¨x, hxβ©
rw [tendsto_inf] at hx; rcases hx with β¨hxc, hx0β©
obtain β¨n, hnβ© : β n : β, x n β insert (0 : β) (range x) :=
(hxc.eventually hx0.isCompact_insert_range.compl_mem_cocompact).exists
exact hn (Or.inr β¨n, rflβ©)
| 0.0625 |
import Mathlib.Data.Fin.Tuple.Basic
import Mathlib.Data.List.Join
#align_import data.list.of_fn from "leanprover-community/mathlib"@"bf27744463e9620ca4e4ebe951fe83530ae6949b"
universe u
variable {Ξ± : Type u}
open Nat
namespace List
#noalign list.length_of_fn_aux
@[simp]
theorem length_ofFn_go {n} (f : Fin n β Ξ±) (i j h) : length (ofFn.go f i j h) = i := by
induction i generalizing j <;> simp_all [ofFn.go]
@[simp]
theorem length_ofFn {n} (f : Fin n β Ξ±) : length (ofFn f) = n := by
simp [ofFn, length_ofFn_go]
#align list.length_of_fn List.length_ofFn
#noalign list.nth_of_fn_aux
theorem get_ofFn_go {n} (f : Fin n β Ξ±) (i j h) (k) (hk) :
get (ofFn.go f i j h) β¨k, hkβ© = f β¨j + k, by simp at hk; omegaβ© := by
let i+1 := i
cases k <;> simp [ofFn.go, get_ofFn_go (i := i)]
congr 2; omega
-- Porting note (#10756): new theorem
@[simp]
theorem get_ofFn {n} (f : Fin n β Ξ±) (i) : get (ofFn f) i = f (Fin.cast (by simp) i) := by
cases i; simp [ofFn, get_ofFn_go]
@[simp]
theorem get?_ofFn {n} (f : Fin n β Ξ±) (i) : get? (ofFn f) i = ofFnNthVal f i :=
if h : i < (ofFn f).length
then by
rw [get?_eq_get h, get_ofFn]
Β· simp only [length_ofFn] at h; simp [ofFnNthVal, h]
else by
rw [ofFnNthVal, dif_neg] <;>
simpa using h
#align list.nth_of_fn List.get?_ofFn
set_option linter.deprecated false in
@[deprecated get_ofFn (since := "2023-01-17")]
theorem nthLe_ofFn {n} (f : Fin n β Ξ±) (i : Fin n) :
nthLe (ofFn f) i ((length_ofFn f).symm βΈ i.2) = f i := by
simp [nthLe]
#align list.nth_le_of_fn List.nthLe_ofFn
set_option linter.deprecated false in
@[simp, deprecated get_ofFn (since := "2023-01-17")]
theorem nthLe_ofFn' {n} (f : Fin n β Ξ±) {i : β} (h : i < (ofFn f).length) :
nthLe (ofFn f) i h = f β¨i, length_ofFn f βΈ hβ© :=
nthLe_ofFn f β¨i, length_ofFn f βΈ hβ©
#align list.nth_le_of_fn' List.nthLe_ofFn'
@[simp]
theorem map_ofFn {Ξ² : Type*} {n : β} (f : Fin n β Ξ±) (g : Ξ± β Ξ²) :
map g (ofFn f) = ofFn (g β f) :=
ext_get (by simp) fun i h h' => by simp
#align list.map_of_fn List.map_ofFn
-- Porting note: we don't have Array' in mathlib4
--
-- theorem array_eq_of_fn {n} (a : Array' n Ξ±) : a.toList = ofFn a.read :=
-- by
-- suffices β {m h l}, DArray.revIterateAux a (fun i => cons) m h l =
-- ofFnAux (DArray.read a) m h l
-- from this
-- intros; induction' m with m IH generalizing l; Β· rfl
-- simp only [DArray.revIterateAux, of_fn_aux, IH]
-- #align list.array_eq_of_fn List.array_eq_of_fn
@[congr]
theorem ofFn_congr {m n : β} (h : m = n) (f : Fin m β Ξ±) :
ofFn f = ofFn fun i : Fin n => f (Fin.cast h.symm i) := by
subst h
simp_rw [Fin.cast_refl, id]
#align list.of_fn_congr List.ofFn_congr
@[simp]
theorem ofFn_zero (f : Fin 0 β Ξ±) : ofFn f = [] :=
ext_get (by simp) (fun i hiβ hiβ => by contradiction)
#align list.of_fn_zero List.ofFn_zero
@[simp]
theorem ofFn_succ {n} (f : Fin (succ n) β Ξ±) : ofFn f = f 0 :: ofFn fun i => f i.succ :=
ext_get (by simp) (fun i hiβ hiβ => by
cases i
Β· simp; rfl
Β· simp)
#align list.of_fn_succ List.ofFn_succ
| Mathlib/Data/List/OfFn.lean | 125 | 131 | theorem ofFn_succ' {n} (f : Fin (succ n) β Ξ±) :
ofFn f = (ofFn fun i => f (Fin.castSucc i)).concat (f (Fin.last _)) := by |
induction' n with n IH
Β· rw [ofFn_zero, concat_nil, ofFn_succ, ofFn_zero]
rfl
Β· rw [ofFn_succ, IH, ofFn_succ, concat_cons, Fin.castSucc_zero]
congr
| 0.0625 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
#align finset.gcd_insert Finset.gcd_insert
@[simp]
theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) :=
Multiset.gcd_singleton
#align finset.gcd_singleton Finset.gcd_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by simp [gcd_def]
#align finset.normalize_gcd Finset.normalize_gcd
theorem gcd_union [DecidableEq Ξ²] : (sβ βͺ sβ).gcd f = GCDMonoid.gcd (sβ.gcd f) (sβ.gcd f) :=
Finset.induction_on sβ (by rw [empty_union, gcd_empty, gcd_zero_left, normalize_gcd])
fun a s _ ih β¦ by rw [insert_union, gcd_insert, gcd_insert, ih, gcd_assoc]
#align finset.gcd_union Finset.gcd_union
theorem gcd_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.gcd f = sβ.gcd g := by
subst hs
exact Finset.fold_congr hfg
#align finset.gcd_congr Finset.gcd_congr
theorem gcd_mono_fun {g : Ξ² β Ξ±} (h : β b β s, f b β£ g b) : s.gcd f β£ s.gcd g :=
dvd_gcd fun b hb β¦ (gcd_dvd hb).trans (h b hb)
#align finset.gcd_mono_fun Finset.gcd_mono_fun
theorem gcd_mono (h : sβ β sβ) : sβ.gcd f β£ sβ.gcd f :=
dvd_gcd fun _ hb β¦ gcd_dvd (h hb)
#align finset.gcd_mono Finset.gcd_mono
theorem gcd_image [DecidableEq Ξ²] {g : Ξ³ β Ξ²} (s : Finset Ξ³) :
(s.image g).gcd f = s.gcd (f β g) := by
classical induction' s using Finset.induction with c s _ ih <;> simp [*]
#align finset.gcd_image Finset.gcd_image
theorem gcd_eq_gcd_image [DecidableEq Ξ±] : s.gcd f = (s.image f).gcd id :=
Eq.symm <| gcd_image _
#align finset.gcd_eq_gcd_image Finset.gcd_eq_gcd_image
| Mathlib/Algebra/GCDMonoid/Finset.lean | 212 | 223 | theorem gcd_eq_zero_iff : s.gcd f = 0 β β x : Ξ², x β s β f x = 0 := by |
rw [gcd_def, Multiset.gcd_eq_zero_iff]
constructor <;> intro h
Β· intro b bs
apply h (f b)
simp only [Multiset.mem_map, mem_def.1 bs]
use b
simp only [mem_def.1 bs, eq_self_iff_true, and_self]
Β· intro a as
rw [Multiset.mem_map] at as
rcases as with β¨b, β¨bs, rflβ©β©
apply h b (mem_def.1 bs)
| 0.0625 |
import Mathlib.Data.List.OfFn
import Mathlib.Data.List.Range
#align_import data.list.fin_range from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
universe u
namespace List
variable {Ξ± : Type u}
@[simp]
theorem map_coe_finRange (n : β) : ((finRange n) : List (Fin n)).map (Fin.val) = List.range n := by
simp_rw [finRange, map_pmap, pmap_eq_map]
exact List.map_id _
#align list.map_coe_fin_range List.map_coe_finRange
theorem finRange_succ_eq_map (n : β) : finRange n.succ = 0 :: (finRange n).map Fin.succ := by
apply map_injective_iff.mpr Fin.val_injective
rw [map_cons, map_coe_finRange, range_succ_eq_map, Fin.val_zero, β map_coe_finRange, map_map,
map_map]
simp only [Function.comp, Fin.val_succ]
#align list.fin_range_succ_eq_map List.finRange_succ_eq_map
| Mathlib/Data/List/FinRange.lean | 37 | 40 | theorem finRange_succ (n : β) :
finRange n.succ = (finRange n |>.map Fin.castSucc |>.concat (.last _)) := by |
apply map_injective_iff.mpr Fin.val_injective
simp [range_succ, Function.comp_def]
| 0.0625 |
import Mathlib.CategoryTheory.Comma.Basic
import Mathlib.CategoryTheory.PUnit
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
import Mathlib.CategoryTheory.EssentiallySmall
import Mathlib.Logic.Small.Set
#align_import category_theory.structured_arrow from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b"
namespace CategoryTheory
-- morphism levels before object levels. See note [CategoryTheory universes].
universe vβ vβ vβ vβ uβ uβ uβ uβ
variable {C : Type uβ} [Category.{vβ} C] {D : Type uβ} [Category.{vβ} D]
-- We explicitly come from `PUnit.{1}` here to obtain the correct universe for morphisms of
-- structured arrows.
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
def StructuredArrow (S : D) (T : C β₯€ D) :=
Comma (Functor.fromPUnit.{0} S) T
#align category_theory.structured_arrow CategoryTheory.StructuredArrow
-- Porting note: not found by inferInstance
instance (S : D) (T : C β₯€ D) : Category (StructuredArrow S T) := commaCategory
namespace StructuredArrow
@[simps!]
def proj (S : D) (T : C β₯€ D) : StructuredArrow S T β₯€ C :=
Comma.snd _ _
#align category_theory.structured_arrow.proj CategoryTheory.StructuredArrow.proj
variable {S S' S'' : D} {Y Y' Y'' : C} {T T' : C β₯€ D}
-- Porting note: this lemma was added because `Comma.hom_ext`
-- was not triggered automatically
-- See https://github.com/leanprover-community/mathlib4/issues/5229
@[ext]
lemma hom_ext {X Y : StructuredArrow S T} (f g : X βΆ Y) (h : f.right = g.right) : f = g :=
CommaMorphism.ext _ _ (Subsingleton.elim _ _) h
@[simp]
theorem hom_eq_iff {X Y : StructuredArrow S T} (f g : X βΆ Y) : f = g β f.right = g.right :=
β¨fun h β¦ by rw [h], hom_ext _ _β©
def mk (f : S βΆ T.obj Y) : StructuredArrow S T :=
β¨β¨β¨β©β©, Y, fβ©
#align category_theory.structured_arrow.mk CategoryTheory.StructuredArrow.mk
@[simp]
theorem mk_left (f : S βΆ T.obj Y) : (mk f).left = β¨β¨β©β© :=
rfl
#align category_theory.structured_arrow.mk_left CategoryTheory.StructuredArrow.mk_left
@[simp]
theorem mk_right (f : S βΆ T.obj Y) : (mk f).right = Y :=
rfl
#align category_theory.structured_arrow.mk_right CategoryTheory.StructuredArrow.mk_right
@[simp]
theorem mk_hom_eq_self (f : S βΆ T.obj Y) : (mk f).hom = f :=
rfl
#align category_theory.structured_arrow.mk_hom_eq_self CategoryTheory.StructuredArrow.mk_hom_eq_self
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Comma/StructuredArrow.lean | 90 | 91 | theorem w {A B : StructuredArrow S T} (f : A βΆ B) : A.hom β« T.map f.right = B.hom := by |
have := f.w; aesop_cat
| 0.0625 |
import Mathlib.Data.Vector.Basic
import Mathlib.Data.Vector.Snoc
set_option autoImplicit true
namespace Vector
section Fold
section Binary
variable (xs : Vector Ξ± n) (ys : Vector Ξ² n)
@[simp]
| Mathlib/Data/Vector/MapLemmas.lean | 60 | 68 | theorem mapAccumrβ_mapAccumr_left (fβ : Ξ³ β Ξ² β Οβ β Οβ Γ ΞΆ) (fβ : Ξ± β Οβ β Οβ Γ Ξ³) :
(mapAccumrβ fβ (mapAccumr fβ xs sβ).snd ys sβ)
= let m := (mapAccumrβ (fun x y s =>
let rβ := fβ x s.snd
let rβ := fβ rβ.snd y s.fst
((rβ.fst, rβ.fst), rβ.snd)
) xs ys (sβ, sβ))
(m.fst.fst, m.snd) := by |
induction xs, ys using Vector.revInductionOnβ generalizing sβ sβ <;> simp_all
| 0.0625 |
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.MeasureTheory.Integral.Lebesgue
open scoped Classical ENNReal
open Set Function Equiv Finset
noncomputable section
namespace MeasureTheory
section LMarginal
variable {Ξ΄ Ξ΄' : Type*} {Ο : Ξ΄ β Type*} [β x, MeasurableSpace (Ο x)]
variable {ΞΌ : β i, Measure (Ο i)} [β i, SigmaFinite (ΞΌ i)] [DecidableEq Ξ΄]
variable {s t : Finset Ξ΄} {f g : (β i, Ο i) β ββ₯0β} {x y : β i, Ο i} {i : Ξ΄}
def lmarginal (ΞΌ : β i, Measure (Ο i)) (s : Finset Ξ΄) (f : (β i, Ο i) β ββ₯0β)
(x : β i, Ο i) : ββ₯0β :=
β«β» y : β i : s, Ο i, f (updateFinset x s y) βMeasure.pi fun i : s => ΞΌ i
-- Note: this notation is not a binder. This is more convenient since it returns a function.
@[inherit_doc]
notation "β«β―β«β»_" s ", " f " β" ΞΌ:70 => lmarginal ΞΌ s f
@[inherit_doc]
notation "β«β―β«β»_" s ", " f => lmarginal (fun _ β¦ volume) s f
variable (ΞΌ)
theorem _root_.Measurable.lmarginal (hf : Measurable f) : Measurable (β«β―β«β»_s, f βΞΌ) := by
refine Measurable.lintegral_prod_right ?_
refine hf.comp ?_
rw [measurable_pi_iff]; intro i
by_cases hi : i β s
Β· simp [hi, updateFinset]
exact measurable_pi_iff.1 measurable_snd _
Β· simp [hi, updateFinset]
exact measurable_pi_iff.1 measurable_fst _
@[simp] theorem lmarginal_empty (f : (β i, Ο i) β ββ₯0β) : β«β―β«β»_β
, f βΞΌ = f := by
ext1 x
simp_rw [lmarginal, Measure.pi_of_empty fun i : (β
: Finset Ξ΄) => ΞΌ i]
apply lintegral_dirac'
exact Subsingleton.measurable
theorem lmarginal_congr {x y : β i, Ο i} (f : (β i, Ο i) β ββ₯0β)
(h : β i β s, x i = y i) :
(β«β―β«β»_s, f βΞΌ) x = (β«β―β«β»_s, f βΞΌ) y := by
dsimp [lmarginal, updateFinset_def]; rcongr; exact h _ βΉ_βΊ
| Mathlib/MeasureTheory/Integral/Marginal.lean | 110 | 116 | theorem lmarginal_update_of_mem {i : Ξ΄} (hi : i β s)
(f : (β i, Ο i) β ββ₯0β) (x : β i, Ο i) (y : Ο i) :
(β«β―β«β»_s, f βΞΌ) (Function.update x i y) = (β«β―β«β»_s, f βΞΌ) x := by |
apply lmarginal_congr
intro j hj
have : j β i := by rintro rfl; exact hj hi
apply update_noteq this
| 0.0625 |
import Mathlib.CategoryTheory.Sites.IsSheafFor
import Mathlib.CategoryTheory.Limits.Shapes.Types
import Mathlib.Tactic.ApplyFun
#align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe w v u
namespace CategoryTheory
open Opposite CategoryTheory Category Limits Sieve
namespace Equalizer
variable {C : Type u} [Category.{v} C] (P : Cα΅α΅ β₯€ Type max v u) {X : C} (R : Presieve X)
(S : Sieve X)
noncomputable section
def FirstObj : Type max v u :=
βαΆ fun f : Ξ£Y, { f : Y βΆ X // R f } => P.obj (op f.1)
#align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj
variable {P R}
-- Porting note (#10688): added to ease automation
@[ext]
lemma FirstObj.ext (zβ zβ : FirstObj P R) (h : β (Y : C) (f : Y βΆ X)
(hf : R f), (Pi.Ο _ β¨Y, f, hfβ© : FirstObj P R βΆ _) zβ =
(Pi.Ο _ β¨Y, f, hfβ© : FirstObj P R βΆ _) zβ) : zβ = zβ := by
apply Limits.Types.limit_ext
rintro β¨β¨Y, f, hfβ©β©
exact h Y f hf
variable (P R)
@[simps]
def firstObjEqFamily : FirstObj P R β
R.FamilyOfElements P where
hom t Y f hf := Pi.Ο (fun f : Ξ£Y, { f : Y βΆ X // R f } => P.obj (op f.1)) β¨_, _, hfβ© t
inv := Pi.lift fun f x => x _ f.2.2
#align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily
instance : Inhabited (FirstObj P (β₯ : Presieve X)) :=
(firstObjEqFamily P _).toEquiv.inhabited
-- Porting note: was not needed in mathlib
instance : Inhabited (FirstObj P ((β₯ : Sieve X) : Presieve X)) :=
(inferInstance : Inhabited (FirstObj P (β₯ : Presieve X)))
def forkMap : P.obj (op X) βΆ FirstObj P R :=
Pi.lift fun f => P.map f.2.1.op
#align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap
namespace Sieve
def SecondObj : Type max v u :=
βαΆ fun f : Ξ£(Y Z : _) (_ : Z βΆ Y), { f' : Y βΆ X // S f' } => P.obj (op f.2.1)
#align category_theory.equalizer.sieve.second_obj CategoryTheory.Equalizer.Sieve.SecondObj
variable {P S}
-- Porting note (#10688): added to ease automation
@[ext]
lemma SecondObj.ext (zβ zβ : SecondObj P S) (h : β (Y Z : C) (g : Z βΆ Y) (f : Y βΆ X)
(hf : S.arrows f), (Pi.Ο _ β¨Y, Z, g, f, hfβ© : SecondObj P S βΆ _) zβ =
(Pi.Ο _ β¨Y, Z, g, f, hfβ© : SecondObj P S βΆ _) zβ) : zβ = zβ := by
apply Limits.Types.limit_ext
rintro β¨β¨Y, Z, g, f, hfβ©β©
apply h
variable (P S)
def firstMap : FirstObj P (S : Presieve X) βΆ SecondObj P S :=
Pi.lift fun fg =>
Pi.Ο _ (β¨_, _, S.downward_closed fg.2.2.2.2 fg.2.2.1β© : Ξ£Y, { f : Y βΆ X // S f })
#align category_theory.equalizer.sieve.first_map CategoryTheory.Equalizer.Sieve.firstMap
instance : Inhabited (SecondObj P (β₯ : Sieve X)) :=
β¨firstMap _ _ defaultβ©
def secondMap : FirstObj P (S : Presieve X) βΆ SecondObj P S :=
Pi.lift fun fg => Pi.Ο _ β¨_, fg.2.2.2β© β« P.map fg.2.2.1.op
#align category_theory.equalizer.sieve.second_map CategoryTheory.Equalizer.Sieve.secondMap
| Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean | 133 | 135 | theorem w : forkMap P (S : Presieve X) β« firstMap P S = forkMap P S β« secondMap P S := by |
ext
simp [firstMap, secondMap, forkMap]
| 0.0625 |
import Mathlib.Algebra.Group.Pi.Lemmas
import Mathlib.Algebra.Module.Defs
import Mathlib.GroupTheory.Abelianization
import Mathlib.GroupTheory.FreeGroup.Basic
#align_import group_theory.free_abelian_group from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
universe u v
variable (Ξ± : Type u)
def FreeAbelianGroup : Type u :=
Additive <| Abelianization <| FreeGroup Ξ±
#align free_abelian_group FreeAbelianGroup
-- FIXME: this is super broken, because the functions have type `Additive .. β ..`
-- instead of `FreeAbelianGroup Ξ± β ..` and those are not defeq!
instance FreeAbelianGroup.addCommGroup : AddCommGroup (FreeAbelianGroup Ξ±) :=
@Additive.addCommGroup _ <| Abelianization.commGroup _
instance : Inhabited (FreeAbelianGroup Ξ±) :=
β¨0β©
instance [IsEmpty Ξ±] : Unique (FreeAbelianGroup Ξ±) := by unfold FreeAbelianGroup; infer_instance
variable {Ξ±}
namespace FreeAbelianGroup
def of (x : Ξ±) : FreeAbelianGroup Ξ± :=
Abelianization.of <| FreeGroup.of x
#align free_abelian_group.of FreeAbelianGroup.of
def lift {Ξ² : Type v} [AddCommGroup Ξ²] : (Ξ± β Ξ²) β (FreeAbelianGroup Ξ± β+ Ξ²) :=
(@FreeGroup.lift _ (Multiplicative Ξ²) _).trans <|
(@Abelianization.lift _ _ (Multiplicative Ξ²) _).trans MonoidHom.toAdditive
#align free_abelian_group.lift FreeAbelianGroup.lift
namespace lift
variable {Ξ² : Type v} [AddCommGroup Ξ²] (f : Ξ± β Ξ²)
open FreeAbelianGroup
-- Porting note: needed to add `(Ξ² := Multiplicative Ξ²)` and `using 1`.
@[simp]
protected theorem of (x : Ξ±) : lift f (of x) = f x := by
convert Abelianization.lift.of
(FreeGroup.lift f (Ξ² := Multiplicative Ξ²)) (FreeGroup.of x) using 1
exact (FreeGroup.lift.of (Ξ² := Multiplicative Ξ²)).symm
#align free_abelian_group.lift.of FreeAbelianGroup.lift.of
protected theorem unique (g : FreeAbelianGroup Ξ± β+ Ξ²) (hg : β x, g (of x) = f x) {x} :
g x = lift f x :=
DFunLike.congr_fun (lift.symm_apply_eq.mp (funext hg : g β of = f)) _
#align free_abelian_group.lift.unique FreeAbelianGroup.lift.unique
@[ext high]
protected theorem ext (g h : FreeAbelianGroup Ξ± β+ Ξ²) (H : β x, g (of x) = h (of x)) : g = h :=
lift.symm.injective <| funext H
#align free_abelian_group.lift.ext FreeAbelianGroup.lift.ext
| Mathlib/GroupTheory/FreeAbelianGroup.lean | 129 | 135 | theorem map_hom {Ξ± Ξ² Ξ³} [AddCommGroup Ξ²] [AddCommGroup Ξ³] (a : FreeAbelianGroup Ξ±) (f : Ξ± β Ξ²)
(g : Ξ² β+ Ξ³) : g (lift f a) = lift (g β f) a := by |
show (g.comp (lift f)) a = lift (g β f) a
apply lift.unique
intro a
show g ((lift f) (of a)) = g (f a)
simp only [(Β· β Β·), lift.of]
| 0.0625 |
import Mathlib.Analysis.SpecialFunctions.Integrals
#align_import data.real.pi.wallis from "leanprover-community/mathlib"@"980755c33b9168bc82f774f665eaa27878140fac"
open scoped Real Topology Nat
open Filter Finset intervalIntegral
namespace Real
namespace Wallis
set_option linter.uppercaseLean3 false
noncomputable def W (k : β) : β :=
β i β range k, (2 * i + 2) / (2 * i + 1) * ((2 * i + 2) / (2 * i + 3))
#align real.wallis.W Real.Wallis.W
theorem W_succ (k : β) :
W (k + 1) = W k * ((2 * k + 2) / (2 * k + 1) * ((2 * k + 2) / (2 * k + 3))) :=
prod_range_succ _ _
#align real.wallis.W_succ Real.Wallis.W_succ
theorem W_pos (k : β) : 0 < W k := by
induction' k with k hk
Β· unfold W; simp
Β· rw [W_succ]
refine mul_pos hk (mul_pos (div_pos ?_ ?_) (div_pos ?_ ?_)) <;> positivity
#align real.wallis.W_pos Real.Wallis.W_pos
theorem W_eq_factorial_ratio (n : β) :
W n = 2 ^ (4 * n) * n ! ^ 4 / ((2 * n)! ^ 2 * (2 * n + 1)) := by
induction' n with n IH
Β· simp only [W, prod_range_zero, Nat.factorial_zero, mul_zero, pow_zero,
algebraMap.coe_one, one_pow, mul_one, algebraMap.coe_zero, zero_add, div_self, Ne,
one_ne_zero, not_false_iff]
norm_num
Β· unfold W at IH β’
rw [prod_range_succ, IH, _root_.div_mul_div_comm, _root_.div_mul_div_comm]
refine (div_eq_div_iff ?_ ?_).mpr ?_
any_goals exact ne_of_gt (by positivity)
simp_rw [Nat.mul_succ, Nat.factorial_succ, pow_succ]
push_cast
ring_nf
#align real.wallis.W_eq_factorial_ratio Real.Wallis.W_eq_factorial_ratio
theorem W_eq_integral_sin_pow_div_integral_sin_pow (k : β) : (Ο / 2)β»ΒΉ * W k =
(β« x : β in (0)..Ο, sin x ^ (2 * k + 1)) / β« x : β in (0)..Ο, sin x ^ (2 * k) := by
rw [integral_sin_pow_even, integral_sin_pow_odd, mul_div_mul_comm, β prod_div_distrib, inv_div]
simp_rw [div_div_div_comm, div_div_eq_mul_div, mul_div_assoc]
rfl
#align real.wallis.W_eq_integral_sin_pow_div_integral_sin_pow Real.Wallis.W_eq_integral_sin_pow_div_integral_sin_pow
| Mathlib/Data/Real/Pi/Wallis.lean | 85 | 88 | theorem W_le (k : β) : W k β€ Ο / 2 := by |
rw [β div_le_one pi_div_two_pos, div_eq_inv_mul]
rw [W_eq_integral_sin_pow_div_integral_sin_pow, div_le_one (integral_sin_pow_pos _)]
apply integral_sin_pow_succ_le
| 0.0625 |
import Mathlib.Algebra.Lie.Matrix
import Mathlib.LinearAlgebra.Matrix.SesquilinearForm
import Mathlib.Tactic.NoncommRing
#align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec"
universe u v w wβ
section SkewAdjointMatrices
open scoped Matrix
variable {R : Type u} {n : Type w} [CommRing R] [DecidableEq n] [Fintype n]
variable (J : Matrix n n R)
theorem Matrix.lie_transpose (A B : Matrix n n R) : β
A, Bβα΅ = β
Bα΅, Aα΅β :=
show (A * B - B * A)α΅ = Bα΅ * Aα΅ - Aα΅ * Bα΅ by simp
#align matrix.lie_transpose Matrix.lie_transpose
-- Porting note: Changed `(A B)` to `{A B}` for convenience in `skewAdjointMatricesLieSubalgebra`
| Mathlib/Algebra/Lie/SkewAdjoint.lean | 103 | 112 | theorem Matrix.isSkewAdjoint_bracket {A B : Matrix n n R} (hA : A β skewAdjointMatricesSubmodule J)
(hB : B β skewAdjointMatricesSubmodule J) : β
A, Bβ β skewAdjointMatricesSubmodule J := by |
simp only [mem_skewAdjointMatricesSubmodule] at *
change β
A, Bβα΅ * J = J * (-β
A, Bβ)
change Aα΅ * J = J * (-A) at hA
change Bα΅ * J = J * (-B) at hB
rw [Matrix.lie_transpose, LieRing.of_associative_ring_bracket,
LieRing.of_associative_ring_bracket, sub_mul, mul_assoc, mul_assoc, hA, hB, β mul_assoc,
β mul_assoc, hA, hB]
noncomm_ring
| 0.0625 |
import Mathlib.Combinatorics.SetFamily.Shadow
#align_import combinatorics.set_family.compression.uv from "leanprover-community/mathlib"@"6f8ab7de1c4b78a68ab8cf7dd83d549eb78a68a1"
open Finset
variable {Ξ± : Type*}
theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra Ξ±] (u v : Ξ±) :
{ x | Disjoint u x β§ v β€ x }.InjOn fun x => (x β u) \ v := by
rintro a ha b hb hab
have h : ((a β u) \ v) \ u β v = ((b β u) \ v) \ u β v := by
dsimp at hab
rw [hab]
rwa [sdiff_sdiff_comm, ha.1.symm.sup_sdiff_cancel_right, sdiff_sdiff_comm,
hb.1.symm.sup_sdiff_cancel_right, sdiff_sup_cancel ha.2, sdiff_sup_cancel hb.2] at h
#align sup_sdiff_inj_on sup_sdiff_injOn
-- The namespace is here to distinguish from other compressions.
namespace UV
section GeneralizedBooleanAlgebra
variable [GeneralizedBooleanAlgebra Ξ±] [DecidableRel (@Disjoint Ξ± _ _)]
[DecidableRel ((Β· β€ Β·) : Ξ± β Ξ± β Prop)] {s : Finset Ξ±} {u v a b : Ξ±}
def compress (u v a : Ξ±) : Ξ± :=
if Disjoint u a β§ v β€ a then (a β u) \ v else a
#align uv.compress UV.compress
theorem compress_of_disjoint_of_le (hua : Disjoint u a) (hva : v β€ a) :
compress u v a = (a β u) \ v :=
if_pos β¨hua, hvaβ©
#align uv.compress_of_disjoint_of_le UV.compress_of_disjoint_of_le
theorem compress_of_disjoint_of_le' (hva : Disjoint v a) (hua : u β€ a) :
compress u v ((a β v) \ u) = a := by
rw [compress_of_disjoint_of_le disjoint_sdiff_self_right
(le_sdiff.2 β¨(le_sup_right : v β€ a β v), hva.mono_right huaβ©),
sdiff_sup_cancel (le_sup_of_le_left hua), hva.symm.sup_sdiff_cancel_right]
#align uv.compress_of_disjoint_of_le' UV.compress_of_disjoint_of_le'
@[simp]
theorem compress_self (u a : Ξ±) : compress u u a = a := by
unfold compress
split_ifs with h
Β· exact h.1.symm.sup_sdiff_cancel_right
Β· rfl
#align uv.compress_self UV.compress_self
@[simp]
theorem compress_sdiff_sdiff (a b : Ξ±) : compress (a \ b) (b \ a) b = a := by
refine (compress_of_disjoint_of_le disjoint_sdiff_self_left sdiff_le).trans ?_
rw [sup_sdiff_self_right, sup_sdiff, disjoint_sdiff_self_right.sdiff_eq_left, sup_eq_right]
exact sdiff_sdiff_le
#align uv.compress_sdiff_sdiff UV.compress_sdiff_sdiff
@[simp]
theorem compress_idem (u v a : Ξ±) : compress u v (compress u v a) = compress u v a := by
unfold compress
split_ifs with h h'
Β· rw [le_sdiff_iff.1 h'.2, sdiff_bot, sdiff_bot, sup_assoc, sup_idem]
Β· rfl
Β· rfl
#align uv.compress_idem UV.compress_idem
variable [DecidableEq Ξ±]
def compression (u v : Ξ±) (s : Finset Ξ±) :=
(s.filter (compress u v Β· β s)) βͺ (s.image <| compress u v).filter (Β· β s)
#align uv.compression UV.compression
@[inherit_doc]
scoped[FinsetFamily] notation "π " => UV.compression
open scoped FinsetFamily
def IsCompressed (u v : Ξ±) (s : Finset Ξ±) :=
π u v s = s
#align uv.is_compressed UV.IsCompressed
theorem compress_injOn : Set.InjOn (compress u v) β(s.filter (compress u v Β· β s)) := by
intro a ha b hb hab
rw [mem_coe, mem_filter] at ha hb
rw [compress] at ha hab
split_ifs at ha hab with has
Β· rw [compress] at hb hab
split_ifs at hb hab with hbs
Β· exact sup_sdiff_injOn u v has hbs hab
Β· exact (hb.2 hb.1).elim
Β· exact (ha.2 ha.1).elim
#align uv.compress_inj_on UV.compress_injOn
| Mathlib/Combinatorics/SetFamily/Compression/UV.lean | 156 | 158 | theorem mem_compression :
a β π u v s β a β s β§ compress u v a β s β¨ a β s β§ β b β s, compress u v b = a := by |
simp_rw [compression, mem_union, mem_filter, mem_image, and_comm]
| 0.0625 |
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics
import Mathlib.NumberTheory.Liouville.Basic
import Mathlib.Topology.Instances.Irrational
#align_import number_theory.liouville.liouville_with from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8"
open Filter Metric Real Set
open scoped Filter Topology
def LiouvilleWith (p x : β) : Prop :=
β C, βαΆ n : β in atTop, β m : β€, x β m / n β§ |x - m / n| < C / n ^ p
#align liouville_with LiouvilleWith
theorem liouvilleWith_one (x : β) : LiouvilleWith 1 x := by
use 2
refine ((eventually_gt_atTop 0).mono fun n hn => ?_).frequently
have hn' : (0 : β) < n := by simpa
have : x < β(βx * βnβ + 1) / βn := by
rw [lt_div_iff hn', Int.cast_add, Int.cast_one];
exact Int.lt_floor_add_one _
refine β¨βx * nβ + 1, this.ne, ?_β©
rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add',
add_div_eq_mul_add_div _ _ hn'.ne']
gcongr
calc _ β€ x * n + 1 := by push_cast; gcongr; apply Int.floor_le
_ < x * n + 2 := by linarith
#align liouville_with_one liouvilleWith_one
namespace LiouvilleWith
variable {p q x y : β} {r : β} {m : β€} {n : β}
theorem exists_pos (h : LiouvilleWith p x) :
β (C : β) (_hβ : 0 < C),
βαΆ n : β in atTop, 1 β€ n β§ β m : β€, x β m / n β§ |x - m / n| < C / n ^ p := by
rcases h with β¨C, hCβ©
refine β¨max C 1, zero_lt_one.trans_le <| le_max_right _ _, ?_β©
refine ((eventually_ge_atTop 1).and_frequently hC).mono ?_
rintro n β¨hle, m, hne, hltβ©
refine β¨hle, m, hne, hlt.trans_le ?_β©
gcongr
apply le_max_left
#align liouville_with.exists_pos LiouvilleWith.exists_pos
| Mathlib/NumberTheory/Liouville/LiouvilleWith.lean | 89 | 94 | theorem mono (h : LiouvilleWith p x) (hle : q β€ p) : LiouvilleWith q x := by |
rcases h.exists_pos with β¨C, hCβ, hCβ©
refine β¨C, hC.mono ?_β©; rintro n β¨hn, m, hne, hltβ©
refine β¨m, hne, hlt.trans_le <| ?_β©
gcongr
exact_mod_cast hn
| 0.0625 |
import Mathlib.Order.Lattice
import Mathlib.Data.List.Sort
import Mathlib.Logic.Equiv.Fin
import Mathlib.Logic.Equiv.Functor
import Mathlib.Data.Fintype.Card
import Mathlib.Order.RelSeries
#align_import order.jordan_holder from "leanprover-community/mathlib"@"91288e351d51b3f0748f0a38faa7613fb0ae2ada"
universe u
open Set RelSeries
class JordanHolderLattice (X : Type u) [Lattice X] where
IsMaximal : X β X β Prop
lt_of_isMaximal : β {x y}, IsMaximal x y β x < y
sup_eq_of_isMaximal : β {x y z}, IsMaximal x z β IsMaximal y z β x β y β x β y = z
isMaximal_inf_left_of_isMaximal_sup :
β {x y}, IsMaximal x (x β y) β IsMaximal y (x β y) β IsMaximal (x β y) x
Iso : X Γ X β X Γ X β Prop
iso_symm : β {x y}, Iso x y β Iso y x
iso_trans : β {x y z}, Iso x y β Iso y z β Iso x z
second_iso : β {x y}, IsMaximal x (x β y) β Iso (x, x β y) (x β y, y)
#align jordan_holder_lattice JordanHolderLattice
namespace JordanHolderLattice
variable {X : Type u} [Lattice X] [JordanHolderLattice X]
theorem isMaximal_inf_right_of_isMaximal_sup {x y : X} (hxz : IsMaximal x (x β y))
(hyz : IsMaximal y (x β y)) : IsMaximal (x β y) y := by
rw [inf_comm]
rw [sup_comm] at hxz hyz
exact isMaximal_inf_left_of_isMaximal_sup hyz hxz
#align jordan_holder_lattice.is_maximal_inf_right_of_is_maximal_sup JordanHolderLattice.isMaximal_inf_right_of_isMaximal_sup
| Mathlib/Order/JordanHolder.lean | 109 | 113 | theorem isMaximal_of_eq_inf (x b : X) {a y : X} (ha : x β y = a) (hxy : x β y) (hxb : IsMaximal x b)
(hyb : IsMaximal y b) : IsMaximal a y := by |
have hb : x β y = b := sup_eq_of_isMaximal hxb hyb hxy
substs a b
exact isMaximal_inf_right_of_isMaximal_sup hxb hyb
| 0.0625 |
import Mathlib.Algebra.Quaternion
import Mathlib.Tactic.Ring
#align_import algebra.quaternion_basis from "leanprover-community/mathlib"@"3aa5b8a9ed7a7cabd36e6e1d022c9858ab8a8c2d"
open Quaternion
namespace QuaternionAlgebra
structure Basis {R : Type*} (A : Type*) [CommRing R] [Ring A] [Algebra R A] (cβ cβ : R) where
(i j k : A)
i_mul_i : i * i = cβ β’ (1 : A)
j_mul_j : j * j = cβ β’ (1 : A)
i_mul_j : i * j = k
j_mul_i : j * i = -k
#align quaternion_algebra.basis QuaternionAlgebra.Basis
variable {R : Type*} {A B : Type*} [CommRing R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]
variable {cβ cβ : R}
namespace Basis
@[ext]
protected theorem ext β¦qβ qβ : Basis A cβ cββ¦ (hi : qβ.i = qβ.i) (hj : qβ.j = qβ.j) : qβ = qβ := by
cases qβ; rename_i qβ_i_mul_j _
cases qβ; rename_i qβ_i_mul_j _
congr
rw [β qβ_i_mul_j, β qβ_i_mul_j]
congr
#align quaternion_algebra.basis.ext QuaternionAlgebra.Basis.ext
variable (R)
@[simps i j k]
protected def self : Basis β[R,cβ,cβ] cβ cβ where
i := β¨0, 1, 0, 0β©
i_mul_i := by ext <;> simp
j := β¨0, 0, 1, 0β©
j_mul_j := by ext <;> simp
k := β¨0, 0, 0, 1β©
i_mul_j := by ext <;> simp
j_mul_i := by ext <;> simp
#align quaternion_algebra.basis.self QuaternionAlgebra.Basis.self
variable {R}
instance : Inhabited (Basis β[R,cβ,cβ] cβ cβ) :=
β¨Basis.self Rβ©
variable (q : Basis A cβ cβ)
attribute [simp] i_mul_i j_mul_j i_mul_j j_mul_i
@[simp]
theorem i_mul_k : q.i * q.k = cβ β’ q.j := by
rw [β i_mul_j, β mul_assoc, i_mul_i, smul_mul_assoc, one_mul]
#align quaternion_algebra.basis.i_mul_k QuaternionAlgebra.Basis.i_mul_k
@[simp]
theorem k_mul_i : q.k * q.i = -cβ β’ q.j := by
rw [β i_mul_j, mul_assoc, j_mul_i, mul_neg, i_mul_k, neg_smul]
#align quaternion_algebra.basis.k_mul_i QuaternionAlgebra.Basis.k_mul_i
@[simp]
theorem k_mul_j : q.k * q.j = cβ β’ q.i := by
rw [β i_mul_j, mul_assoc, j_mul_j, mul_smul_comm, mul_one]
#align quaternion_algebra.basis.k_mul_j QuaternionAlgebra.Basis.k_mul_j
@[simp]
| Mathlib/Algebra/QuaternionBasis.lean | 99 | 100 | theorem j_mul_k : q.j * q.k = -cβ β’ q.i := by |
rw [β i_mul_j, β mul_assoc, j_mul_i, neg_mul, k_mul_j, neg_smul]
| 0.0625 |
import Mathlib.Analysis.Calculus.ContDiff.RCLike
import Mathlib.MeasureTheory.Measure.Hausdorff
#align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92"
open scoped MeasureTheory ENNReal NNReal Topology
open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional Filter
variable {ΞΉ X Y : Type*} [EMetricSpace X] [EMetricSpace Y]
@[irreducible] noncomputable def dimH (s : Set X) : ββ₯0β := by
borelize X; exact β¨ (d : ββ₯0) (_ : @hausdorffMeasure X _ _ β¨rflβ© d s = β), d
set_option linter.uppercaseLean3 false in
#align dimH dimH
section Measurable
variable [MeasurableSpace X] [BorelSpace X]
| Mathlib/Topology/MetricSpace/HausdorffDimension.lean | 110 | 111 | theorem dimH_def (s : Set X) : dimH s = β¨ (d : ββ₯0) (_ : ΞΌH[d] s = β), (d : ββ₯0β) := by |
borelize X; rw [dimH]
| 0.0625 |
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
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
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]
#align mellin_convergent.comp_mul_left MellinConvergent.comp_mul_left
theorem MellinConvergent.comp_rpow {f : β β E} {s : β} {a : β} (ha : a β 0) :
MellinConvergent (fun t => f (t ^ a)) s β MellinConvergent f (s / a) := by
refine Iff.trans ?_ (integrableOn_Ioi_comp_rpow_iff' _ ha)
rw [MellinConvergent]
refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi
dsimp only [Pi.smul_apply]
rw [β Complex.coe_smul (t ^ (a - 1)), β mul_smul, β cpow_mul_ofReal_nonneg (le_of_lt ht),
ofReal_cpow (le_of_lt ht), β cpow_add _ _ (ofReal_ne_zero.mpr (ne_of_gt ht)), ofReal_sub,
ofReal_one, mul_sub, mul_div_cancelβ _ (ofReal_ne_zero.mpr ha), mul_one, add_comm, β
add_sub_assoc, sub_add_cancel]
#align mellin_convergent.comp_rpow MellinConvergent.comp_rpow
def Complex.VerticalIntegrable (f : β β E) (Ο : β) (ΞΌ : Measure β := by volume_tac) : Prop :=
Integrable (fun (y : β) β¦ f (Ο + y * I)) ΞΌ
def mellin (f : β β E) (s : β) : E :=
β« t : β in Ioi 0, (t : β) ^ (s - 1) β’ f t
#align mellin mellin
def mellinInv (Ο : β) (f : β β E) (x : β) : E :=
(1 / (2 * Ο)) β’ β« y : β, (x : β) ^ (-(Ο + y * I)) β’ f (Ο + y * I)
-- next few lemmas don't require convergence of the Mellin transform (they are just 0 = 0 otherwise)
theorem mellin_cpow_smul (f : β β E) (s a : β) :
mellin (fun t => (t : β) ^ a β’ f t) s = mellin f (s + a) := by
refine setIntegral_congr measurableSet_Ioi fun t ht => ?_
simp_rw [β sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul]
#align mellin_cpow_smul mellin_cpow_smul
theorem mellin_const_smul (f : β β E) (s : β) {π : Type*} [NontriviallyNormedField π]
[NormedSpace π E] [SMulCommClass β π E] (c : π) :
mellin (fun t => c β’ f t) s = c β’ mellin f s := by simp only [mellin, smul_comm, integral_smul]
#align mellin_const_smul mellin_const_smul
| Mathlib/Analysis/MellinTransform.lean | 117 | 118 | theorem mellin_div_const (f : β β β) (s a : β) : mellin (fun t => f t / a) s = mellin f s / a := by |
simp_rw [mellin, smul_eq_mul, β mul_div_assoc, integral_div]
| 0.0625 |
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]
| Mathlib/Computability/TMToPartrec.lean | 192 | 192 | theorem head_eval (v) : head.eval v = pure [v.headI] := by | simp [head]
| 0.0625 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Analysis.NormedSpace.Basic
import Mathlib.Analysis.Normed.Group.AddTorsor
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace
import Mathlib.Topology.Instances.RealVectorSpace
#align_import analysis.normed_space.add_torsor from "leanprover-community/mathlib"@"837f72de63ad6cd96519cde5f1ffd5ed8d280ad0"
noncomputable section
open NNReal Topology
open Filter
variable {Ξ± V P W Q : Type*} [SeminormedAddCommGroup V] [PseudoMetricSpace P] [NormedAddTorsor V P]
[NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q]
section NormedSpace
variable {π : Type*} [NormedField π] [NormedSpace π V] [NormedSpace π W]
open AffineMap
theorem AffineSubspace.isClosed_direction_iff (s : AffineSubspace π Q) :
IsClosed (s.direction : Set W) β IsClosed (s : Set Q) := by
rcases s.eq_bot_or_nonempty with (rfl | β¨x, hxβ©); Β· simp [isClosed_singleton]
rw [β (IsometryEquiv.vaddConst x).toHomeomorph.symm.isClosed_image,
AffineSubspace.coe_direction_eq_vsub_set_right hx]
rfl
#align affine_subspace.is_closed_direction_iff AffineSubspace.isClosed_direction_iff
@[simp]
theorem dist_center_homothety (pβ pβ : P) (c : π) :
dist pβ (homothety pβ c pβ) = βcβ * dist pβ pβ := by
simp [homothety_def, norm_smul, β dist_eq_norm_vsub, dist_comm]
#align dist_center_homothety dist_center_homothety
@[simp]
theorem nndist_center_homothety (pβ pβ : P) (c : π) :
nndist pβ (homothety pβ c pβ) = βcββ * nndist pβ pβ :=
NNReal.eq <| dist_center_homothety _ _ _
#align nndist_center_homothety nndist_center_homothety
@[simp]
theorem dist_homothety_center (pβ pβ : P) (c : π) :
dist (homothety pβ c pβ) pβ = βcβ * dist pβ pβ := by rw [dist_comm, dist_center_homothety]
#align dist_homothety_center dist_homothety_center
@[simp]
theorem nndist_homothety_center (pβ pβ : P) (c : π) :
nndist (homothety pβ c pβ) pβ = βcββ * nndist pβ pβ :=
NNReal.eq <| dist_homothety_center _ _ _
#align nndist_homothety_center nndist_homothety_center
@[simp]
theorem dist_lineMap_lineMap (pβ pβ : P) (cβ cβ : π) :
dist (lineMap pβ pβ cβ) (lineMap pβ pβ cβ) = dist cβ cβ * dist pβ pβ := by
rw [dist_comm pβ pβ]
simp only [lineMap_apply, dist_eq_norm_vsub, vadd_vsub_vadd_cancel_right,
β sub_smul, norm_smul, vsub_eq_sub]
#align dist_line_map_line_map dist_lineMap_lineMap
@[simp]
theorem nndist_lineMap_lineMap (pβ pβ : P) (cβ cβ : π) :
nndist (lineMap pβ pβ cβ) (lineMap pβ pβ cβ) = nndist cβ cβ * nndist pβ pβ :=
NNReal.eq <| dist_lineMap_lineMap _ _ _ _
#align nndist_line_map_line_map nndist_lineMap_lineMap
theorem lipschitzWith_lineMap (pβ pβ : P) : LipschitzWith (nndist pβ pβ) (lineMap pβ pβ : π β P) :=
LipschitzWith.of_dist_le_mul fun cβ cβ =>
((dist_lineMap_lineMap pβ pβ cβ cβ).trans (mul_comm _ _)).le
#align lipschitz_with_line_map lipschitzWith_lineMap
@[simp]
| Mathlib/Analysis/NormedSpace/AddTorsor.lean | 87 | 88 | theorem dist_lineMap_left (pβ pβ : P) (c : π) : dist (lineMap pβ pβ c) pβ = βcβ * dist pβ pβ := by |
simpa only [lineMap_apply_zero, dist_zero_right] using dist_lineMap_lineMap pβ pβ c 0
| 0.0625 |
import Mathlib.Combinatorics.SetFamily.Shadow
#align_import combinatorics.set_family.compression.uv from "leanprover-community/mathlib"@"6f8ab7de1c4b78a68ab8cf7dd83d549eb78a68a1"
open Finset
variable {Ξ± : Type*}
theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra Ξ±] (u v : Ξ±) :
{ x | Disjoint u x β§ v β€ x }.InjOn fun x => (x β u) \ v := by
rintro a ha b hb hab
have h : ((a β u) \ v) \ u β v = ((b β u) \ v) \ u β v := by
dsimp at hab
rw [hab]
rwa [sdiff_sdiff_comm, ha.1.symm.sup_sdiff_cancel_right, sdiff_sdiff_comm,
hb.1.symm.sup_sdiff_cancel_right, sdiff_sup_cancel ha.2, sdiff_sup_cancel hb.2] at h
#align sup_sdiff_inj_on sup_sdiff_injOn
-- The namespace is here to distinguish from other compressions.
namespace UV
section GeneralizedBooleanAlgebra
variable [GeneralizedBooleanAlgebra Ξ±] [DecidableRel (@Disjoint Ξ± _ _)]
[DecidableRel ((Β· β€ Β·) : Ξ± β Ξ± β Prop)] {s : Finset Ξ±} {u v a b : Ξ±}
def compress (u v a : Ξ±) : Ξ± :=
if Disjoint u a β§ v β€ a then (a β u) \ v else a
#align uv.compress UV.compress
theorem compress_of_disjoint_of_le (hua : Disjoint u a) (hva : v β€ a) :
compress u v a = (a β u) \ v :=
if_pos β¨hua, hvaβ©
#align uv.compress_of_disjoint_of_le UV.compress_of_disjoint_of_le
theorem compress_of_disjoint_of_le' (hva : Disjoint v a) (hua : u β€ a) :
compress u v ((a β v) \ u) = a := by
rw [compress_of_disjoint_of_le disjoint_sdiff_self_right
(le_sdiff.2 β¨(le_sup_right : v β€ a β v), hva.mono_right huaβ©),
sdiff_sup_cancel (le_sup_of_le_left hua), hva.symm.sup_sdiff_cancel_right]
#align uv.compress_of_disjoint_of_le' UV.compress_of_disjoint_of_le'
@[simp]
| Mathlib/Combinatorics/SetFamily/Compression/UV.lean | 98 | 102 | theorem compress_self (u a : Ξ±) : compress u u a = a := by |
unfold compress
split_ifs with h
Β· exact h.1.symm.sup_sdiff_cancel_right
Β· rfl
| 0.0625 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.