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 | num_lines int64 1 150 |
|---|---|---|---|---|---|---|
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.set.ncard from "leanprover-community/mathlib"@"74c2af38a828107941029b03839882c5c6f87a04"
namespace Set
variable {Ξ± Ξ² : Type*} {s t : Set Ξ±}
noncomputable def encard (s : Set Ξ±) : ββ := PartENat.withTopEquiv (PartENat.card s)
@[simp] theorem encard_univ_coe (s : Set Ξ±) : encard (univ : Set s) = encard s := by
rw [encard, encard, PartENat.card_congr (Equiv.Set.univ βs)]
| Mathlib/Data/Set/Card.lean | 69 | 71 | theorem encard_univ (Ξ± : Type*) :
encard (univ : Set Ξ±) = PartENat.withTopEquiv (PartENat.card Ξ±) := by |
rw [encard, PartENat.card_congr (Equiv.Set.univ Ξ±)]
| 1 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open Topology Filter ENNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
section Composition
variable {π' : Type*} [NontriviallyNormedField π'] [NormedAlgebra π π'] [NormedSpace π' F]
[IsScalarTower π π' F] {s' t' : Set π'} {h : π β π'} {hβ : π β π} {hβ : π' β π'} {h' hβ' : π'}
{hβ' : π} {gβ : π' β F} {gβ' : F} {L' : Filter π'} {y : π'} (x)
theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter gβ gβ' (h x) L')
(hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by
simpa using ((hg.restrictScalars π).comp x hh hL).hasDerivAtFilter
#align has_deriv_at_filter.scomp HasDerivAtFilter.scomp
| Mathlib/Analysis/Calculus/Deriv/Comp.lean | 80 | 83 | theorem HasDerivAtFilter.scomp_of_eq (hg : HasDerivAtFilter gβ gβ' y L')
(hh : HasDerivAtFilter h h' x L) (hy : y = h x) (hL : Tendsto h L L') :
HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by |
rw [hy] at hg; exact hg.scomp x hh hL
| 1 |
import Mathlib.Analysis.InnerProductSpace.Dual
import Mathlib.Analysis.InnerProductSpace.PiL2
#align_import analysis.inner_product_space.adjoint from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
noncomputable section
open RCLike
open scoped ComplexConjugate
variable {π E F G : Type*} [RCLike π]
variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
variable [InnerProductSpace π E] [InnerProductSpace π F] [InnerProductSpace π G]
local notation "βͺ" x ", " y "β«" => @inner π _ _ x y
open InnerProductSpace
namespace ContinuousLinearMap
variable [CompleteSpace E] [CompleteSpace G]
-- Note: made noncomputable to stop excess compilation
-- leanprover-community/mathlib4#7103
noncomputable def adjointAux : (E βL[π] F) βLβ[π] F βL[π] E :=
(ContinuousLinearMap.compSL _ _ _ _ _ ((toDual π E).symm : NormedSpace.Dual π E βLβ[π] E)).comp
(toSesqForm : (E βL[π] F) βL[π] F βLβ[π] NormedSpace.Dual π E)
#align continuous_linear_map.adjoint_aux ContinuousLinearMap.adjointAux
@[simp]
theorem adjointAux_apply (A : E βL[π] F) (x : F) :
adjointAux A x = ((toDual π E).symm : NormedSpace.Dual π E β E) ((toSesqForm A) x) :=
rfl
#align continuous_linear_map.adjoint_aux_apply ContinuousLinearMap.adjointAux_apply
theorem adjointAux_inner_left (A : E βL[π] F) (x : E) (y : F) : βͺadjointAux A y, xβ« = βͺy, A xβ« := by
rw [adjointAux_apply, toDual_symm_apply, toSesqForm_apply_coe, coe_comp', innerSL_apply_coe,
Function.comp_apply]
#align continuous_linear_map.adjoint_aux_inner_left ContinuousLinearMap.adjointAux_inner_left
| Mathlib/Analysis/InnerProductSpace/Adjoint.lean | 85 | 87 | theorem adjointAux_inner_right (A : E βL[π] F) (x : E) (y : F) :
βͺx, adjointAux A yβ« = βͺA x, yβ« := by |
rw [β inner_conj_symm, adjointAux_inner_left, inner_conj_symm]
| 1 |
import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact
import Mathlib.Topology.QuasiSeparated
#align_import algebraic_geometry.morphisms.quasi_separated from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
open scoped AlgebraicGeometry
namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X βΆ Y)
@[mk_iff]
class QuasiSeparated (f : X βΆ Y) : Prop where
diagonalQuasiCompact : QuasiCompact (pullback.diagonal f) := by infer_instance
#align algebraic_geometry.quasi_separated AlgebraicGeometry.QuasiSeparated
def QuasiSeparated.affineProperty : AffineTargetMorphismProperty := fun X _ _ _ =>
QuasiSeparatedSpace X.carrier
#align algebraic_geometry.quasi_separated.affine_property AlgebraicGeometry.QuasiSeparated.affineProperty
theorem quasiSeparatedSpace_iff_affine (X : Scheme) :
QuasiSeparatedSpace X.carrier β β U V : X.affineOpens, IsCompact (U β© V : Set X.carrier) := by
rw [quasiSeparatedSpace_iff]
constructor
Β· intro H U V; exact H U V U.1.2 U.2.isCompact V.1.2 V.2.isCompact
Β· intro H
suffices
β (U : Opens X.carrier) (_ : IsCompact U.1) (V : Opens X.carrier) (_ : IsCompact V.1),
IsCompact (U β V).1
by intro U V hU hU' hV hV'; exact this β¨U, hUβ© hU' β¨V, hVβ© hV'
intro U hU V hV
-- Porting note: it complains "unable to find motive", but telling Lean that motive is
-- underscore is actually sufficient, weird
apply compact_open_induction_on (P := _) V hV
Β· simp
Β· intro S _ V hV
change IsCompact (U.1 β© (S.1 βͺ V.1))
rw [Set.inter_union_distrib_left]
apply hV.union
clear hV
apply compact_open_induction_on (P := _) U hU
Β· simp
Β· intro S _ W hW
change IsCompact ((S.1 βͺ W.1) β© V.1)
rw [Set.union_inter_distrib_right]
apply hW.union
apply H
#align algebraic_geometry.quasi_separated_space_iff_affine AlgebraicGeometry.quasiSeparatedSpace_iff_affine
theorem quasi_compact_affineProperty_iff_quasiSeparatedSpace {X Y : Scheme} [IsAffine Y]
(f : X βΆ Y) : QuasiCompact.affineProperty.diagonal f β QuasiSeparatedSpace X.carrier := by
delta AffineTargetMorphismProperty.diagonal
rw [quasiSeparatedSpace_iff_affine]
constructor
Β· intro H U V
haveI : IsAffine _ := U.2
haveI : IsAffine _ := V.2
let g : pullback (X.ofRestrict U.1.openEmbedding) (X.ofRestrict V.1.openEmbedding) βΆ X :=
pullback.fst β« X.ofRestrict _
-- Porting note: `inferInstance` does not work here
have : IsOpenImmersion g := PresheafedSpace.IsOpenImmersion.comp _ _
have e := Homeomorph.ofEmbedding _ this.base_open.toEmbedding
rw [IsOpenImmersion.range_pullback_to_base_of_left] at e
erw [Subtype.range_coe, Subtype.range_coe] at e
rw [isCompact_iff_compactSpace]
exact @Homeomorph.compactSpace _ _ _ _ (H _ _) e
Β· introv H hβ hβ
let g : pullback fβ fβ βΆ X := pullback.fst β« fβ
-- Porting note: `inferInstance` does not work here
have : IsOpenImmersion g := PresheafedSpace.IsOpenImmersion.comp _ _
have e := Homeomorph.ofEmbedding _ this.base_open.toEmbedding
rw [IsOpenImmersion.range_pullback_to_base_of_left] at e
simp_rw [isCompact_iff_compactSpace] at H
exact
@Homeomorph.compactSpace _ _ _ _
(H β¨β¨_, hβ.base_open.isOpen_rangeβ©, rangeIsAffineOpenOfOpenImmersion _β©
β¨β¨_, hβ.base_open.isOpen_rangeβ©, rangeIsAffineOpenOfOpenImmersion _β©)
e.symm
#align algebraic_geometry.quasi_compact_affine_property_iff_quasi_separated_space AlgebraicGeometry.quasi_compact_affineProperty_iff_quasiSeparatedSpace
| Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean | 117 | 118 | theorem quasiSeparated_eq_diagonal_is_quasiCompact :
@QuasiSeparated = MorphismProperty.diagonal @QuasiCompact := by | ext; exact quasiSeparated_iff _
| 1 |
import Mathlib.Algebra.Algebra.Operations
import Mathlib.Data.Fintype.Lattice
import Mathlib.RingTheory.Coprime.Lemmas
#align_import ring_theory.ideal.operations from "leanprover-community/mathlib"@"e7f0ddbf65bd7181a85edb74b64bdc35ba4bdc74"
assert_not_exists Basis -- See `RingTheory.Ideal.Basis`
assert_not_exists Submodule.hasQuotient -- See `RingTheory.Ideal.QuotientOperations`
universe u v w x
open Pointwise
namespace Submodule
variable {R : Type u} {M : Type v} {M' F G : Type*}
section CommSemiring
variable [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M']
open Pointwise
instance hasSMul' : SMul (Ideal R) (Submodule R M) :=
β¨Submodule.mapβ (LinearMap.lsmul R M)β©
#align submodule.has_smul' Submodule.hasSMul'
protected theorem _root_.Ideal.smul_eq_mul (I J : Ideal R) : I β’ J = I * J :=
rfl
#align ideal.smul_eq_mul Ideal.smul_eq_mul
variable (R M) in
def _root_.Module.annihilator : Ideal R := LinearMap.ker (LinearMap.lsmul R M)
theorem _root_.Module.mem_annihilator {r} : r β Module.annihilator R M β β m : M, r β’ m = 0 :=
β¨fun h β¦ (congr($h Β·)), (LinearMap.ext Β·)β©
theorem _root_.LinearMap.annihilator_le_of_injective (f : M ββ[R] M') (hf : Function.Injective f) :
Module.annihilator R M' β€ Module.annihilator R M := fun x h β¦ by
rw [Module.mem_annihilator] at h β’; exact fun m β¦ hf (by rw [map_smul, h, f.map_zero])
theorem _root_.LinearMap.annihilator_le_of_surjective (f : M ββ[R] M')
(hf : Function.Surjective f) : Module.annihilator R M β€ Module.annihilator R M' := fun x h β¦ by
rw [Module.mem_annihilator] at h β’
intro m; obtain β¨m, rflβ© := hf m
rw [β map_smul, h, f.map_zero]
theorem _root_.LinearEquiv.annihilator_eq (e : M ββ[R] M') :
Module.annihilator R M = Module.annihilator R M' :=
(e.annihilator_le_of_surjective e.surjective).antisymm (e.annihilator_le_of_injective e.injective)
abbrev annihilator (N : Submodule R M) : Ideal R :=
Module.annihilator R N
#align submodule.annihilator Submodule.annihilator
theorem annihilator_top : (β€ : Submodule R M).annihilator = Module.annihilator R M :=
topEquiv.annihilator_eq
variable {I J : Ideal R} {N P : Submodule R M}
| Mathlib/RingTheory/Ideal/Operations.lean | 74 | 75 | theorem mem_annihilator {r} : r β N.annihilator β β n β N, r β’ n = (0 : M) := by |
simp_rw [annihilator, Module.mem_annihilator, Subtype.forall, Subtype.ext_iff]; rfl
| 1 |
import Mathlib.Data.Finset.Image
#align_import data.finset.card from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
assert_not_exists MonoidWithZero
-- TODO: After a lot more work,
-- assert_not_exists OrderedCommMonoid
open Function Multiset Nat
variable {Ξ± Ξ² R : Type*}
namespace Finset
variable {s t : Finset Ξ±} {a b : Ξ±}
def card (s : Finset Ξ±) : β :=
Multiset.card s.1
#align finset.card Finset.card
theorem card_def (s : Finset Ξ±) : s.card = Multiset.card s.1 :=
rfl
#align finset.card_def Finset.card_def
@[simp] lemma card_val (s : Finset Ξ±) : Multiset.card s.1 = s.card := rfl
#align finset.card_val Finset.card_val
@[simp]
theorem card_mk {m nodup} : (β¨m, nodupβ© : Finset Ξ±).card = Multiset.card m :=
rfl
#align finset.card_mk Finset.card_mk
@[simp]
theorem card_empty : card (β
: Finset Ξ±) = 0 :=
rfl
#align finset.card_empty Finset.card_empty
@[gcongr]
theorem card_le_card : s β t β s.card β€ t.card :=
Multiset.card_le_card β val_le_iff.mpr
#align finset.card_le_of_subset Finset.card_le_card
@[mono]
| Mathlib/Data/Finset/Card.lean | 69 | 69 | theorem card_mono : Monotone (@card Ξ±) := by | apply card_le_card
| 1 |
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Data.Rat.Denumerable
import Mathlib.Data.Set.Pointwise.Interval
import Mathlib.SetTheory.Cardinal.Continuum
#align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d"
open Nat Set
open Cardinal
noncomputable section
namespace Cardinal
variable {c : β} {f g : β β Bool} {n : β}
def cantorFunctionAux (c : β) (f : β β Bool) (n : β) : β :=
cond (f n) (c ^ n) 0
#align cardinal.cantor_function_aux Cardinal.cantorFunctionAux
@[simp]
| Mathlib/Data/Real/Cardinality.lean | 64 | 65 | theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by |
simp [cantorFunctionAux, h]
| 1 |
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
universe u v w
open scoped Classical
open Topology Filter ENNReal
open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {π : Type u} [NontriviallyNormedField π]
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
variable {f fβ fβ g : π β F}
variable {f' fβ' fβ' g' : F}
variable {x : π}
variable {s t : Set π}
variable {L Lβ Lβ : Filter π}
section Composition
variable {π' : Type*} [NontriviallyNormedField π'] [NormedAlgebra π π'] [NormedSpace π' F]
[IsScalarTower π π' F] {s' t' : Set π'} {h : π β π'} {hβ : π β π} {hβ : π' β π'} {h' hβ' : π'}
{hβ' : π} {gβ : π' β F} {gβ' : F} {L' : Filter π'} {y : π'} (x)
theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter gβ gβ' (h x) L')
(hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by
simpa using ((hg.restrictScalars π).comp x hh hL).hasDerivAtFilter
#align has_deriv_at_filter.scomp HasDerivAtFilter.scomp
theorem HasDerivAtFilter.scomp_of_eq (hg : HasDerivAtFilter gβ gβ' y L')
(hh : HasDerivAtFilter h h' x L) (hy : y = h x) (hL : Tendsto h L L') :
HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by
rw [hy] at hg; exact hg.scomp x hh hL
theorem HasDerivWithinAt.scomp_hasDerivAt (hg : HasDerivWithinAt gβ gβ' s' (h x))
(hh : HasDerivAt h h' x) (hs : β x, h x β s') : HasDerivAt (gβ β h) (h' β’ gβ') x :=
hg.scomp x hh <| tendsto_inf.2 β¨hh.continuousAt, tendsto_principal.2 <| eventually_of_forall hsβ©
#align has_deriv_within_at.scomp_has_deriv_at HasDerivWithinAt.scomp_hasDerivAt
| Mathlib/Analysis/Calculus/Deriv/Comp.lean | 90 | 93 | theorem HasDerivWithinAt.scomp_hasDerivAt_of_eq (hg : HasDerivWithinAt gβ gβ' s' y)
(hh : HasDerivAt h h' x) (hs : β x, h x β s') (hy : y = h x) :
HasDerivAt (gβ β h) (h' β’ gβ') x := by |
rw [hy] at hg; exact hg.scomp_hasDerivAt x hh hs
| 1 |
import Mathlib.Data.Finset.Lattice
import Mathlib.Data.Fintype.Vector
import Mathlib.Data.Multiset.Sym
#align_import data.finset.sym from "leanprover-community/mathlib"@"02ba8949f486ebecf93fe7460f1ed0564b5e442c"
namespace Finset
variable {Ξ± : Type*}
@[simps]
protected def sym2 (s : Finset Ξ±) : Finset (Sym2 Ξ±) := β¨s.1.sym2, s.2.sym2β©
#align finset.sym2 Finset.sym2
section
variable {s t : Finset Ξ±} {a b : Ξ±}
theorem mk_mem_sym2_iff : s(a, b) β s.sym2 β a β s β§ b β s := by
rw [mem_mk, sym2_val, Multiset.mk_mem_sym2_iff, mem_mk, mem_mk]
#align finset.mk_mem_sym2_iff Finset.mk_mem_sym2_iff
@[simp]
theorem mem_sym2_iff {m : Sym2 Ξ±} : m β s.sym2 β β a β m, a β s := by
rw [mem_mk, sym2_val, Multiset.mem_sym2_iff]
simp only [mem_val]
#align finset.mem_sym2_iff Finset.mem_sym2_iff
instance _root_.Sym2.instFintype [Fintype Ξ±] : Fintype (Sym2 Ξ±) where
elems := Finset.univ.sym2
complete := fun x β¦ by rw [mem_sym2_iff]; exact (fun a _ β¦ mem_univ a)
-- Note(kmill): Using a default argument to make this simp lemma more general.
@[simp]
theorem sym2_univ [Fintype Ξ±] (inst : Fintype (Sym2 Ξ±) := Sym2.instFintype) :
(univ : Finset Ξ±).sym2 = univ := by
ext
simp only [mem_sym2_iff, mem_univ, implies_true]
#align finset.sym2_univ Finset.sym2_univ
@[simp, mono]
theorem sym2_mono (h : s β t) : s.sym2 β t.sym2 := by
rw [β val_le_iff, sym2_val, sym2_val]
apply Multiset.sym2_mono
rwa [val_le_iff]
#align finset.sym2_mono Finset.sym2_mono
theorem monotone_sym2 : Monotone (Finset.sym2 : Finset Ξ± β _) := fun _ _ => sym2_mono
theorem injective_sym2 : Function.Injective (Finset.sym2 : Finset Ξ± β _) := by
intro s t h
ext x
simpa using congr(s(x, x) β $h)
theorem strictMono_sym2 : StrictMono (Finset.sym2 : Finset Ξ± β _) :=
monotone_sym2.strictMono_of_injective injective_sym2
theorem sym2_toFinset [DecidableEq Ξ±] (m : Multiset Ξ±) :
m.toFinset.sym2 = m.sym2.toFinset := by
ext z
refine z.ind fun x y β¦ ?_
simp only [mk_mem_sym2_iff, Multiset.mem_toFinset, Multiset.mk_mem_sym2_iff]
@[simp]
theorem sym2_empty : (β
: Finset Ξ±).sym2 = β
:= rfl
#align finset.sym2_empty Finset.sym2_empty
@[simp]
| Mathlib/Data/Finset/Sym.lean | 96 | 97 | theorem sym2_eq_empty : s.sym2 = β
β s = β
:= by |
rw [β val_eq_zero, sym2_val, Multiset.sym2_eq_zero_iff, val_eq_zero]
| 1 |
import Mathlib.Analysis.Normed.Group.Pointwise
import Mathlib.Analysis.NormedSpace.Real
#align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
open Metric Set
open Pointwise Topology
variable {π E : Type*}
variable [NormedField π]
section SeminormedAddCommGroup
variable [SeminormedAddCommGroup E] [NormedSpace π E]
theorem smul_ball {c : π} (hc : c β 0) (x : E) (r : β) : c β’ ball x r = ball (c β’ x) (βcβ * r) := by
ext y
rw [mem_smul_set_iff_inv_smul_memβ hc]
conv_lhs => rw [β inv_smul_smulβ hc x]
simp [β div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smulβ]
#align smul_ball smul_ball
theorem smul_unitBall {c : π} (hc : c β 0) : c β’ ball (0 : E) (1 : β) = ball (0 : E) βcβ := by
rw [_root_.smul_ball hc, smul_zero, mul_one]
#align smul_unit_ball smul_unitBall
theorem smul_sphere' {c : π} (hc : c β 0) (x : E) (r : β) :
c β’ sphere x r = sphere (c β’ x) (βcβ * r) := by
ext y
rw [mem_smul_set_iff_inv_smul_memβ hc]
conv_lhs => rw [β inv_smul_smulβ hc x]
simp only [mem_sphere, dist_smulβ, norm_inv, β div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne',
mul_comm r]
#align smul_sphere' smul_sphere'
| Mathlib/Analysis/NormedSpace/Pointwise.lean | 104 | 106 | theorem smul_closedBall' {c : π} (hc : c β 0) (x : E) (r : β) :
c β’ closedBall x r = closedBall (c β’ x) (βcβ * r) := by |
simp only [β ball_union_sphere, Set.smul_set_union, _root_.smul_ball hc, smul_sphere' hc]
| 1 |
import Mathlib.LinearAlgebra.Dimension.StrongRankCondition
import Mathlib.LinearAlgebra.FreeModule.Basic
import Mathlib.LinearAlgebra.FreeModule.Finite.Basic
#align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5"
noncomputable section
universe u v v' w
open Cardinal Basis Submodule Function Set DirectSum FiniteDimensional
variable {R : Type u} {M Mβ : Type v} {M' : Type v'}
variable [Ring R] [StrongRankCondition R]
variable [AddCommGroup M] [Module R M] [Module.Free R M]
variable [AddCommGroup M'] [Module R M'] [Module.Free R M']
variable [AddCommGroup Mβ] [Module R Mβ] [Module.Free R Mβ]
namespace Module.Free
variable (R M)
theorem rank_eq_card_chooseBasisIndex : Module.rank R M = #(ChooseBasisIndex R M) :=
(chooseBasis R M).mk_eq_rank''.symm
#align module.free.rank_eq_card_choose_basis_index Module.Free.rank_eq_card_chooseBasisIndex
| Mathlib/LinearAlgebra/Dimension/Free.lean | 88 | 90 | theorem _root_.FiniteDimensional.finrank_eq_card_chooseBasisIndex [Module.Finite R M] :
finrank R M = Fintype.card (ChooseBasisIndex R M) := by |
simp [finrank, rank_eq_card_chooseBasisIndex]
| 1 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Dynamics.FixedPoints.Basic
open Finset Function
section AddCommMonoid
variable {Ξ± M : Type*} [AddCommMonoid M]
def birkhoffSum (f : Ξ± β Ξ±) (g : Ξ± β M) (n : β) (x : Ξ±) : M := β k β range n, g (f^[k] x)
theorem birkhoffSum_zero (f : Ξ± β Ξ±) (g : Ξ± β M) (x : Ξ±) : birkhoffSum f g 0 x = 0 :=
sum_range_zero _
@[simp]
theorem birkhoffSum_zero' (f : Ξ± β Ξ±) (g : Ξ± β M) : birkhoffSum f g 0 = 0 :=
funext <| birkhoffSum_zero _ _
theorem birkhoffSum_one (f : Ξ± β Ξ±) (g : Ξ± β M) (x : Ξ±) : birkhoffSum f g 1 x = g x :=
sum_range_one _
@[simp]
theorem birkhoffSum_one' (f : Ξ± β Ξ±) (g : Ξ± β M) : birkhoffSum f g 1 = g :=
funext <| birkhoffSum_one f g
theorem birkhoffSum_succ (f : Ξ± β Ξ±) (g : Ξ± β M) (n : β) (x : Ξ±) :
birkhoffSum f g (n + 1) x = birkhoffSum f g n x + g (f^[n] x) :=
sum_range_succ _ _
theorem birkhoffSum_succ' (f : Ξ± β Ξ±) (g : Ξ± β M) (n : β) (x : Ξ±) :
birkhoffSum f g (n + 1) x = g x + birkhoffSum f g n (f x) :=
(sum_range_succ' _ _).trans (add_comm _ _)
| Mathlib/Dynamics/BirkhoffSum/Basic.lean | 51 | 53 | theorem birkhoffSum_add (f : Ξ± β Ξ±) (g : Ξ± β M) (m n : β) (x : Ξ±) :
birkhoffSum f g (m + n) x = birkhoffSum f g m x + birkhoffSum f g n (f^[m] x) := by |
simp_rw [birkhoffSum, sum_range_add, add_comm m, iterate_add_apply]
| 1 |
import Mathlib.Topology.MetricSpace.Basic
#align_import topology.metric_space.infsep from "leanprover-community/mathlib"@"5316314b553dcf8c6716541851517c1a9715e22b"
variable {Ξ± Ξ² : Type*}
namespace Set
section Einfsep
open ENNReal
open Function
noncomputable def einfsep [EDist Ξ±] (s : Set Ξ±) : ββ₯0β :=
β¨
(x β s) (y β s) (_ : x β y), edist x y
#align set.einfsep Set.einfsep
section EDist
variable [EDist Ξ±] {x y : Ξ±} {s t : Set Ξ±}
theorem le_einfsep_iff {d} :
d β€ s.einfsep β β x β s, β y β s, x β y β d β€ edist x y := by
simp_rw [einfsep, le_iInf_iff]
#align set.le_einfsep_iff Set.le_einfsep_iff
theorem einfsep_zero : s.einfsep = 0 β β C > 0, β x β s, β y β s, x β y β§ edist x y < C := by
simp_rw [einfsep, β _root_.bot_eq_zero, iInf_eq_bot, iInf_lt_iff, exists_prop]
#align set.einfsep_zero Set.einfsep_zero
theorem einfsep_pos : 0 < s.einfsep β β C > 0, β x β s, β y β s, x β y β C β€ edist x y := by
rw [pos_iff_ne_zero, Ne, einfsep_zero]
simp only [not_forall, not_exists, not_lt, exists_prop, not_and]
#align set.einfsep_pos Set.einfsep_pos
theorem einfsep_top :
s.einfsep = β β β x β s, β y β s, x β y β edist x y = β := by
simp_rw [einfsep, iInf_eq_top]
#align set.einfsep_top Set.einfsep_top
theorem einfsep_lt_top :
s.einfsep < β β β x β s, β y β s, x β y β§ edist x y < β := by
simp_rw [einfsep, iInf_lt_iff, exists_prop]
#align set.einfsep_lt_top Set.einfsep_lt_top
| Mathlib/Topology/MetricSpace/Infsep.lean | 74 | 76 | theorem einfsep_ne_top :
s.einfsep β β β β x β s, β y β s, x β y β§ edist x y β β := by |
simp_rw [β lt_top_iff_ne_top, einfsep_lt_top]
| 1 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't present yet.
#noalign nat.dist.def
theorem dist_comm (n m : β) : dist n m = dist m n := by simp [dist, add_comm]
#align nat.dist_comm Nat.dist_comm
@[simp]
theorem dist_self (n : β) : dist n n = 0 := by simp [dist, tsub_self]
#align nat.dist_self Nat.dist_self
theorem eq_of_dist_eq_zero {n m : β} (h : dist n m = 0) : n = m :=
have : n - m = 0 := Nat.eq_zero_of_add_eq_zero_right h
have : n β€ m := tsub_eq_zero_iff_le.mp this
have : m - n = 0 := Nat.eq_zero_of_add_eq_zero_left h
have : m β€ n := tsub_eq_zero_iff_le.mp this
le_antisymm βΉn β€ mβΊ βΉm β€ nβΊ
#align nat.eq_of_dist_eq_zero Nat.eq_of_dist_eq_zero
theorem dist_eq_zero {n m : β} (h : n = m) : dist n m = 0 := by rw [h, dist_self]
#align nat.dist_eq_zero Nat.dist_eq_zero
theorem dist_eq_sub_of_le {n m : β} (h : n β€ m) : dist n m = m - n := by
rw [dist, tsub_eq_zero_iff_le.mpr h, zero_add]
#align nat.dist_eq_sub_of_le Nat.dist_eq_sub_of_le
| Mathlib/Data/Nat/Dist.lean | 49 | 50 | theorem dist_eq_sub_of_le_right {n m : β} (h : m β€ n) : dist n m = n - m := by |
rw [dist_comm]; apply dist_eq_sub_of_le h
| 1 |
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Analysis.SpecialFunctions.Sqrt
import Mathlib.Analysis.NormedSpace.HomeomorphBall
#align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88"
noncomputable section
open RCLike Real Filter
open scoped Classical Topology
section DerivInner
variable {π E F : Type*} [RCLike π]
variable [NormedAddCommGroup E] [InnerProductSpace π E]
variable [NormedAddCommGroup F] [InnerProductSpace β F]
local notation "βͺ" x ", " y "β«" => @inner π _ _ x y
variable (π) [NormedSpace β E]
def fderivInnerCLM (p : E Γ E) : E Γ E βL[β] π :=
isBoundedBilinearMap_inner.deriv p
#align fderiv_inner_clm fderivInnerCLM
@[simp]
theorem fderivInnerCLM_apply (p x : E Γ E) : fderivInnerCLM π p x = βͺp.1, x.2β« + βͺx.1, p.2β« :=
rfl
#align fderiv_inner_clm_apply fderivInnerCLM_apply
variable {π} -- Porting note: Lean 3 magically switches back to `{π}` here
theorem contDiff_inner {n} : ContDiff β n fun p : E Γ E => βͺp.1, p.2β« :=
isBoundedBilinearMap_inner.contDiff
#align cont_diff_inner contDiff_inner
theorem contDiffAt_inner {p : E Γ E} {n} : ContDiffAt β n (fun p : E Γ E => βͺp.1, p.2β«) p :=
ContDiff.contDiffAt contDiff_inner
#align cont_diff_at_inner contDiffAt_inner
theorem differentiable_inner : Differentiable β fun p : E Γ E => βͺp.1, p.2β« :=
isBoundedBilinearMap_inner.differentiableAt
#align differentiable_inner differentiable_inner
variable (π)
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace β G] {f g : G β E} {f' g' : G βL[β] E}
{s : Set G} {x : G} {n : ββ}
theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt β n f s x) (hg : ContDiffWithinAt β n g s x) :
ContDiffWithinAt β n (fun x => βͺf x, g xβ«) s x :=
contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg)
#align cont_diff_within_at.inner ContDiffWithinAt.inner
nonrec theorem ContDiffAt.inner (hf : ContDiffAt β n f x) (hg : ContDiffAt β n g x) :
ContDiffAt β n (fun x => βͺf x, g xβ«) x :=
hf.inner π hg
#align cont_diff_at.inner ContDiffAt.inner
theorem ContDiffOn.inner (hf : ContDiffOn β n f s) (hg : ContDiffOn β n g s) :
ContDiffOn β n (fun x => βͺf x, g xβ«) s := fun x hx => (hf x hx).inner π (hg x hx)
#align cont_diff_on.inner ContDiffOn.inner
theorem ContDiff.inner (hf : ContDiff β n f) (hg : ContDiff β n g) :
ContDiff β n fun x => βͺf x, g xβ« :=
contDiff_inner.comp (hf.prod hg)
#align cont_diff.inner ContDiff.inner
theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x)
(hg : HasFDerivWithinAt g g' s x) :
HasFDerivWithinAt (fun t => βͺf t, g tβ«) ((fderivInnerCLM π (f x, g x)).comp <| f'.prod g') s
x :=
(isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg)
#align has_fderiv_within_at.inner HasFDerivWithinAt.inner
theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) :
HasStrictFDerivAt (fun t => βͺf t, g tβ«) ((fderivInnerCLM π (f x, g x)).comp <| f'.prod g') x :=
(isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg)
#align has_strict_fderiv_at.inner HasStrictFDerivAt.inner
theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) :
HasFDerivAt (fun t => βͺf t, g tβ«) ((fderivInnerCLM π (f x, g x)).comp <| f'.prod g') x :=
(isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg)
#align has_fderiv_at.inner HasFDerivAt.inner
| Mathlib/Analysis/InnerProductSpace/Calculus.lean | 109 | 112 | theorem HasDerivWithinAt.inner {f g : β β E} {f' g' : E} {s : Set β} {x : β}
(hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) :
HasDerivWithinAt (fun t => βͺf t, g tβ«) (βͺf x, g'β« + βͺf', g xβ«) s x := by |
simpa using (hf.hasFDerivWithinAt.inner π hg.hasFDerivWithinAt).hasDerivWithinAt
| 1 |
import Mathlib.Control.Applicative
import Mathlib.Control.Traversable.Basic
import Mathlib.Data.List.Forall2
import Mathlib.Data.Set.Functor
#align_import control.traversable.instances from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
universe u v
section Option
open Functor
variable {F G : Type u β Type u}
variable [Applicative F] [Applicative G]
variable [LawfulApplicative F] [LawfulApplicative G]
theorem Option.id_traverse {Ξ±} (x : Option Ξ±) : Option.traverse (pure : Ξ± β Id Ξ±) x = x := by
cases x <;> rfl
#align option.id_traverse Option.id_traverse
| Mathlib/Control/Traversable/Instances.lean | 35 | 38 | theorem Option.comp_traverse {Ξ± Ξ² Ξ³} (f : Ξ² β F Ξ³) (g : Ξ± β G Ξ²) (x : Option Ξ±) :
Option.traverse (Comp.mk β (f <$> Β·) β g) x =
Comp.mk (Option.traverse f <$> Option.traverse g x) := by |
cases x <;> simp! [functor_norm] <;> rfl
| 1 |
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {Ξ± : Type*}
namespace Set
section OrderedAddCommGroup
variable [OrderedAddCommGroup Ξ±] (a b c : Ξ±)
@[simp]
theorem preimage_const_add_Ici : (fun x => a + x) β»ΒΉ' Ici b = Ici (b - a) :=
ext fun _x => sub_le_iff_le_add'.symm
#align set.preimage_const_add_Ici Set.preimage_const_add_Ici
@[simp]
theorem preimage_const_add_Ioi : (fun x => a + x) β»ΒΉ' Ioi b = Ioi (b - a) :=
ext fun _x => sub_lt_iff_lt_add'.symm
#align set.preimage_const_add_Ioi Set.preimage_const_add_Ioi
@[simp]
theorem preimage_const_add_Iic : (fun x => a + x) β»ΒΉ' Iic b = Iic (b - a) :=
ext fun _x => le_sub_iff_add_le'.symm
#align set.preimage_const_add_Iic Set.preimage_const_add_Iic
@[simp]
theorem preimage_const_add_Iio : (fun x => a + x) β»ΒΉ' Iio b = Iio (b - a) :=
ext fun _x => lt_sub_iff_add_lt'.symm
#align set.preimage_const_add_Iio Set.preimage_const_add_Iio
@[simp]
theorem preimage_const_add_Icc : (fun x => a + x) β»ΒΉ' Icc b c = Icc (b - a) (c - a) := by
simp [β Ici_inter_Iic]
#align set.preimage_const_add_Icc Set.preimage_const_add_Icc
@[simp]
theorem preimage_const_add_Ico : (fun x => a + x) β»ΒΉ' Ico b c = Ico (b - a) (c - a) := by
simp [β Ici_inter_Iio]
#align set.preimage_const_add_Ico Set.preimage_const_add_Ico
@[simp]
theorem preimage_const_add_Ioc : (fun x => a + x) β»ΒΉ' Ioc b c = Ioc (b - a) (c - a) := by
simp [β Ioi_inter_Iic]
#align set.preimage_const_add_Ioc Set.preimage_const_add_Ioc
@[simp]
theorem preimage_const_add_Ioo : (fun x => a + x) β»ΒΉ' Ioo b c = Ioo (b - a) (c - a) := by
simp [β Ioi_inter_Iio]
#align set.preimage_const_add_Ioo Set.preimage_const_add_Ioo
@[simp]
theorem preimage_add_const_Ici : (fun x => x + a) β»ΒΉ' Ici b = Ici (b - a) :=
ext fun _x => sub_le_iff_le_add.symm
#align set.preimage_add_const_Ici Set.preimage_add_const_Ici
@[simp]
theorem preimage_add_const_Ioi : (fun x => x + a) β»ΒΉ' Ioi b = Ioi (b - a) :=
ext fun _x => sub_lt_iff_lt_add.symm
#align set.preimage_add_const_Ioi Set.preimage_add_const_Ioi
@[simp]
theorem preimage_add_const_Iic : (fun x => x + a) β»ΒΉ' Iic b = Iic (b - a) :=
ext fun _x => le_sub_iff_add_le.symm
#align set.preimage_add_const_Iic Set.preimage_add_const_Iic
@[simp]
theorem preimage_add_const_Iio : (fun x => x + a) β»ΒΉ' Iio b = Iio (b - a) :=
ext fun _x => lt_sub_iff_add_lt.symm
#align set.preimage_add_const_Iio Set.preimage_add_const_Iio
@[simp]
theorem preimage_add_const_Icc : (fun x => x + a) β»ΒΉ' Icc b c = Icc (b - a) (c - a) := by
simp [β Ici_inter_Iic]
#align set.preimage_add_const_Icc Set.preimage_add_const_Icc
@[simp]
theorem preimage_add_const_Ico : (fun x => x + a) β»ΒΉ' Ico b c = Ico (b - a) (c - a) := by
simp [β Ici_inter_Iio]
#align set.preimage_add_const_Ico Set.preimage_add_const_Ico
@[simp]
| Mathlib/Data/Set/Pointwise/Interval.lean | 202 | 203 | theorem preimage_add_const_Ioc : (fun x => x + a) β»ΒΉ' Ioc b c = Ioc (b - a) (c - a) := by |
simp [β Ioi_inter_Iic]
| 1 |
import Mathlib.Algebra.Homology.ShortComplex.ModuleCat
import Mathlib.RepresentationTheory.GroupCohomology.Basic
import Mathlib.RepresentationTheory.Invariants
universe v u
noncomputable section
open CategoryTheory Limits Representation
variable {k G : Type u} [CommRing k] [Group G] (A : Rep k G)
namespace groupCohomology
section IsMulCocycle
section
variable {G M : Type*} [Mul G] [CommGroup M] [SMul G M]
def IsMulOneCocycle (f : G β M) : Prop := β g h : G, f (g * h) = g β’ f h * f g
def IsMulTwoCocycle (f : G Γ G β M) : Prop :=
β g h j : G, f (g * h, j) * f (g, h) = g β’ (f (h, j)) * f (g, h * j)
end
section
variable {G M : Type*} [Monoid G] [CommGroup M] [MulAction G M]
theorem map_one_of_isMulOneCocycle {f : G β M} (hf : IsMulOneCocycle f) :
f 1 = 1 := by
simpa only [mul_one, one_smul, self_eq_mul_right] using hf 1 1
| Mathlib/RepresentationTheory/GroupCohomology/LowDegree.lean | 528 | 530 | theorem map_one_fst_of_isMulTwoCocycle {f : G Γ G β M} (hf : IsMulTwoCocycle f) (g : G) :
f (1, g) = f (1, 1) := by |
simpa only [one_smul, one_mul, mul_one, mul_right_inj] using (hf 1 1 g).symm
| 1 |
import Mathlib.Algebra.MonoidAlgebra.Support
import Mathlib.Algebra.Polynomial.Basic
import Mathlib.Algebra.Regular.Basic
import Mathlib.Data.Nat.Choose.Sum
#align_import data.polynomial.coeff from "leanprover-community/mathlib"@"2651125b48fc5c170ab1111afd0817c903b1fc6c"
set_option linter.uppercaseLean3 false
noncomputable section
open Finsupp Finset AddMonoidAlgebra
open Polynomial
namespace Polynomial
universe u v
variable {R : Type u} {S : Type v} {a b : R} {n m : β}
variable [Semiring R] {p q r : R[X]}
section Coeff
@[simp]
theorem coeff_add (p q : R[X]) (n : β) : coeff (p + q) n = coeff p n + coeff q n := by
rcases p with β¨β©
rcases q with β¨β©
simp_rw [β ofFinsupp_add, coeff]
exact Finsupp.add_apply _ _ _
#align polynomial.coeff_add Polynomial.coeff_add
set_option linter.deprecated false in
@[simp]
| Mathlib/Algebra/Polynomial/Coeff.lean | 49 | 49 | theorem coeff_bit0 (p : R[X]) (n : β) : coeff (bit0 p) n = bit0 (coeff p n) := by | simp [bit0]
| 1 |
import Batteries.Tactic.SeqFocus
namespace Batteries
class TotalBLE (le : Ξ± β Ξ± β Bool) : Prop where
total : le a b β¨ le b a
class OrientedCmp (cmp : Ξ± β Ξ± β Ordering) : Prop where
symm (x y) : (cmp x y).swap = cmp y x
class TransCmp (cmp : Ξ± β Ξ± β Ordering) extends OrientedCmp cmp : Prop where
le_trans : cmp x y β .gt β cmp y z β .gt β cmp x z β .gt
instance [inst : OrientedCmp cmp] : OrientedCmp (flip cmp) where
symm _ _ := inst.symm ..
instance [inst : TransCmp cmp] : TransCmp (flip cmp) where
le_trans h1 h2 := inst.le_trans h2 h1
class BEqCmp [BEq Ξ±] (cmp : Ξ± β Ξ± β Ordering) : Prop where
cmp_iff_beq : cmp x y = .eq β x == y
| .lake/packages/batteries/Batteries/Classes/Order.lean | 121 | 122 | theorem BEqCmp.cmp_iff_eq [BEq Ξ±] [LawfulBEq Ξ±] [BEqCmp (Ξ± := Ξ±) cmp] : cmp x y = .eq β x = y := by |
simp [BEqCmp.cmp_iff_beq]
| 1 |
import Mathlib.Order.Bounds.Basic
import Mathlib.Order.WellFounded
import Mathlib.Data.Set.Image
import Mathlib.Order.Interval.Set.Basic
import Mathlib.Data.Set.Lattice
#align_import order.conditionally_complete_lattice.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
open Function OrderDual Set
variable {Ξ± Ξ² Ξ³ : Type*} {ΞΉ : Sort*}
section
variable [Preorder Ξ±]
open scoped Classical
noncomputable instance WithTop.instSupSet [SupSet Ξ±] :
SupSet (WithTop Ξ±) :=
β¨fun S =>
if β€ β S then β€ else if BddAbove ((fun (a : Ξ±) β¦ βa) β»ΒΉ' S : Set Ξ±) then
β(sSup ((fun (a : Ξ±) β¦ (a : WithTop Ξ±)) β»ΒΉ' S : Set Ξ±)) else β€β©
noncomputable instance WithTop.instInfSet [InfSet Ξ±] : InfSet (WithTop Ξ±) :=
β¨fun S => if S β {β€} β¨ Β¬BddBelow S then β€ else β(sInf ((fun (a : Ξ±) β¦ βa) β»ΒΉ' S : Set Ξ±))β©
noncomputable instance WithBot.instSupSet [SupSet Ξ±] : SupSet (WithBot Ξ±) :=
β¨(WithTop.instInfSet (Ξ± := Ξ±α΅α΅)).sInfβ©
noncomputable instance WithBot.instInfSet [InfSet Ξ±] :
InfSet (WithBot Ξ±) :=
β¨(WithTop.instSupSet (Ξ± := Ξ±α΅α΅)).sSupβ©
theorem WithTop.sSup_eq [SupSet Ξ±] {s : Set (WithTop Ξ±)} (hs : β€ β s)
(hs' : BddAbove ((β) β»ΒΉ' s : Set Ξ±)) : sSup s = β(sSup ((β) β»ΒΉ' s) : Ξ±) :=
(if_neg hs).trans <| if_pos hs'
#align with_top.Sup_eq WithTop.sSup_eq
theorem WithTop.sInf_eq [InfSet Ξ±] {s : Set (WithTop Ξ±)} (hs : Β¬s β {β€}) (h's : BddBelow s) :
sInf s = β(sInf ((β) β»ΒΉ' s) : Ξ±) :=
if_neg <| by simp [hs, h's]
#align with_top.Inf_eq WithTop.sInf_eq
theorem WithBot.sInf_eq [InfSet Ξ±] {s : Set (WithBot Ξ±)} (hs : β₯ β s)
(hs' : BddBelow ((β) β»ΒΉ' s : Set Ξ±)) : sInf s = β(sInf ((β) β»ΒΉ' s) : Ξ±) :=
(if_neg hs).trans <| if_pos hs'
#align with_bot.Inf_eq WithBot.sInf_eq
theorem WithBot.sSup_eq [SupSet Ξ±] {s : Set (WithBot Ξ±)} (hs : Β¬s β {β₯}) (h's : BddAbove s) :
sSup s = β(sSup ((β) β»ΒΉ' s) : Ξ±) :=
WithTop.sInf_eq (Ξ± := Ξ±α΅α΅) hs h's
#align with_bot.Sup_eq WithBot.sSup_eq
@[simp]
theorem WithTop.sInf_empty [InfSet Ξ±] : sInf (β
: Set (WithTop Ξ±)) = β€ :=
if_pos <| by simp
#align with_top.cInf_empty WithTop.sInf_empty
@[simp]
theorem WithTop.iInf_empty [IsEmpty ΞΉ] [InfSet Ξ±] (f : ΞΉ β WithTop Ξ±) :
β¨
i, f i = β€ := by rw [iInf, range_eq_empty, WithTop.sInf_empty]
#align with_top.cinfi_empty WithTop.iInf_empty
theorem WithTop.coe_sInf' [InfSet Ξ±] {s : Set Ξ±} (hs : s.Nonempty) (h's : BddBelow s) :
β(sInf s) = (sInf ((fun (a : Ξ±) β¦ βa) '' s) : WithTop Ξ±) := by
obtain β¨x, hxβ© := hs
change _ = ite _ _ _
split_ifs with h
Β· rcases h with h1 | h2
Β· cases h1 (mem_image_of_mem _ hx)
Β· exact (h2 (Monotone.map_bddBelow coe_mono h's)).elim
Β· rw [preimage_image_eq]
exact Option.some_injective _
#align with_top.coe_Inf' WithTop.coe_sInf'
-- Porting note: the mathlib3 proof uses `range_comp` in the opposite direction and
-- does not need `rfl`.
@[norm_cast]
theorem WithTop.coe_iInf [Nonempty ΞΉ] [InfSet Ξ±] {f : ΞΉ β Ξ±} (hf : BddBelow (range f)) :
β(β¨
i, f i) = (β¨
i, f i : WithTop Ξ±) := by
rw [iInf, iInf, WithTop.coe_sInf' (range_nonempty f) hf, β range_comp]
rfl
#align with_top.coe_infi WithTop.coe_iInf
theorem WithTop.coe_sSup' [SupSet Ξ±] {s : Set Ξ±} (hs : BddAbove s) :
β(sSup s) = (sSup ((fun (a : Ξ±) β¦ βa) '' s) : WithTop Ξ±) := by
change _ = ite _ _ _
rw [if_neg, preimage_image_eq, if_pos hs]
Β· exact Option.some_injective _
Β· rintro β¨x, _, β¨β©β©
#align with_top.coe_Sup' WithTop.coe_sSup'
-- Porting note: the mathlib3 proof uses `range_comp` in the opposite direction and
-- does not need `rfl`.
@[norm_cast]
| Mathlib/Order/ConditionallyCompleteLattice/Basic.lean | 127 | 129 | theorem WithTop.coe_iSup [SupSet Ξ±] (f : ΞΉ β Ξ±) (h : BddAbove (Set.range f)) :
β(β¨ i, f i) = (β¨ i, f i : WithTop Ξ±) := by |
rw [iSup, iSup, WithTop.coe_sSup' h, β range_comp]; rfl
| 1 |
import Mathlib.LinearAlgebra.AffineSpace.AffineMap
import Mathlib.Tactic.FieldSimp
#align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
open AffineMap
variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE]
def slope (f : k β PE) (a b : k) : E :=
(b - a)β»ΒΉ β’ (f b -α΅₯ f a)
#align slope slope
theorem slope_fun_def (f : k β PE) : slope f = fun a b => (b - a)β»ΒΉ β’ (f b -α΅₯ f a) :=
rfl
#align slope_fun_def slope_fun_def
theorem slope_def_field (f : k β k) (a b : k) : slope f a b = (f b - f a) / (b - a) :=
(div_eq_inv_mul _ _).symm
#align slope_def_field slope_def_field
theorem slope_fun_def_field (f : k β k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) :=
(div_eq_inv_mul _ _).symm
#align slope_fun_def_field slope_fun_def_field
@[simp]
theorem slope_same (f : k β PE) (a : k) : (slope f a a : E) = 0 := by
rw [slope, sub_self, inv_zero, zero_smul]
#align slope_same slope_same
theorem slope_def_module (f : k β E) (a b : k) : slope f a b = (b - a)β»ΒΉ β’ (f b - f a) :=
rfl
#align slope_def_module slope_def_module
@[simp]
theorem sub_smul_slope (f : k β PE) (a b : k) : (b - a) β’ slope f a b = f b -α΅₯ f a := by
rcases eq_or_ne a b with (rfl | hne)
Β· rw [sub_self, zero_smul, vsub_self]
Β· rw [slope, smul_inv_smulβ (sub_ne_zero.2 hne.symm)]
#align sub_smul_slope sub_smul_slope
theorem sub_smul_slope_vadd (f : k β PE) (a b : k) : (b - a) β’ slope f a b +α΅₯ f a = f b := by
rw [sub_smul_slope, vsub_vadd]
#align sub_smul_slope_vadd sub_smul_slope_vadd
@[simp]
theorem slope_vadd_const (f : k β E) (c : PE) : (slope fun x => f x +α΅₯ c) = slope f := by
ext a b
simp only [slope, vadd_vsub_vadd_cancel_right, vsub_eq_sub]
#align slope_vadd_const slope_vadd_const
@[simp]
theorem slope_sub_smul (f : k β E) {a b : k} (h : a β b) :
slope (fun x => (x - a) β’ f x) a b = f b := by
simp [slope, inv_smul_smulβ (sub_ne_zero.2 h.symm)]
#align slope_sub_smul slope_sub_smul
| Mathlib/LinearAlgebra/AffineSpace/Slope.lean | 78 | 79 | theorem eq_of_slope_eq_zero {f : k β PE} {a b : k} (h : slope f a b = (0 : E)) : f a = f b := by |
rw [β sub_smul_slope_vadd f a b, h, smul_zero, zero_vadd]
| 1 |
import Batteries.Tactic.Alias
import Batteries.Data.Nat.Basic
namespace Nat
@[simp] theorem recAux_zero {motive : Nat β Sort _} (zero : motive 0)
(succ : β n, motive n β motive (n+1)) :
Nat.recAux zero succ 0 = zero := rfl
theorem recAux_succ {motive : Nat β Sort _} (zero : motive 0)
(succ : β n, motive n β motive (n+1)) (n) :
Nat.recAux zero succ (n+1) = succ n (Nat.recAux zero succ n) := rfl
@[simp] theorem recAuxOn_zero {motive : Nat β Sort _} (zero : motive 0)
(succ : β n, motive n β motive (n+1)) :
Nat.recAuxOn 0 zero succ = zero := rfl
theorem recAuxOn_succ {motive : Nat β Sort _} (zero : motive 0)
(succ : β n, motive n β motive (n+1)) (n) :
Nat.recAuxOn (n+1) zero succ = succ n (Nat.recAuxOn n zero succ) := rfl
@[simp] theorem casesAuxOn_zero {motive : Nat β Sort _} (zero : motive 0)
(succ : β n, motive (n+1)) :
Nat.casesAuxOn 0 zero succ = zero := rfl
theorem casesAuxOn_succ {motive : Nat β Sort _} (zero : motive 0)
(succ : β n, motive (n+1)) (n) :
Nat.casesAuxOn (n+1) zero succ = succ n := rfl
theorem strongRec_eq {motive : Nat β Sort _} (ind : β n, (β m, m < n β motive m) β motive n)
(t : Nat) : Nat.strongRec ind t = ind t fun m _ => Nat.strongRec ind m := by
conv => lhs; unfold Nat.strongRec
theorem strongRecOn_eq {motive : Nat β Sort _} (ind : β n, (β m, m < n β motive m) β motive n)
(t : Nat) : Nat.strongRecOn t ind = ind t fun m _ => Nat.strongRecOn m ind :=
Nat.strongRec_eq ..
@[simp] theorem recDiagAux_zero_left {motive : Nat β Nat β Sort _}
(zero_left : β n, motive 0 n) (zero_right : β m, motive m 0)
(succ_succ : β m n, motive m n β motive (m+1) (n+1)) (n) :
Nat.recDiagAux zero_left zero_right succ_succ 0 n = zero_left n := by cases n <;> rfl
@[simp] theorem recDiagAux_zero_right {motive : Nat β Nat β Sort _}
(zero_left : β n, motive 0 n) (zero_right : β m, motive m 0)
(succ_succ : β m n, motive m n β motive (m+1) (n+1)) (m)
(h : zero_left 0 = zero_right 0 := by first | assumption | trivial) :
Nat.recDiagAux zero_left zero_right succ_succ m 0 = zero_right m := by cases m; exact h; rfl
theorem recDiagAux_succ_succ {motive : Nat β Nat β Sort _}
(zero_left : β n, motive 0 n) (zero_right : β m, motive m 0)
(succ_succ : β m n, motive m n β motive (m+1) (n+1)) (m n) :
Nat.recDiagAux zero_left zero_right succ_succ (m+1) (n+1)
= succ_succ m n (Nat.recDiagAux zero_left zero_right succ_succ m n) := rfl
@[simp] theorem recDiag_zero_zero {motive : Nat β Nat β Sort _} (zero_zero : motive 0 0)
(zero_succ : β n, motive 0 n β motive 0 (n+1)) (succ_zero : β m, motive m 0 β motive (m+1) 0)
(succ_succ : β m n, motive m n β motive (m+1) (n+1)) :
Nat.recDiag (motive:=motive) zero_zero zero_succ succ_zero succ_succ 0 0 = zero_zero := rfl
| .lake/packages/batteries/Batteries/Data/Nat/Lemmas.lean | 74 | 79 | theorem recDiag_zero_succ {motive : Nat β Nat β Sort _} (zero_zero : motive 0 0)
(zero_succ : β n, motive 0 n β motive 0 (n+1)) (succ_zero : β m, motive m 0 β motive (m+1) 0)
(succ_succ : β m n, motive m n β motive (m+1) (n+1)) (n) :
Nat.recDiag zero_zero zero_succ succ_zero succ_succ 0 (n+1)
= zero_succ n (Nat.recDiag zero_zero zero_succ succ_zero succ_succ 0 n) := by |
simp [Nat.recDiag]; rfl
| 1 |
import Mathlib.Analysis.Calculus.ContDiff.Basic
import Mathlib.Analysis.Calculus.Deriv.Linear
import Mathlib.Analysis.Complex.Conformal
import Mathlib.Analysis.Calculus.Conformal.NormedSpace
#align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
section RealDerivOfComplex
open Complex
variable {e : β β β} {e' : β} {z : β}
theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) :
HasStrictDerivAt (fun x : β => (e x).re) e'.re z := by
have A : HasStrictFDerivAt ((β) : β β β) ofRealCLM z := ofRealCLM.hasStrictFDerivAt
have B :
HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β βL[β] β).restrictScalars β)
(ofRealCLM z) :=
h.hasStrictFDerivAt.restrictScalars β
have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt
-- Porting note: this should be by:
-- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt
-- but for some reason simp can not use `ContinuousLinearMap.comp_apply`
convert (C.comp z (B.comp z A)).hasStrictDerivAt
rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply]
simp
#align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex
theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) :
HasDerivAt (fun x : β => (e x).re) e'.re z := by
have A : HasFDerivAt ((β) : β β β) ofRealCLM z := ofRealCLM.hasFDerivAt
have B :
HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β βL[β] β).restrictScalars β)
(ofRealCLM z) :=
h.hasFDerivAt.restrictScalars β
have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt
-- Porting note: this should be by:
-- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt
-- but for some reason simp can not use `ContinuousLinearMap.comp_apply`
convert (C.comp z (B.comp z A)).hasDerivAt
rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply]
simp
#align has_deriv_at.real_of_complex HasDerivAt.real_of_complex
theorem ContDiffAt.real_of_complex {n : ββ} (h : ContDiffAt β n e z) :
ContDiffAt β n (fun x : β => (e x).re) z := by
have A : ContDiffAt β n ((β) : β β β) z := ofRealCLM.contDiff.contDiffAt
have B : ContDiffAt β n e z := h.restrict_scalars β
have C : ContDiffAt β n re (e z) := reCLM.contDiff.contDiffAt
exact C.comp z (B.comp z A)
#align cont_diff_at.real_of_complex ContDiffAt.real_of_complex
theorem ContDiff.real_of_complex {n : ββ} (h : ContDiff β n e) :
ContDiff β n fun x : β => (e x).re :=
contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex
#align cont_diff.real_of_complex ContDiff.real_of_complex
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E]
theorem HasStrictDerivAt.complexToReal_fderiv' {f : β β E} {x : β} {f' : E}
(h : HasStrictDerivAt f f' x) :
HasStrictFDerivAt f (reCLM.smulRight f' + I β’ imCLM.smulRight f') x := by
simpa only [Complex.restrictScalars_one_smulRight'] using
h.hasStrictFDerivAt.restrictScalars β
#align has_strict_deriv_at.complex_to_real_fderiv' HasStrictDerivAt.complexToReal_fderiv'
theorem HasDerivAt.complexToReal_fderiv' {f : β β E} {x : β} {f' : E} (h : HasDerivAt f f' x) :
HasFDerivAt f (reCLM.smulRight f' + I β’ imCLM.smulRight f') x := by
simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivAt.restrictScalars β
#align has_deriv_at.complex_to_real_fderiv' HasDerivAt.complexToReal_fderiv'
theorem HasDerivWithinAt.complexToReal_fderiv' {f : β β E} {s : Set β} {x : β} {f' : E}
(h : HasDerivWithinAt f f' s x) :
HasFDerivWithinAt f (reCLM.smulRight f' + I β’ imCLM.smulRight f') s x := by
simpa only [Complex.restrictScalars_one_smulRight'] using
h.hasFDerivWithinAt.restrictScalars β
#align has_deriv_within_at.complex_to_real_fderiv' HasDerivWithinAt.complexToReal_fderiv'
| Mathlib/Analysis/Complex/RealDeriv.lean | 118 | 120 | theorem HasStrictDerivAt.complexToReal_fderiv {f : β β β} {f' x : β} (h : HasStrictDerivAt f f' x) :
HasStrictFDerivAt f (f' β’ (1 : β βL[β] β)) x := by |
simpa only [Complex.restrictScalars_one_smulRight] using h.hasStrictFDerivAt.restrictScalars β
| 1 |
import Mathlib.LinearAlgebra.Quotient
import Mathlib.RingTheory.Ideal.Operations
namespace Submodule
open Pointwise
variable {R M M' F G : Type*} [CommRing R] [AddCommGroup M] [Module R M]
variable {N Nβ Nβ P Pβ Pβ : Submodule R M}
def colon (N P : Submodule R M) : Ideal R :=
annihilator (P.map N.mkQ)
#align submodule.colon Submodule.colon
theorem mem_colon {r} : r β N.colon P β β p β P, r β’ p β N :=
mem_annihilator.trans
β¨fun H p hp => (Quotient.mk_eq_zero N).1 (H (Quotient.mk p) (mem_map_of_mem hp)),
fun H _ β¨p, hp, hpmβ© => hpm βΈ ((Quotient.mk_eq_zero N).2 <| H p hp)β©
#align submodule.mem_colon Submodule.mem_colon
theorem mem_colon' {r} : r β N.colon P β P β€ comap (r β’ (LinearMap.id : M ββ[R] M)) N :=
mem_colon
#align submodule.mem_colon' Submodule.mem_colon'
@[simp]
theorem colon_top {I : Ideal R} : I.colon β€ = I := by
simp_rw [SetLike.ext_iff, mem_colon, smul_eq_mul]
exact fun x β¦ β¨fun h β¦ mul_one x βΈ h 1 trivial, fun h _ _ β¦ I.mul_mem_right _ hβ©
@[simp]
theorem colon_bot : colon β₯ N = N.annihilator := by
simp_rw [SetLike.ext_iff, mem_colon, mem_annihilator, mem_bot, forall_const]
theorem colon_mono (hn : Nβ β€ Nβ) (hp : Pβ β€ Pβ) : Nβ.colon Pβ β€ Nβ.colon Pβ := fun _ hrnp =>
mem_colon.2 fun pβ hpβ => hn <| mem_colon.1 hrnp pβ <| hp hpβ
#align submodule.colon_mono Submodule.colon_mono
theorem iInf_colon_iSup (ΞΉβ : Sort*) (f : ΞΉβ β Submodule R M) (ΞΉβ : Sort*)
(g : ΞΉβ β Submodule R M) : (β¨
i, f i).colon (β¨ j, g j) = β¨
(i) (j), (f i).colon (g j) :=
le_antisymm (le_iInf fun _ => le_iInf fun _ => colon_mono (iInf_le _ _) (le_iSup _ _)) fun _ H =>
mem_colon'.2 <|
iSup_le fun j =>
map_le_iff_le_comap.1 <|
le_iInf fun i =>
map_le_iff_le_comap.2 <|
mem_colon'.1 <|
have := (mem_iInf _).1 H i
have := (mem_iInf _).1 this j
this
#align submodule.infi_colon_supr Submodule.iInf_colon_iSup
@[simp]
theorem mem_colon_singleton {N : Submodule R M} {x : M} {r : R} :
r β N.colon (Submodule.span R {x}) β r β’ x β N :=
calc
r β N.colon (Submodule.span R {x}) β β a : R, r β’ a β’ x β N := by
simp [Submodule.mem_colon, Submodule.mem_span_singleton]
_ β r β’ x β N := by simp_rw [fun (a : R) β¦ smul_comm r a x]; exact SetLike.forall_smul_mem_iff
#align submodule.mem_colon_singleton Submodule.mem_colon_singleton
@[simp]
| Mathlib/RingTheory/Ideal/Colon.lean | 76 | 78 | theorem _root_.Ideal.mem_colon_singleton {I : Ideal R} {x r : R} :
r β I.colon (Ideal.span {x}) β r * x β I := by |
simp only [β Ideal.submodule_span_eq, Submodule.mem_colon_singleton, smul_eq_mul]
| 1 |
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Data.Finite.Card
import Mathlib.GroupTheory.Finiteness
import Mathlib.GroupTheory.GroupAction.Quotient
#align_import group_theory.index from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
namespace Subgroup
open Cardinal
variable {G : Type*} [Group G] (H K L : Subgroup G)
@[to_additive "The index of a subgroup as a natural number,
and returns 0 if the index is infinite."]
noncomputable def index : β :=
Nat.card (G β§Έ H)
#align subgroup.index Subgroup.index
#align add_subgroup.index AddSubgroup.index
@[to_additive "The relative index of a subgroup as a natural number,
and returns 0 if the relative index is infinite."]
noncomputable def relindex : β :=
(H.subgroupOf K).index
#align subgroup.relindex Subgroup.relindex
#align add_subgroup.relindex AddSubgroup.relindex
@[to_additive]
theorem index_comap_of_surjective {G' : Type*} [Group G'] {f : G' β* G}
(hf : Function.Surjective f) : (H.comap f).index = H.index := by
letI := QuotientGroup.leftRel H
letI := QuotientGroup.leftRel (H.comap f)
have key : β x y : G', Setoid.r x y β Setoid.r (f x) (f y) := by
simp only [QuotientGroup.leftRel_apply]
exact fun x y => iff_of_eq (congr_arg (Β· β H) (by rw [f.map_mul, f.map_inv]))
refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map' f fun x y => (key x y).mp) β¨?_, ?_β©)
Β· simp_rw [β Quotient.eq''] at key
refine Quotient.ind' fun x => ?_
refine Quotient.ind' fun y => ?_
exact (key x y).mpr
Β· refine Quotient.ind' fun x => ?_
obtain β¨y, hyβ© := hf x
exact β¨y, (Quotient.map'_mk'' f _ y).trans (congr_arg Quotient.mk'' hy)β©
#align subgroup.index_comap_of_surjective Subgroup.index_comap_of_surjective
#align add_subgroup.index_comap_of_surjective AddSubgroup.index_comap_of_surjective
@[to_additive]
theorem index_comap {G' : Type*} [Group G'] (f : G' β* G) :
(H.comap f).index = H.relindex f.range :=
Eq.trans (congr_arg index (by rfl))
((H.subgroupOf f.range).index_comap_of_surjective f.rangeRestrict_surjective)
#align subgroup.index_comap Subgroup.index_comap
#align add_subgroup.index_comap AddSubgroup.index_comap
@[to_additive]
theorem relindex_comap {G' : Type*} [Group G'] (f : G' β* G) (K : Subgroup G') :
relindex (comap f H) K = relindex H (map f K) := by
rw [relindex, subgroupOf, comap_comap, index_comap, β f.map_range, K.subtype_range]
#align subgroup.relindex_comap Subgroup.relindex_comap
#align add_subgroup.relindex_comap AddSubgroup.relindex_comap
variable {H K L}
@[to_additive relindex_mul_index]
theorem relindex_mul_index (h : H β€ K) : H.relindex K * K.index = H.index :=
((mul_comm _ _).trans (Cardinal.toNat_mul _ _).symm).trans
(congr_arg Cardinal.toNat (Equiv.cardinal_eq (quotientEquivProdOfLE h))).symm
#align subgroup.relindex_mul_index Subgroup.relindex_mul_index
#align add_subgroup.relindex_mul_index AddSubgroup.relindex_mul_index
@[to_additive]
theorem index_dvd_of_le (h : H β€ K) : K.index β£ H.index :=
dvd_of_mul_left_eq (H.relindex K) (relindex_mul_index h)
#align subgroup.index_dvd_of_le Subgroup.index_dvd_of_le
#align add_subgroup.index_dvd_of_le AddSubgroup.index_dvd_of_le
@[to_additive]
theorem relindex_dvd_index_of_le (h : H β€ K) : H.relindex K β£ H.index :=
dvd_of_mul_right_eq K.index (relindex_mul_index h)
#align subgroup.relindex_dvd_index_of_le Subgroup.relindex_dvd_index_of_le
#align add_subgroup.relindex_dvd_index_of_le AddSubgroup.relindex_dvd_index_of_le
@[to_additive]
theorem relindex_subgroupOf (hKL : K β€ L) :
(H.subgroupOf L).relindex (K.subgroupOf L) = H.relindex K :=
((index_comap (H.subgroupOf L) (inclusion hKL)).trans (congr_arg _ (inclusion_range hKL))).symm
#align subgroup.relindex_subgroup_of Subgroup.relindex_subgroupOf
#align add_subgroup.relindex_add_subgroup_of AddSubgroup.relindex_addSubgroupOf
variable (H K L)
@[to_additive relindex_mul_relindex]
theorem relindex_mul_relindex (hHK : H β€ K) (hKL : K β€ L) :
H.relindex K * K.relindex L = H.relindex L := by
rw [β relindex_subgroupOf hKL]
exact relindex_mul_index fun x hx => hHK hx
#align subgroup.relindex_mul_relindex Subgroup.relindex_mul_relindex
#align add_subgroup.relindex_mul_relindex AddSubgroup.relindex_mul_relindex
@[to_additive]
theorem inf_relindex_right : (H β K).relindex K = H.relindex K := by
rw [relindex, relindex, inf_subgroupOf_right]
#align subgroup.inf_relindex_right Subgroup.inf_relindex_right
#align add_subgroup.inf_relindex_right AddSubgroup.inf_relindex_right
@[to_additive]
| Mathlib/GroupTheory/Index.lean | 140 | 141 | theorem inf_relindex_left : (H β K).relindex H = K.relindex H := by |
rw [inf_comm, inf_relindex_right]
| 1 |
import Mathlib.Data.Fintype.Card
import Mathlib.Order.UpperLower.Basic
#align_import combinatorics.set_family.intersecting from "leanprover-community/mathlib"@"d90e4e186f1d18e375dcd4e5b5f6364b01cb3e46"
open Finset
variable {Ξ± : Type*}
namespace Set
section SemilatticeInf
variable [SemilatticeInf Ξ±] [OrderBot Ξ±] {s t : Set Ξ±} {a b c : Ξ±}
def Intersecting (s : Set Ξ±) : Prop :=
β β¦aβ¦, a β s β β β¦bβ¦, b β s β Β¬Disjoint a b
#align set.intersecting Set.Intersecting
@[mono]
theorem Intersecting.mono (h : t β s) (hs : s.Intersecting) : t.Intersecting := fun _a ha _b hb =>
hs (h ha) (h hb)
#align set.intersecting.mono Set.Intersecting.mono
theorem Intersecting.not_bot_mem (hs : s.Intersecting) : β₯ β s := fun h => hs h h disjoint_bot_left
#align set.intersecting.not_bot_mem Set.Intersecting.not_bot_mem
theorem Intersecting.ne_bot (hs : s.Intersecting) (ha : a β s) : a β β₯ :=
ne_of_mem_of_not_mem ha hs.not_bot_mem
#align set.intersecting.ne_bot Set.Intersecting.ne_bot
theorem intersecting_empty : (β
: Set Ξ±).Intersecting := fun _ => False.elim
#align set.intersecting_empty Set.intersecting_empty
@[simp]
| Mathlib/Combinatorics/SetFamily/Intersecting.lean | 61 | 61 | theorem intersecting_singleton : ({a} : Set Ξ±).Intersecting β a β β₯ := by | simp [Intersecting]
| 1 |
import Mathlib.Tactic.CategoryTheory.Coherence
import Mathlib.CategoryTheory.Monoidal.Free.Coherence
#align_import category_theory.monoidal.coherence_lemmas from "leanprover-community/mathlib"@"b8b8bf3ea0c625fa1f950034a184e07c67f7bcfe"
open CategoryTheory Category Iso
namespace CategoryTheory.MonoidalCategory
variable {C : Type*} [Category C] [MonoidalCategory C]
-- See Proposition 2.2.4 of <http://www-math.mit.edu/~etingof/egnobookfinal.pdf>
@[reassoc]
theorem leftUnitor_tensor'' (X Y : C) :
(Ξ±_ (π_ C) X Y).hom β« (Ξ»_ (X β Y)).hom = (Ξ»_ X).hom β π Y := by
coherence
#align category_theory.monoidal_category.left_unitor_tensor' CategoryTheory.MonoidalCategory.leftUnitor_tensor''
@[reassoc]
theorem leftUnitor_tensor' (X Y : C) :
(Ξ»_ (X β Y)).hom = (Ξ±_ (π_ C) X Y).inv β« ((Ξ»_ X).hom β π Y) := by
coherence
#align category_theory.monoidal_category.left_unitor_tensor CategoryTheory.MonoidalCategory.leftUnitor_tensor'
@[reassoc]
theorem leftUnitor_tensor_inv' (X Y : C) :
(Ξ»_ (X β Y)).inv = ((Ξ»_ X).inv β π Y) β« (Ξ±_ (π_ C) X Y).hom := by coherence
#align category_theory.monoidal_category.left_unitor_tensor_inv CategoryTheory.MonoidalCategory.leftUnitor_tensor_inv'
@[reassoc]
theorem id_tensor_rightUnitor_inv (X Y : C) : π X β (Ο_ Y).inv = (Ο_ _).inv β« (Ξ±_ _ _ _).hom := by
coherence
#align category_theory.monoidal_category.id_tensor_right_unitor_inv CategoryTheory.MonoidalCategory.id_tensor_rightUnitor_inv
@[reassoc]
theorem leftUnitor_inv_tensor_id (X Y : C) : (Ξ»_ X).inv β π Y = (Ξ»_ _).inv β« (Ξ±_ _ _ _).inv := by
coherence
#align category_theory.monoidal_category.left_unitor_inv_tensor_id CategoryTheory.MonoidalCategory.leftUnitor_inv_tensor_id
@[reassoc]
| Mathlib/CategoryTheory/Monoidal/CoherenceLemmas.lean | 57 | 60 | theorem pentagon_inv_inv_hom (W X Y Z : C) :
(Ξ±_ W (X β Y) Z).inv β« ((Ξ±_ W X Y).inv β π Z) β« (Ξ±_ (W β X) Y Z).hom =
(π W β (Ξ±_ X Y Z).hom) β« (Ξ±_ W X (Y β Z)).inv := by |
coherence
| 1 |
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]
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]
#align measure_theory.with_densityα΅₯_neg MeasureTheory.withDensityα΅₯_neg
theorem withDensityα΅₯_neg' : (ΞΌ.withDensityα΅₯ fun x => -f x) = -ΞΌ.withDensityα΅₯ f :=
withDensityα΅₯_neg
#align measure_theory.with_densityα΅₯_neg' MeasureTheory.withDensityα΅₯_neg'
@[simp]
theorem withDensityα΅₯_add (hf : Integrable f ΞΌ) (hg : Integrable g ΞΌ) :
ΞΌ.withDensityα΅₯ (f + g) = ΞΌ.withDensityα΅₯ f + ΞΌ.withDensityα΅₯ g := by
ext1 i hi
rw [withDensityα΅₯_apply (hf.add hg) hi, VectorMeasure.add_apply, withDensityα΅₯_apply hf hi,
withDensityα΅₯_apply hg hi]
simp_rw [Pi.add_apply]
rw [integral_add] <;> rw [β integrableOn_univ]
Β· exact hf.integrableOn.restrict MeasurableSet.univ
Β· exact hg.integrableOn.restrict MeasurableSet.univ
#align measure_theory.with_densityα΅₯_add MeasureTheory.withDensityα΅₯_add
theorem withDensityα΅₯_add' (hf : Integrable f ΞΌ) (hg : Integrable g ΞΌ) :
(ΞΌ.withDensityα΅₯ fun x => f x + g x) = ΞΌ.withDensityα΅₯ f + ΞΌ.withDensityα΅₯ g :=
withDensityα΅₯_add hf hg
#align measure_theory.with_densityα΅₯_add' MeasureTheory.withDensityα΅₯_add'
@[simp]
| Mathlib/MeasureTheory/Measure/WithDensityVectorMeasure.lean | 101 | 103 | theorem withDensityα΅₯_sub (hf : Integrable f ΞΌ) (hg : Integrable g ΞΌ) :
ΞΌ.withDensityα΅₯ (f - g) = ΞΌ.withDensityα΅₯ f - ΞΌ.withDensityα΅₯ g := by |
rw [sub_eq_add_neg, sub_eq_add_neg, withDensityα΅₯_add hf hg.neg, withDensityα΅₯_neg]
| 1 |
import Mathlib.Algebra.Polynomial.Eval
import Mathlib.RingTheory.Ideal.Quotient
#align_import linear_algebra.smodeq from "leanprover-community/mathlib"@"146d3d1fa59c091fedaad8a4afa09d6802886d24"
open Submodule
open Polynomial
variable {R : Type*} [Ring R]
variable {A : Type*} [CommRing A]
variable {M : Type*} [AddCommGroup M] [Module R M] (U Uβ Uβ : Submodule R M)
variable {x xβ xβ y yβ yβ z zβ zβ : M}
variable {N : Type*} [AddCommGroup N] [Module R N] (V Vβ Vβ : Submodule R N)
set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534
def SModEq (x y : M) : Prop :=
(Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y
#align smodeq SModEq
notation:50 x " β‘ " y " [SMOD " N "]" => SModEq N x y
variable {U Uβ Uβ}
set_option backward.isDefEq.lazyWhnfCore false in -- See https://github.com/leanprover-community/mathlib4/issues/12534
protected theorem SModEq.def :
x β‘ y [SMOD U] β (Submodule.Quotient.mk x : M β§Έ U) = Submodule.Quotient.mk y :=
Iff.rfl
#align smodeq.def SModEq.def
namespace SModEq
| Mathlib/LinearAlgebra/SModEq.lean | 44 | 44 | theorem sub_mem : x β‘ y [SMOD U] β x - y β U := by | rw [SModEq.def, Submodule.Quotient.eq]
| 1 |
import Mathlib.Algebra.Order.Group.Abs
import Mathlib.Algebra.Order.Group.Basic
import Mathlib.Algebra.Order.Group.OrderIso
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Data.Int.Cast.Lemmas
import Mathlib.Order.Interval.Set.Basic
import Mathlib.Logic.Pairwise
#align_import data.set.intervals.group from "leanprover-community/mathlib"@"c227d107bbada5d0d9d20287e3282c0a7f1651a0"
variable {Ξ± : Type*}
namespace Set
section PairwiseDisjoint
section OrderedCommGroup
variable [OrderedCommGroup Ξ±] (a b : Ξ±)
@[to_additive]
theorem pairwise_disjoint_Ioc_mul_zpow :
Pairwise (Disjoint on fun n : β€ => Ioc (a * b ^ n) (a * b ^ (n + 1))) := by
simp (config := { unfoldPartialApp := true }) only [Function.onFun]
simp_rw [Set.disjoint_iff]
intro m n hmn x hx
apply hmn
have hb : 1 < b := by
have : a * b ^ m < a * b ^ (m + 1) := hx.1.1.trans_le hx.1.2
rwa [mul_lt_mul_iff_left, β mul_one (b ^ m), zpow_add_one, mul_lt_mul_iff_left] at this
have i1 := hx.1.1.trans_le hx.2.2
have i2 := hx.2.1.trans_le hx.1.2
rw [mul_lt_mul_iff_left, zpow_lt_zpow_iff hb, Int.lt_add_one_iff] at i1 i2
exact le_antisymm i1 i2
#align set.pairwise_disjoint_Ioc_mul_zpow Set.pairwise_disjoint_Ioc_mul_zpow
#align set.pairwise_disjoint_Ioc_add_zsmul Set.pairwise_disjoint_Ioc_add_zsmul
@[to_additive]
theorem pairwise_disjoint_Ico_mul_zpow :
Pairwise (Disjoint on fun n : β€ => Ico (a * b ^ n) (a * b ^ (n + 1))) := by
simp (config := { unfoldPartialApp := true }) only [Function.onFun]
simp_rw [Set.disjoint_iff]
intro m n hmn x hx
apply hmn
have hb : 1 < b := by
have : a * b ^ m < a * b ^ (m + 1) := hx.1.1.trans_lt hx.1.2
rwa [mul_lt_mul_iff_left, β mul_one (b ^ m), zpow_add_one, mul_lt_mul_iff_left] at this
have i1 := hx.1.1.trans_lt hx.2.2
have i2 := hx.2.1.trans_lt hx.1.2
rw [mul_lt_mul_iff_left, zpow_lt_zpow_iff hb, Int.lt_add_one_iff] at i1 i2
exact le_antisymm i1 i2
#align set.pairwise_disjoint_Ico_mul_zpow Set.pairwise_disjoint_Ico_mul_zpow
#align set.pairwise_disjoint_Ico_add_zsmul Set.pairwise_disjoint_Ico_add_zsmul
@[to_additive]
theorem pairwise_disjoint_Ioo_mul_zpow :
Pairwise (Disjoint on fun n : β€ => Ioo (a * b ^ n) (a * b ^ (n + 1))) := fun _ _ hmn =>
(pairwise_disjoint_Ioc_mul_zpow a b hmn).mono Ioo_subset_Ioc_self Ioo_subset_Ioc_self
#align set.pairwise_disjoint_Ioo_mul_zpow Set.pairwise_disjoint_Ioo_mul_zpow
#align set.pairwise_disjoint_Ioo_add_zsmul Set.pairwise_disjoint_Ioo_add_zsmul
@[to_additive]
theorem pairwise_disjoint_Ioc_zpow :
Pairwise (Disjoint on fun n : β€ => Ioc (b ^ n) (b ^ (n + 1))) := by
simpa only [one_mul] using pairwise_disjoint_Ioc_mul_zpow 1 b
#align set.pairwise_disjoint_Ioc_zpow Set.pairwise_disjoint_Ioc_zpow
#align set.pairwise_disjoint_Ioc_zsmul Set.pairwise_disjoint_Ioc_zsmul
@[to_additive]
theorem pairwise_disjoint_Ico_zpow :
Pairwise (Disjoint on fun n : β€ => Ico (b ^ n) (b ^ (n + 1))) := by
simpa only [one_mul] using pairwise_disjoint_Ico_mul_zpow 1 b
#align set.pairwise_disjoint_Ico_zpow Set.pairwise_disjoint_Ico_zpow
#align set.pairwise_disjoint_Ico_zsmul Set.pairwise_disjoint_Ico_zsmul
@[to_additive]
| Mathlib/Algebra/Order/Interval/Set/Group.lean | 226 | 228 | theorem pairwise_disjoint_Ioo_zpow :
Pairwise (Disjoint on fun n : β€ => Ioo (b ^ n) (b ^ (n + 1))) := by |
simpa only [one_mul] using pairwise_disjoint_Ioo_mul_zpow 1 b
| 1 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.BigOperators.NatAntidiagonal
import Mathlib.Algebra.CharZero.Lemmas
import Mathlib.Data.Finset.NatAntidiagonal
import Mathlib.Data.Nat.Choose.Central
import Mathlib.Data.Tree.Basic
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.GCongr
import Mathlib.Tactic.Positivity
#align_import combinatorics.catalan from "leanprover-community/mathlib"@"26b40791e4a5772a4e53d0e28e4df092119dc7da"
open Finset
open Finset.antidiagonal (fst_le snd_le)
def catalan : β β β
| 0 => 1
| n + 1 =>
β i : Fin n.succ,
catalan i * catalan (n - i)
#align catalan catalan
@[simp]
theorem catalan_zero : catalan 0 = 1 := by rw [catalan]
#align catalan_zero catalan_zero
| Mathlib/Combinatorics/Enumerative/Catalan.lean | 68 | 69 | theorem catalan_succ (n : β) : catalan (n + 1) = β i : Fin n.succ, catalan i * catalan (n - i) := by |
rw [catalan]
| 1 |
import Mathlib.Data.Finsupp.Encodable
import Mathlib.LinearAlgebra.Pi
import Mathlib.LinearAlgebra.Span
import Mathlib.Data.Set.Countable
#align_import linear_algebra.finsupp from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Set LinearMap Submodule
namespace Finsupp
variable {Ξ± : Type*} {M : Type*} {N : Type*} {P : Type*} {R : Type*} {S : Type*}
variable [Semiring R] [Semiring S] [AddCommMonoid M] [Module R M]
variable [AddCommMonoid N] [Module R N]
variable [AddCommMonoid P] [Module R P]
def lsingle (a : Ξ±) : M ββ[R] Ξ± ββ M :=
{ Finsupp.singleAddHom a with map_smul' := fun _ _ => (smul_single _ _ _).symm }
#align finsupp.lsingle Finsupp.lsingle
theorem lhom_ext β¦Ο Ο : (Ξ± ββ M) ββ[R] Nβ¦ (h : β a b, Ο (single a b) = Ο (single a b)) : Ο = Ο :=
LinearMap.toAddMonoidHom_injective <| addHom_ext h
#align finsupp.lhom_ext Finsupp.lhom_ext
-- Porting note: The priority should be higher than `LinearMap.ext`.
@[ext high]
theorem lhom_ext' β¦Ο Ο : (Ξ± ββ M) ββ[R] Nβ¦ (h : β a, Ο.comp (lsingle a) = Ο.comp (lsingle a)) :
Ο = Ο :=
lhom_ext fun a => LinearMap.congr_fun (h a)
#align finsupp.lhom_ext' Finsupp.lhom_ext'
def lapply (a : Ξ±) : (Ξ± ββ M) ββ[R] M :=
{ Finsupp.applyAddHom a with map_smul' := fun _ _ => rfl }
#align finsupp.lapply Finsupp.lapply
@[simps]
def lcoeFun : (Ξ± ββ M) ββ[R] Ξ± β M where
toFun := (β)
map_add' x y := by
ext
simp
map_smul' x y := by
ext
simp
#align finsupp.lcoe_fun Finsupp.lcoeFun
@[simp]
theorem lsingle_apply (a : Ξ±) (b : M) : (lsingle a : M ββ[R] Ξ± ββ M) b = single a b :=
rfl
#align finsupp.lsingle_apply Finsupp.lsingle_apply
@[simp]
theorem lapply_apply (a : Ξ±) (f : Ξ± ββ M) : (lapply a : (Ξ± ββ M) ββ[R] M) f = f a :=
rfl
#align finsupp.lapply_apply Finsupp.lapply_apply
@[simp]
theorem lapply_comp_lsingle_same (a : Ξ±) : lapply a ββ lsingle a = (.id : M ββ[R] M) := by ext; simp
@[simp]
| Mathlib/LinearAlgebra/Finsupp.lean | 237 | 238 | theorem lapply_comp_lsingle_of_ne (a a' : Ξ±) (h : a β a') :
lapply a ββ lsingle a' = (0 : M ββ[R] M) := by | ext; simp [h.symm]
| 1 |
import Mathlib.Algebra.Module.Submodule.Map
#align_import linear_algebra.basic from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
open Function
open Pointwise
variable {R : Type*} {Rβ : Type*} {Rβ : Type*} {Rβ : Type*}
variable {K : Type*}
variable {M : Type*} {Mβ : Type*} {Mβ : Type*} {Mβ : Type*}
variable {V : Type*} {Vβ : Type*}
namespace LinearMap
section AddCommMonoid
variable [Semiring R] [Semiring Rβ] [Semiring Rβ]
variable [AddCommMonoid M] [AddCommMonoid Mβ] [AddCommMonoid Mβ]
variable {Οββ : R β+* Rβ} {Οββ : Rβ β+* Rβ} {Οββ : R β+* Rβ}
variable [RingHomCompTriple Οββ Οββ Οββ]
variable [Module R M] [Module Rβ Mβ] [Module Rβ Mβ]
open Submodule
variable {Οββ : Rβ β+* R} {Οββ : R β+* Rβ} {Οββ : Rβ β+* Rβ} {Οββ : R β+* Rβ}
variable [RingHomCompTriple Οββ Οββ Οββ]
variable {F : Type*} [FunLike F M Mβ] [SemilinearMapClass F Οββ M Mβ]
def ker (f : F) : Submodule R M :=
comap f β₯
#align linear_map.ker LinearMap.ker
@[simp]
theorem mem_ker {f : F} {y} : y β ker f β f y = 0 :=
mem_bot Rβ
#align linear_map.mem_ker LinearMap.mem_ker
@[simp]
theorem ker_id : ker (LinearMap.id : M ββ[R] M) = β₯ :=
rfl
#align linear_map.ker_id LinearMap.ker_id
@[simp]
theorem map_coe_ker (f : F) (x : ker f) : f x = 0 :=
mem_ker.1 x.2
#align linear_map.map_coe_ker LinearMap.map_coe_ker
theorem ker_toAddSubmonoid (f : M βββ[Οββ] Mβ) : f.ker.toAddSubmonoid = (AddMonoidHom.mker f) :=
rfl
#align linear_map.ker_to_add_submonoid LinearMap.ker_toAddSubmonoid
theorem comp_ker_subtype (f : M βββ[Οββ] Mβ) : f.comp f.ker.subtype = 0 :=
LinearMap.ext fun x => mem_ker.1 x.2
#align linear_map.comp_ker_subtype LinearMap.comp_ker_subtype
theorem ker_comp (f : M βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
ker (g.comp f : M βββ[Οββ] Mβ) = comap f (ker g) :=
rfl
#align linear_map.ker_comp LinearMap.ker_comp
theorem ker_le_ker_comp (f : M βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
ker f β€ ker (g.comp f : M βββ[Οββ] Mβ) := by rw [ker_comp]; exact comap_mono bot_le
#align linear_map.ker_le_ker_comp LinearMap.ker_le_ker_comp
theorem ker_sup_ker_le_ker_comp_of_commute {f g : M ββ[R] M} (h : Commute f g) :
ker f β ker g β€ ker (f ββ g) := by
refine sup_le_iff.mpr β¨?_, ker_le_ker_comp g fβ©
rw [β mul_eq_comp, h.eq, mul_eq_comp]
exact ker_le_ker_comp f g
@[simp]
theorem ker_le_comap {p : Submodule Rβ Mβ} (f : M βββ[Οββ] Mβ) :
ker f β€ p.comap f :=
fun x hx β¦ by simp [mem_ker.mp hx]
theorem disjoint_ker {f : F} {p : Submodule R M} :
Disjoint p (ker f) β β x β p, f x = 0 β x = 0 := by
simp [disjoint_def]
#align linear_map.disjoint_ker LinearMap.disjoint_ker
theorem ker_eq_bot' {f : F} : ker f = β₯ β β m, f m = 0 β m = 0 := by
simpa [disjoint_iff_inf_le] using disjoint_ker (f := f) (p := β€)
#align linear_map.ker_eq_bot' LinearMap.ker_eq_bot'
theorem ker_eq_bot_of_inverse {Οββ : Rβ β+* R} [RingHomInvPair Οββ Οββ] {f : M βββ[Οββ] Mβ}
{g : Mβ βββ[Οββ] M} (h : (g.comp f : M ββ[R] M) = id) : ker f = β₯ :=
ker_eq_bot'.2 fun m hm => by rw [β id_apply (R := R) m, β h, comp_apply, hm, g.map_zero]
#align linear_map.ker_eq_bot_of_inverse LinearMap.ker_eq_bot_of_inverse
theorem le_ker_iff_map [RingHomSurjective Οββ] {f : F} {p : Submodule R M} :
p β€ ker f β map f p = β₯ := by rw [ker, eq_bot_iff, map_le_iff_le_comap]
#align linear_map.le_ker_iff_map LinearMap.le_ker_iff_map
| Mathlib/Algebra/Module/Submodule/Ker.lean | 125 | 126 | theorem ker_codRestrict {Οββ : Rβ β+* R} (p : Submodule R M) (f : Mβ βββ[Οββ] M) (hf) :
ker (codRestrict p f hf) = ker f := by | rw [ker, comap_codRestrict, Submodule.map_bot]; rfl
| 1 |
import Mathlib.Order.Interval.Set.Basic
import Mathlib.Order.Hom.Set
#align_import data.set.intervals.order_iso from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
open Set
namespace OrderIso
section Preorder
variable {Ξ± Ξ² : Type*} [Preorder Ξ±] [Preorder Ξ²]
@[simp]
theorem preimage_Iic (e : Ξ± βo Ξ²) (b : Ξ²) : e β»ΒΉ' Iic b = Iic (e.symm b) := by
ext x
simp [β e.le_iff_le]
#align order_iso.preimage_Iic OrderIso.preimage_Iic
@[simp]
theorem preimage_Ici (e : Ξ± βo Ξ²) (b : Ξ²) : e β»ΒΉ' Ici b = Ici (e.symm b) := by
ext x
simp [β e.le_iff_le]
#align order_iso.preimage_Ici OrderIso.preimage_Ici
@[simp]
theorem preimage_Iio (e : Ξ± βo Ξ²) (b : Ξ²) : e β»ΒΉ' Iio b = Iio (e.symm b) := by
ext x
simp [β e.lt_iff_lt]
#align order_iso.preimage_Iio OrderIso.preimage_Iio
@[simp]
theorem preimage_Ioi (e : Ξ± βo Ξ²) (b : Ξ²) : e β»ΒΉ' Ioi b = Ioi (e.symm b) := by
ext x
simp [β e.lt_iff_lt]
#align order_iso.preimage_Ioi OrderIso.preimage_Ioi
@[simp]
theorem preimage_Icc (e : Ξ± βo Ξ²) (a b : Ξ²) : e β»ΒΉ' Icc a b = Icc (e.symm a) (e.symm b) := by
simp [β Ici_inter_Iic]
#align order_iso.preimage_Icc OrderIso.preimage_Icc
@[simp]
theorem preimage_Ico (e : Ξ± βo Ξ²) (a b : Ξ²) : e β»ΒΉ' Ico a b = Ico (e.symm a) (e.symm b) := by
simp [β Ici_inter_Iio]
#align order_iso.preimage_Ico OrderIso.preimage_Ico
@[simp]
theorem preimage_Ioc (e : Ξ± βo Ξ²) (a b : Ξ²) : e β»ΒΉ' Ioc a b = Ioc (e.symm a) (e.symm b) := by
simp [β Ioi_inter_Iic]
#align order_iso.preimage_Ioc OrderIso.preimage_Ioc
@[simp]
theorem preimage_Ioo (e : Ξ± βo Ξ²) (a b : Ξ²) : e β»ΒΉ' Ioo a b = Ioo (e.symm a) (e.symm b) := by
simp [β Ioi_inter_Iio]
#align order_iso.preimage_Ioo OrderIso.preimage_Ioo
@[simp]
theorem image_Iic (e : Ξ± βo Ξ²) (a : Ξ±) : e '' Iic a = Iic (e a) := by
rw [e.image_eq_preimage, e.symm.preimage_Iic, e.symm_symm]
#align order_iso.image_Iic OrderIso.image_Iic
@[simp]
theorem image_Ici (e : Ξ± βo Ξ²) (a : Ξ±) : e '' Ici a = Ici (e a) :=
e.dual.image_Iic a
#align order_iso.image_Ici OrderIso.image_Ici
@[simp]
| Mathlib/Order/Interval/Set/OrderIso.lean | 78 | 79 | theorem image_Iio (e : Ξ± βo Ξ²) (a : Ξ±) : e '' Iio a = Iio (e a) := by |
rw [e.image_eq_preimage, e.symm.preimage_Iio, e.symm_symm]
| 1 |
import Mathlib.Topology.MetricSpace.Basic
#align_import topology.metric_space.infsep from "leanprover-community/mathlib"@"5316314b553dcf8c6716541851517c1a9715e22b"
variable {Ξ± Ξ² : Type*}
namespace Set
section Einfsep
open ENNReal
open Function
noncomputable def einfsep [EDist Ξ±] (s : Set Ξ±) : ββ₯0β :=
β¨
(x β s) (y β s) (_ : x β y), edist x y
#align set.einfsep Set.einfsep
section Infsep
open ENNReal
open Set Function
noncomputable def infsep [EDist Ξ±] (s : Set Ξ±) : β :=
ENNReal.toReal s.einfsep
#align set.infsep Set.infsep
section EDist
variable [EDist Ξ±] {x y : Ξ±} {s : Set Ξ±}
| Mathlib/Topology/MetricSpace/Infsep.lean | 332 | 333 | theorem infsep_zero : s.infsep = 0 β s.einfsep = 0 β¨ s.einfsep = β := by |
rw [infsep, ENNReal.toReal_eq_zero_iff]
| 1 |
import Mathlib.Data.List.Cycle
import Mathlib.GroupTheory.Perm.Cycle.Type
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.concrete from "leanprover-community/mathlib"@"00638177efd1b2534fc5269363ebf42a7871df9a"
open Equiv Equiv.Perm List
variable {Ξ± : Type*}
namespace Equiv.Perm
section Fintype
variable [Fintype Ξ±] [DecidableEq Ξ±] (p : Equiv.Perm Ξ±) (x : Ξ±)
def toList : List Ξ± :=
(List.range (cycleOf p x).support.card).map fun k => (p ^ k) x
#align equiv.perm.to_list Equiv.Perm.toList
@[simp]
theorem toList_one : toList (1 : Perm Ξ±) x = [] := by simp [toList, cycleOf_one]
#align equiv.perm.to_list_one Equiv.Perm.toList_one
@[simp]
theorem toList_eq_nil_iff {p : Perm Ξ±} {x} : toList p x = [] β x β p.support := by simp [toList]
#align equiv.perm.to_list_eq_nil_iff Equiv.Perm.toList_eq_nil_iff
@[simp]
theorem length_toList : length (toList p x) = (cycleOf p x).support.card := by simp [toList]
#align equiv.perm.length_to_list Equiv.Perm.length_toList
theorem toList_ne_singleton (y : Ξ±) : toList p x β [y] := by
intro H
simpa [card_support_ne_one] using congr_arg length H
#align equiv.perm.to_list_ne_singleton Equiv.Perm.toList_ne_singleton
theorem two_le_length_toList_iff_mem_support {p : Perm Ξ±} {x : Ξ±} :
2 β€ length (toList p x) β x β p.support := by simp
#align equiv.perm.two_le_length_to_list_iff_mem_support Equiv.Perm.two_le_length_toList_iff_mem_support
theorem length_toList_pos_of_mem_support (h : x β p.support) : 0 < length (toList p x) :=
zero_lt_two.trans_le (two_le_length_toList_iff_mem_support.mpr h)
#align equiv.perm.length_to_list_pos_of_mem_support Equiv.Perm.length_toList_pos_of_mem_support
theorem get_toList (n : β) (hn : n < length (toList p x)) :
(toList p x).get β¨n, hnβ© = (p ^ n) x := by simp [toList]
| Mathlib/GroupTheory/Perm/Cycle/Concrete.lean | 248 | 249 | theorem toList_get_zero (h : x β p.support) :
(toList p x).get β¨0, (length_toList_pos_of_mem_support _ _ h)β© = x := by | simp [toList]
| 1 |
import Mathlib.Algebra.Module.Submodule.Map
#align_import linear_algebra.basic from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
open Function
open Pointwise
variable {R : Type*} {Rβ : Type*} {Rβ : Type*} {Rβ : Type*}
variable {K : Type*}
variable {M : Type*} {Mβ : Type*} {Mβ : Type*} {Mβ : Type*}
variable {V : Type*} {Vβ : Type*}
namespace LinearMap
section AddCommMonoid
variable [Semiring R] [Semiring Rβ] [Semiring Rβ]
variable [AddCommMonoid M] [AddCommMonoid Mβ] [AddCommMonoid Mβ]
variable {Οββ : R β+* Rβ} {Οββ : Rβ β+* Rβ} {Οββ : R β+* Rβ}
variable [RingHomCompTriple Οββ Οββ Οββ]
variable [Module R M] [Module Rβ Mβ] [Module Rβ Mβ]
open Submodule
variable {Οββ : Rβ β+* R} {Οββ : R β+* Rβ} {Οββ : Rβ β+* Rβ} {Οββ : R β+* Rβ}
variable [RingHomCompTriple Οββ Οββ Οββ]
variable {F : Type*} [FunLike F M Mβ] [SemilinearMapClass F Οββ M Mβ]
def ker (f : F) : Submodule R M :=
comap f β₯
#align linear_map.ker LinearMap.ker
@[simp]
theorem mem_ker {f : F} {y} : y β ker f β f y = 0 :=
mem_bot Rβ
#align linear_map.mem_ker LinearMap.mem_ker
@[simp]
theorem ker_id : ker (LinearMap.id : M ββ[R] M) = β₯ :=
rfl
#align linear_map.ker_id LinearMap.ker_id
@[simp]
theorem map_coe_ker (f : F) (x : ker f) : f x = 0 :=
mem_ker.1 x.2
#align linear_map.map_coe_ker LinearMap.map_coe_ker
theorem ker_toAddSubmonoid (f : M βββ[Οββ] Mβ) : f.ker.toAddSubmonoid = (AddMonoidHom.mker f) :=
rfl
#align linear_map.ker_to_add_submonoid LinearMap.ker_toAddSubmonoid
theorem comp_ker_subtype (f : M βββ[Οββ] Mβ) : f.comp f.ker.subtype = 0 :=
LinearMap.ext fun x => mem_ker.1 x.2
#align linear_map.comp_ker_subtype LinearMap.comp_ker_subtype
theorem ker_comp (f : M βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
ker (g.comp f : M βββ[Οββ] Mβ) = comap f (ker g) :=
rfl
#align linear_map.ker_comp LinearMap.ker_comp
theorem ker_le_ker_comp (f : M βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
ker f β€ ker (g.comp f : M βββ[Οββ] Mβ) := by rw [ker_comp]; exact comap_mono bot_le
#align linear_map.ker_le_ker_comp LinearMap.ker_le_ker_comp
theorem ker_sup_ker_le_ker_comp_of_commute {f g : M ββ[R] M} (h : Commute f g) :
ker f β ker g β€ ker (f ββ g) := by
refine sup_le_iff.mpr β¨?_, ker_le_ker_comp g fβ©
rw [β mul_eq_comp, h.eq, mul_eq_comp]
exact ker_le_ker_comp f g
@[simp]
theorem ker_le_comap {p : Submodule Rβ Mβ} (f : M βββ[Οββ] Mβ) :
ker f β€ p.comap f :=
fun x hx β¦ by simp [mem_ker.mp hx]
theorem disjoint_ker {f : F} {p : Submodule R M} :
Disjoint p (ker f) β β x β p, f x = 0 β x = 0 := by
simp [disjoint_def]
#align linear_map.disjoint_ker LinearMap.disjoint_ker
| Mathlib/Algebra/Module/Submodule/Ker.lean | 112 | 113 | theorem ker_eq_bot' {f : F} : ker f = β₯ β β m, f m = 0 β m = 0 := by |
simpa [disjoint_iff_inf_le] using disjoint_ker (f := f) (p := β€)
| 1 |
import Mathlib.Data.Nat.Defs
import Mathlib.Tactic.GCongr.Core
import Mathlib.Tactic.Common
import Mathlib.Tactic.Monotonicity.Attr
#align_import data.nat.factorial.basic from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
namespace Nat
def factorial : β β β
| 0 => 1
| succ n => succ n * factorial n
#align nat.factorial Nat.factorial
scoped notation:10000 n "!" => Nat.factorial n
section DescFactorial
def descFactorial (n : β) : β β β
| 0 => 1
| k + 1 => (n - k) * descFactorial n k
#align nat.desc_factorial Nat.descFactorial
@[simp]
theorem descFactorial_zero (n : β) : n.descFactorial 0 = 1 :=
rfl
#align nat.desc_factorial_zero Nat.descFactorial_zero
@[simp]
theorem descFactorial_succ (n k : β) : n.descFactorial (k + 1) = (n - k) * n.descFactorial k :=
rfl
#align nat.desc_factorial_succ Nat.descFactorial_succ
theorem zero_descFactorial_succ (k : β) : (0 : β).descFactorial (k + 1) = 0 := by
rw [descFactorial_succ, Nat.zero_sub, Nat.zero_mul]
#align nat.zero_desc_factorial_succ Nat.zero_descFactorial_succ
| Mathlib/Data/Nat/Factorial/Basic.lean | 344 | 344 | theorem descFactorial_one (n : β) : n.descFactorial 1 = n := by | simp
| 1 |
import Mathlib.Analysis.Normed.Field.Basic
import Mathlib.Analysis.SpecialFunctions.Pow.Real
#align_import analysis.normed.ring.seminorm from "leanprover-community/mathlib"@"7ea604785a41a0681eac70c5a82372493dbefc68"
open NNReal
variable {F R S : Type*} (x y : R) (r : β)
structure RingSeminorm (R : Type*) [NonUnitalNonAssocRing R] extends AddGroupSeminorm R where
mul_le' : β x y : R, toFun (x * y) β€ toFun x * toFun y
#align ring_seminorm RingSeminorm
structure RingNorm (R : Type*) [NonUnitalNonAssocRing R] extends RingSeminorm R, AddGroupNorm R
#align ring_norm RingNorm
structure MulRingSeminorm (R : Type*) [NonAssocRing R] extends AddGroupSeminorm R,
MonoidWithZeroHom R β
#align mul_ring_seminorm MulRingSeminorm
structure MulRingNorm (R : Type*) [NonAssocRing R] extends MulRingSeminorm R, AddGroupNorm R
#align mul_ring_norm MulRingNorm
attribute [nolint docBlame]
RingSeminorm.toAddGroupSeminorm RingNorm.toAddGroupNorm RingNorm.toRingSeminorm
MulRingSeminorm.toAddGroupSeminorm MulRingSeminorm.toMonoidWithZeroHom
MulRingNorm.toAddGroupNorm MulRingNorm.toMulRingSeminorm
namespace RingSeminorm
section NonUnitalRing
variable [NonUnitalRing R]
instance funLike : FunLike (RingSeminorm R) R β where
coe f := f.toFun
coe_injective' f g h := by
cases f
cases g
congr
ext x
exact congr_fun h x
instance ringSeminormClass : RingSeminormClass (RingSeminorm R) R β where
map_zero f := f.map_zero'
map_add_le_add f := f.add_le'
map_mul_le_mul f := f.mul_le'
map_neg_eq_map f := f.neg'
#align ring_seminorm.ring_seminorm_class RingSeminorm.ringSeminormClass
@[simp]
theorem toFun_eq_coe (p : RingSeminorm R) : (p.toAddGroupSeminorm : R β β) = p :=
rfl
#align ring_seminorm.to_fun_eq_coe RingSeminorm.toFun_eq_coe
@[ext]
theorem ext {p q : RingSeminorm R} : (β x, p x = q x) β p = q :=
DFunLike.ext p q
#align ring_seminorm.ext RingSeminorm.ext
instance : Zero (RingSeminorm R) :=
β¨{ AddGroupSeminorm.instZeroAddGroupSeminorm.zero with mul_le' :=
fun _ _ => (zero_mul _).ge }β©
theorem eq_zero_iff {p : RingSeminorm R} : p = 0 β β x, p x = 0 :=
DFunLike.ext_iff
#align ring_seminorm.eq_zero_iff RingSeminorm.eq_zero_iff
| Mathlib/Analysis/Normed/Ring/Seminorm.lean | 116 | 116 | theorem ne_zero_iff {p : RingSeminorm R} : p β 0 β β x, p x β 0 := by | simp [eq_zero_iff]
| 1 |
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
theorem logb_abs (x : β) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
#align real.logb_abs Real.logb_abs
@[simp]
theorem logb_neg_eq_logb (x : β) : logb b (-x) = logb b x := by
rw [β logb_abs x, β logb_abs (-x), abs_neg]
#align real.logb_neg_eq_logb Real.logb_neg_eq_logb
| Mathlib/Analysis/SpecialFunctions/Log/Base.lean | 72 | 73 | theorem logb_mul (hx : x β 0) (hy : y β 0) : logb b (x * y) = logb b x + logb b y := by |
simp_rw [logb, log_mul hx hy, add_div]
| 1 |
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Data.Rat.Denumerable
import Mathlib.Data.Set.Pointwise.Interval
import Mathlib.SetTheory.Cardinal.Continuum
#align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d"
open Nat Set
open Cardinal
noncomputable section
namespace Cardinal
variable {c : β} {f g : β β Bool} {n : β}
def cantorFunctionAux (c : β) (f : β β Bool) (n : β) : β :=
cond (f n) (c ^ n) 0
#align cardinal.cantor_function_aux Cardinal.cantorFunctionAux
@[simp]
theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by
simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true
@[simp]
theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by
simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false
theorem cantorFunctionAux_nonneg (h : 0 β€ c) : 0 β€ cantorFunctionAux c f n := by
cases h' : f n <;> simp [h']
apply pow_nonneg h
#align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg
theorem cantorFunctionAux_eq (h : f n = g n) :
cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h]
#align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq
| Mathlib/Data/Real/Cardinality.lean | 82 | 83 | theorem cantorFunctionAux_zero (f : β β Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by |
cases h : f 0 <;> simp [h]
| 1 |
import Mathlib.CategoryTheory.Idempotents.Basic
import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor
import Mathlib.CategoryTheory.Equivalence
#align_import category_theory.idempotents.karoubi from "leanprover-community/mathlib"@"200eda15d8ff5669854ff6bcc10aaf37cb70498f"
noncomputable section
open CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.Limits BigOperators
namespace CategoryTheory
variable (C : Type*) [Category C]
namespace Idempotents
-- porting note (#5171): removed @[nolint has_nonempty_instance]
structure Karoubi where
X : C
p : X βΆ X
idem : p β« p = p := by aesop_cat
#align category_theory.idempotents.karoubi CategoryTheory.Idempotents.Karoubi
namespace Karoubi
variable {C}
attribute [reassoc (attr := simp)] idem
@[ext]
theorem ext {P Q : Karoubi C} (h_X : P.X = Q.X) (h_p : P.p β« eqToHom h_X = eqToHom h_X β« Q.p) :
P = Q := by
cases P
cases Q
dsimp at h_X h_p
subst h_X
simpa only [mk.injEq, heq_eq_eq, true_and, eqToHom_refl, comp_id, id_comp] using h_p
#align category_theory.idempotents.karoubi.ext CategoryTheory.Idempotents.Karoubi.ext
@[ext]
structure Hom (P Q : Karoubi C) where
f : P.X βΆ Q.X
comm : f = P.p β« f β« Q.p := by aesop_cat
#align category_theory.idempotents.karoubi.hom CategoryTheory.Idempotents.Karoubi.Hom
instance [Preadditive C] (P Q : Karoubi C) : Inhabited (Hom P Q) :=
β¨β¨0, by rw [zero_comp, comp_zero]β©β©
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Idempotents/Karoubi.lean | 85 | 85 | theorem p_comp {P Q : Karoubi C} (f : Hom P Q) : P.p β« f.f = f.f := by | rw [f.comm, β assoc, P.idem]
| 1 |
import Mathlib.Algebra.Group.Indicator
import Mathlib.Data.Finset.Piecewise
import Mathlib.Data.Finset.Preimage
#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
-- TODO
-- assert_not_exists AddCommMonoidWithOne
assert_not_exists MonoidWithZero
assert_not_exists MulAction
variable {ΞΉ ΞΊ Ξ± Ξ² Ξ³ : Type*}
open Fin Function
namespace Finset
@[to_additive "`β x β s, f x` is the sum of `f x` as `x` ranges over the elements
of the finite set `s`."]
protected def prod [CommMonoid Ξ²] (s : Finset Ξ±) (f : Ξ± β Ξ²) : Ξ² :=
(s.1.map f).prod
#align finset.prod Finset.prod
#align finset.sum Finset.sum
@[to_additive (attr := simp)]
theorem prod_mk [CommMonoid Ξ²] (s : Multiset Ξ±) (hs : s.Nodup) (f : Ξ± β Ξ²) :
(β¨s, hsβ© : Finset Ξ±).prod f = (s.map f).prod :=
rfl
#align finset.prod_mk Finset.prod_mk
#align finset.sum_mk Finset.sum_mk
@[to_additive (attr := simp)]
| Mathlib/Algebra/BigOperators/Group/Finset.lean | 67 | 68 | theorem prod_val [CommMonoid Ξ±] (s : Finset Ξ±) : s.1.prod = s.prod id := by |
rw [Finset.prod, Multiset.map_id]
| 1 |
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {Ξ± : Type*}
namespace Set
section LinearOrderedField
variable [LinearOrderedField Ξ±] {a : Ξ±}
@[simp]
theorem preimage_mul_const_Iio (a : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Iio a = Iio (a / c) :=
ext fun _x => (lt_div_iff h).symm
#align set.preimage_mul_const_Iio Set.preimage_mul_const_Iio
@[simp]
theorem preimage_mul_const_Ioi (a : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Ioi a = Ioi (a / c) :=
ext fun _x => (div_lt_iff h).symm
#align set.preimage_mul_const_Ioi Set.preimage_mul_const_Ioi
@[simp]
theorem preimage_mul_const_Iic (a : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Iic a = Iic (a / c) :=
ext fun _x => (le_div_iff h).symm
#align set.preimage_mul_const_Iic Set.preimage_mul_const_Iic
@[simp]
theorem preimage_mul_const_Ici (a : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Ici a = Ici (a / c) :=
ext fun _x => (div_le_iff h).symm
#align set.preimage_mul_const_Ici Set.preimage_mul_const_Ici
@[simp]
theorem preimage_mul_const_Ioo (a b : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Ioo a b = Ioo (a / c) (b / c) := by simp [β Ioi_inter_Iio, h]
#align set.preimage_mul_const_Ioo Set.preimage_mul_const_Ioo
@[simp]
theorem preimage_mul_const_Ioc (a b : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Ioc a b = Ioc (a / c) (b / c) := by simp [β Ioi_inter_Iic, h]
#align set.preimage_mul_const_Ioc Set.preimage_mul_const_Ioc
@[simp]
theorem preimage_mul_const_Ico (a b : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Ico a b = Ico (a / c) (b / c) := by simp [β Ici_inter_Iio, h]
#align set.preimage_mul_const_Ico Set.preimage_mul_const_Ico
@[simp]
theorem preimage_mul_const_Icc (a b : Ξ±) {c : Ξ±} (h : 0 < c) :
(fun x => x * c) β»ΒΉ' Icc a b = Icc (a / c) (b / c) := by simp [β Ici_inter_Iic, h]
#align set.preimage_mul_const_Icc Set.preimage_mul_const_Icc
@[simp]
theorem preimage_mul_const_Iio_of_neg (a : Ξ±) {c : Ξ±} (h : c < 0) :
(fun x => x * c) β»ΒΉ' Iio a = Ioi (a / c) :=
ext fun _x => (div_lt_iff_of_neg h).symm
#align set.preimage_mul_const_Iio_of_neg Set.preimage_mul_const_Iio_of_neg
@[simp]
theorem preimage_mul_const_Ioi_of_neg (a : Ξ±) {c : Ξ±} (h : c < 0) :
(fun x => x * c) β»ΒΉ' Ioi a = Iio (a / c) :=
ext fun _x => (lt_div_iff_of_neg h).symm
#align set.preimage_mul_const_Ioi_of_neg Set.preimage_mul_const_Ioi_of_neg
@[simp]
theorem preimage_mul_const_Iic_of_neg (a : Ξ±) {c : Ξ±} (h : c < 0) :
(fun x => x * c) β»ΒΉ' Iic a = Ici (a / c) :=
ext fun _x => (div_le_iff_of_neg h).symm
#align set.preimage_mul_const_Iic_of_neg Set.preimage_mul_const_Iic_of_neg
@[simp]
theorem preimage_mul_const_Ici_of_neg (a : Ξ±) {c : Ξ±} (h : c < 0) :
(fun x => x * c) β»ΒΉ' Ici a = Iic (a / c) :=
ext fun _x => (le_div_iff_of_neg h).symm
#align set.preimage_mul_const_Ici_of_neg Set.preimage_mul_const_Ici_of_neg
@[simp]
theorem preimage_mul_const_Ioo_of_neg (a b : Ξ±) {c : Ξ±} (h : c < 0) :
(fun x => x * c) β»ΒΉ' Ioo a b = Ioo (b / c) (a / c) := by simp [β Ioi_inter_Iio, h, inter_comm]
#align set.preimage_mul_const_Ioo_of_neg Set.preimage_mul_const_Ioo_of_neg
@[simp]
theorem preimage_mul_const_Ioc_of_neg (a b : Ξ±) {c : Ξ±} (h : c < 0) :
(fun x => x * c) β»ΒΉ' Ioc a b = Ico (b / c) (a / c) := by
simp [β Ioi_inter_Iic, β Ici_inter_Iio, h, inter_comm]
#align set.preimage_mul_const_Ioc_of_neg Set.preimage_mul_const_Ioc_of_neg
@[simp]
| Mathlib/Data/Set/Pointwise/Interval.lean | 674 | 676 | theorem preimage_mul_const_Ico_of_neg (a b : Ξ±) {c : Ξ±} (h : c < 0) :
(fun x => x * c) β»ΒΉ' Ico a b = Ioc (b / c) (a / c) := by |
simp [β Ici_inter_Iio, β Ioi_inter_Iic, h, inter_comm]
| 1 |
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]
| Mathlib/Algebra/QuaternionBasis.lean | 84 | 85 | 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]
| 1 |
import Mathlib.Data.Analysis.Filter
import Mathlib.Topology.Bases
import Mathlib.Topology.LocallyFinite
#align_import data.analysis.topology from "leanprover-community/mathlib"@"55d771df074d0dd020139ee1cd4b95521422df9f"
open Set
open Filter hiding Realizer
open Topology
structure Ctop (Ξ± Ο : Type*) where
f : Ο β Set Ξ±
top : Ξ± β Ο
top_mem : β x : Ξ±, x β f (top x)
inter : β (a b) (x : Ξ±), x β f a β© f b β Ο
inter_mem : β a b x h, x β f (inter a b x h)
inter_sub : β a b x h, f (inter a b x h) β f a β© f b
#align ctop Ctop
variable {Ξ± : Type*} {Ξ² : Type*} {Ο : Type*} {Ο : Type*}
instance : Inhabited (Ctop Ξ± (Set Ξ±)) :=
β¨{ f := id
top := singleton
top_mem := mem_singleton
inter := fun s t _ _ β¦ s β© t
inter_mem := fun _s _t _a β¦ id
inter_sub := fun _s _t _a _ha β¦ Subset.rfl }β©
namespace Ctop
section
variable (F : Ctop Ξ± Ο)
instance : CoeFun (Ctop Ξ± Ο) fun _ β¦ Ο β Set Ξ± :=
β¨Ctop.fβ©
-- @[simp] -- Porting note (#10685): dsimp can prove this
theorem coe_mk (f T hβ I hβ hβ a) : (@Ctop.mk Ξ± Ο f T hβ I hβ hβ) a = f a := rfl
#align ctop.coe_mk Ctop.coe_mk
def ofEquiv (E : Ο β Ο) : Ctop Ξ± Ο β Ctop Ξ± Ο
| β¨f, T, hβ, I, hβ, hββ© =>
{ f := fun a β¦ f (E.symm a)
top := fun x β¦ E (T x)
top_mem := fun x β¦ by simpa using hβ x
inter := fun a b x h β¦ E (I (E.symm a) (E.symm b) x h)
inter_mem := fun a b x h β¦ by simpa using hβ (E.symm a) (E.symm b) x h
inter_sub := fun a b x h β¦ by simpa using hβ (E.symm a) (E.symm b) x h }
#align ctop.of_equiv Ctop.ofEquiv
@[simp]
| Mathlib/Data/Analysis/Topology.lean | 79 | 80 | theorem ofEquiv_val (E : Ο β Ο) (F : Ctop Ξ± Ο) (a : Ο) : F.ofEquiv E a = F (E.symm a) := by |
cases F; rfl
| 1 |
import Mathlib.MeasureTheory.Integral.SetIntegral
#align_import measure_theory.integral.average from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520"
open ENNReal MeasureTheory MeasureTheory.Measure Metric Set Filter TopologicalSpace Function
open scoped Topology ENNReal Convex
variable {Ξ± E F : Type*} {m0 : MeasurableSpace Ξ±} [NormedAddCommGroup E] [NormedSpace β E]
[CompleteSpace E] [NormedAddCommGroup F] [NormedSpace β F] [CompleteSpace F] {ΞΌ Ξ½ : Measure Ξ±}
{s t : Set Ξ±}
namespace MeasureTheory
section NormedAddCommGroup
variable (ΞΌ)
variable {f g : Ξ± β E}
noncomputable def average (f : Ξ± β E) :=
β« x, f x β(ΞΌ univ)β»ΒΉ β’ ΞΌ
#align measure_theory.average MeasureTheory.average
notation3 "β¨ "(...)", "r:60:(scoped f => f)" β"ΞΌ:70 => average ΞΌ r
notation3 "β¨ "(...)", "r:60:(scoped f => average volume f) => r
notation3 "β¨ "(...)" in "s", "r:60:(scoped f => f)" β"ΞΌ:70 => average (Measure.restrict ΞΌ s) r
notation3 "β¨ "(...)" in "s", "r:60:(scoped f => average (Measure.restrict volume s) f) => r
@[simp]
theorem average_zero : β¨ _, (0 : E) βΞΌ = 0 := by rw [average, integral_zero]
#align measure_theory.average_zero MeasureTheory.average_zero
@[simp]
theorem average_zero_measure (f : Ξ± β E) : β¨ x, f x β(0 : Measure Ξ±) = 0 := by
rw [average, smul_zero, integral_zero_measure]
#align measure_theory.average_zero_measure MeasureTheory.average_zero_measure
@[simp]
theorem average_neg (f : Ξ± β E) : β¨ x, -f x βΞΌ = -β¨ x, f x βΞΌ :=
integral_neg f
#align measure_theory.average_neg MeasureTheory.average_neg
theorem average_eq' (f : Ξ± β E) : β¨ x, f x βΞΌ = β« x, f x β(ΞΌ univ)β»ΒΉ β’ ΞΌ :=
rfl
#align measure_theory.average_eq' MeasureTheory.average_eq'
theorem average_eq (f : Ξ± β E) : β¨ x, f x βΞΌ = (ΞΌ univ).toRealβ»ΒΉ β’ β« x, f x βΞΌ := by
rw [average_eq', integral_smul_measure, ENNReal.toReal_inv]
#align measure_theory.average_eq MeasureTheory.average_eq
theorem average_eq_integral [IsProbabilityMeasure ΞΌ] (f : Ξ± β E) : β¨ x, f x βΞΌ = β« x, f x βΞΌ := by
rw [average, measure_univ, inv_one, one_smul]
#align measure_theory.average_eq_integral MeasureTheory.average_eq_integral
@[simp]
theorem measure_smul_average [IsFiniteMeasure ΞΌ] (f : Ξ± β E) :
(ΞΌ univ).toReal β’ β¨ x, f x βΞΌ = β« x, f x βΞΌ := by
rcases eq_or_ne ΞΌ 0 with hΞΌ | hΞΌ
Β· rw [hΞΌ, integral_zero_measure, average_zero_measure, smul_zero]
Β· rw [average_eq, smul_inv_smulβ]
refine (ENNReal.toReal_pos ?_ <| measure_ne_top _ _).ne'
rwa [Ne, measure_univ_eq_zero]
#align measure_theory.measure_smul_average MeasureTheory.measure_smul_average
theorem setAverage_eq (f : Ξ± β E) (s : Set Ξ±) :
β¨ x in s, f x βΞΌ = (ΞΌ s).toRealβ»ΒΉ β’ β« x in s, f x βΞΌ := by rw [average_eq, restrict_apply_univ]
#align measure_theory.set_average_eq MeasureTheory.setAverage_eq
theorem setAverage_eq' (f : Ξ± β E) (s : Set Ξ±) :
β¨ x in s, f x βΞΌ = β« x, f x β(ΞΌ s)β»ΒΉ β’ ΞΌ.restrict s := by
simp only [average_eq', restrict_apply_univ]
#align measure_theory.set_average_eq' MeasureTheory.setAverage_eq'
variable {ΞΌ}
| Mathlib/MeasureTheory/Integral/Average.lean | 361 | 362 | theorem average_congr {f g : Ξ± β E} (h : f =α΅[ΞΌ] g) : β¨ x, f x βΞΌ = β¨ x, g x βΞΌ := by |
simp only [average_eq, integral_congr_ae h]
| 1 |
import Mathlib.Algebra.Group.Prod
import Mathlib.Order.Cover
#align_import algebra.support from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
assert_not_exists MonoidWithZero
open Set
namespace Function
variable {Ξ± Ξ² A B M N P G : Type*}
section One
variable [One M] [One N] [One P]
@[to_additive "`support` of a function is the set of points `x` such that `f x β 0`."]
def mulSupport (f : Ξ± β M) : Set Ξ± := {x | f x β 1}
#align function.mul_support Function.mulSupport
#align function.support Function.support
@[to_additive]
theorem mulSupport_eq_preimage (f : Ξ± β M) : mulSupport f = f β»ΒΉ' {1}αΆ :=
rfl
#align function.mul_support_eq_preimage Function.mulSupport_eq_preimage
#align function.support_eq_preimage Function.support_eq_preimage
@[to_additive]
theorem nmem_mulSupport {f : Ξ± β M} {x : Ξ±} : x β mulSupport f β f x = 1 :=
not_not
#align function.nmem_mul_support Function.nmem_mulSupport
#align function.nmem_support Function.nmem_support
@[to_additive]
theorem compl_mulSupport {f : Ξ± β M} : (mulSupport f)αΆ = { x | f x = 1 } :=
ext fun _ => nmem_mulSupport
#align function.compl_mul_support Function.compl_mulSupport
#align function.compl_support Function.compl_support
@[to_additive (attr := simp)]
theorem mem_mulSupport {f : Ξ± β M} {x : Ξ±} : x β mulSupport f β f x β 1 :=
Iff.rfl
#align function.mem_mul_support Function.mem_mulSupport
#align function.mem_support Function.mem_support
@[to_additive (attr := simp)]
theorem mulSupport_subset_iff {f : Ξ± β M} {s : Set Ξ±} : mulSupport f β s β β x, f x β 1 β x β s :=
Iff.rfl
#align function.mul_support_subset_iff Function.mulSupport_subset_iff
#align function.support_subset_iff Function.support_subset_iff
@[to_additive]
theorem mulSupport_subset_iff' {f : Ξ± β M} {s : Set Ξ±} :
mulSupport f β s β β x β s, f x = 1 :=
forall_congr' fun _ => not_imp_comm
#align function.mul_support_subset_iff' Function.mulSupport_subset_iff'
#align function.support_subset_iff' Function.support_subset_iff'
@[to_additive]
theorem mulSupport_eq_iff {f : Ξ± β M} {s : Set Ξ±} :
mulSupport f = s β (β x, x β s β f x β 1) β§ β x, x β s β f x = 1 := by
simp (config := { contextual := true }) only [ext_iff, mem_mulSupport, ne_eq, iff_def,
not_imp_comm, and_comm, forall_and]
#align function.mul_support_eq_iff Function.mulSupport_eq_iff
#align function.support_eq_iff Function.support_eq_iff
@[to_additive]
theorem ext_iff_mulSupport {f g : Ξ± β M} :
f = g β f.mulSupport = g.mulSupport β§ β x β f.mulSupport, f x = g x :=
β¨fun h β¦ h βΈ β¨rfl, fun _ _ β¦ rflβ©, fun β¨hβ, hββ© β¦ funext fun x β¦ by
if hx : x β f.mulSupport then exact hβ x hx
else rw [nmem_mulSupport.1 hx, nmem_mulSupport.1 (mt (Set.ext_iff.1 hβ x).2 hx)]β©
@[to_additive]
theorem mulSupport_update_of_ne_one [DecidableEq Ξ±] (f : Ξ± β M) (x : Ξ±) {y : M} (hy : y β 1) :
mulSupport (update f x y) = insert x (mulSupport f) := by
ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*]
@[to_additive]
| Mathlib/Algebra/Group/Support.lean | 93 | 95 | theorem mulSupport_update_one [DecidableEq Ξ±] (f : Ξ± β M) (x : Ξ±) :
mulSupport (update f x 1) = mulSupport f \ {x} := by |
ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*]
| 1 |
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Part
import Mathlib.Tactic.NormNum
#align_import data.nat.part_enat from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
open Part hiding some
def PartENat : Type :=
Part β
#align part_enat PartENat
namespace PartENat
@[coe]
def some : β β PartENat :=
Part.some
#align part_enat.some PartENat.some
instance : Zero PartENat :=
β¨some 0β©
instance : Inhabited PartENat :=
β¨0β©
instance : One PartENat :=
β¨some 1β©
instance : Add PartENat :=
β¨fun x y => β¨x.Dom β§ y.Dom, fun h => get x h.1 + get y h.2β©β©
instance (n : β) : Decidable (some n).Dom :=
isTrue trivial
@[simp]
theorem dom_some (x : β) : (some x).Dom :=
trivial
#align part_enat.dom_some PartENat.dom_some
instance addCommMonoid : AddCommMonoid PartENat where
add := (Β· + Β·)
zero := 0
add_comm x y := Part.ext' and_comm fun _ _ => add_comm _ _
zero_add x := Part.ext' (true_and_iff _) fun _ _ => zero_add _
add_zero x := Part.ext' (and_true_iff _) fun _ _ => add_zero _
add_assoc x y z := Part.ext' and_assoc fun _ _ => add_assoc _ _ _
nsmul := nsmulRec
instance : AddCommMonoidWithOne PartENat :=
{ PartENat.addCommMonoid with
one := 1
natCast := some
natCast_zero := rfl
natCast_succ := fun _ => Part.ext' (true_and_iff _).symm fun _ _ => rfl }
theorem some_eq_natCast (n : β) : some n = n :=
rfl
#align part_enat.some_eq_coe PartENat.some_eq_natCast
instance : CharZero PartENat where
cast_injective := Part.some_injective
theorem natCast_inj {x y : β} : (x : PartENat) = y β x = y :=
Nat.cast_inj
#align part_enat.coe_inj PartENat.natCast_inj
@[simp]
theorem dom_natCast (x : β) : (x : PartENat).Dom :=
trivial
#align part_enat.dom_coe PartENat.dom_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem dom_ofNat (x : β) [x.AtLeastTwo] : (no_index (OfNat.ofNat x : PartENat)).Dom :=
trivial
@[simp]
theorem dom_zero : (0 : PartENat).Dom :=
trivial
@[simp]
theorem dom_one : (1 : PartENat).Dom :=
trivial
instance : CanLift PartENat β (β) Dom :=
β¨fun n hn => β¨n.get hn, Part.some_get _β©β©
instance : LE PartENat :=
β¨fun x y => β h : y.Dom β x.Dom, β hy : y.Dom, x.get (h hy) β€ y.get hyβ©
instance : Top PartENat :=
β¨noneβ©
instance : Bot PartENat :=
β¨0β©
instance : Sup PartENat :=
β¨fun x y => β¨x.Dom β§ y.Dom, fun h => x.get h.1 β y.get h.2β©β©
theorem le_def (x y : PartENat) :
x β€ y β β h : y.Dom β x.Dom, β hy : y.Dom, x.get (h hy) β€ y.get hy :=
Iff.rfl
#align part_enat.le_def PartENat.le_def
@[elab_as_elim]
protected theorem casesOn' {P : PartENat β Prop} :
β a : PartENat, P β€ β (β n : β, P (some n)) β P a :=
Part.induction_on
#align part_enat.cases_on' PartENat.casesOn'
@[elab_as_elim]
protected theorem casesOn {P : PartENat β Prop} : β a : PartENat, P β€ β (β n : β, P n) β P a := by
exact PartENat.casesOn'
#align part_enat.cases_on PartENat.casesOn
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem top_add (x : PartENat) : β€ + x = β€ :=
Part.ext' (false_and_iff _) fun h => h.left.elim
#align part_enat.top_add PartENat.top_add
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem add_top (x : PartENat) : x + β€ = β€ := by rw [add_comm, top_add]
#align part_enat.add_top PartENat.add_top
@[simp]
theorem natCast_get {x : PartENat} (h : x.Dom) : (x.get h : PartENat) = x := by
exact Part.ext' (iff_of_true trivial h) fun _ _ => rfl
#align part_enat.coe_get PartENat.natCast_get
@[simp, norm_cast]
theorem get_natCast' (x : β) (h : (x : PartENat).Dom) : get (x : PartENat) h = x := by
rw [β natCast_inj, natCast_get]
#align part_enat.get_coe' PartENat.get_natCast'
theorem get_natCast {x : β} : get (x : PartENat) (dom_natCast x) = x :=
get_natCast' _ _
#align part_enat.get_coe PartENat.get_natCast
| Mathlib/Data/Nat/PartENat.lean | 192 | 194 | theorem coe_add_get {x : β} {y : PartENat} (h : ((x : PartENat) + y).Dom) :
get ((x : PartENat) + y) h = x + get y h.2 := by |
rfl
| 1 |
import Mathlib.Data.Finset.Prod
import Mathlib.Data.Set.Finite
#align_import data.finset.n_ary from "leanprover-community/mathlib"@"eba7871095e834365616b5e43c8c7bb0b37058d0"
open Function Set
variable {Ξ± Ξ±' Ξ² Ξ²' Ξ³ Ξ³' Ξ΄ Ξ΄' Ξ΅ Ξ΅' ΞΆ ΞΆ' Ξ½ : Type*}
namespace Finset
variable [DecidableEq Ξ±'] [DecidableEq Ξ²'] [DecidableEq Ξ³] [DecidableEq Ξ³'] [DecidableEq Ξ΄]
[DecidableEq Ξ΄'] [DecidableEq Ξ΅] [DecidableEq Ξ΅'] {f f' : Ξ± β Ξ² β Ξ³} {g g' : Ξ± β Ξ² β Ξ³ β Ξ΄}
{s s' : Finset Ξ±} {t t' : Finset Ξ²} {u u' : Finset Ξ³} {a a' : Ξ±} {b b' : Ξ²} {c : Ξ³}
def imageβ (f : Ξ± β Ξ² β Ξ³) (s : Finset Ξ±) (t : Finset Ξ²) : Finset Ξ³ :=
(s ΓΛ’ t).image <| uncurry f
#align finset.imageβ Finset.imageβ
@[simp]
theorem mem_imageβ : c β imageβ f s t β β a β s, β b β t, f a b = c := by
simp [imageβ, and_assoc]
#align finset.mem_imageβ Finset.mem_imageβ
@[simp, norm_cast]
theorem coe_imageβ (f : Ξ± β Ξ² β Ξ³) (s : Finset Ξ±) (t : Finset Ξ²) :
(imageβ f s t : Set Ξ³) = Set.image2 f s t :=
Set.ext fun _ => mem_imageβ
#align finset.coe_imageβ Finset.coe_imageβ
theorem card_imageβ_le (f : Ξ± β Ξ² β Ξ³) (s : Finset Ξ±) (t : Finset Ξ²) :
(imageβ f s t).card β€ s.card * t.card :=
card_image_le.trans_eq <| card_product _ _
#align finset.card_imageβ_le Finset.card_imageβ_le
theorem card_imageβ_iff :
(imageβ f s t).card = s.card * t.card β (s ΓΛ’ t : Set (Ξ± Γ Ξ²)).InjOn fun x => f x.1 x.2 := by
rw [β card_product, β coe_product]
exact card_image_iff
#align finset.card_imageβ_iff Finset.card_imageβ_iff
theorem card_imageβ (hf : Injective2 f) (s : Finset Ξ±) (t : Finset Ξ²) :
(imageβ f s t).card = s.card * t.card :=
(card_image_of_injective _ hf.uncurry).trans <| card_product _ _
#align finset.card_imageβ Finset.card_imageβ
theorem mem_imageβ_of_mem (ha : a β s) (hb : b β t) : f a b β imageβ f s t :=
mem_imageβ.2 β¨a, ha, b, hb, rflβ©
#align finset.mem_imageβ_of_mem Finset.mem_imageβ_of_mem
theorem mem_imageβ_iff (hf : Injective2 f) : f a b β imageβ f s t β a β s β§ b β t := by
rw [β mem_coe, coe_imageβ, mem_image2_iff hf, mem_coe, mem_coe]
#align finset.mem_imageβ_iff Finset.mem_imageβ_iff
theorem imageβ_subset (hs : s β s') (ht : t β t') : imageβ f s t β imageβ f s' t' := by
rw [β coe_subset, coe_imageβ, coe_imageβ]
exact image2_subset hs ht
#align finset.imageβ_subset Finset.imageβ_subset
theorem imageβ_subset_left (ht : t β t') : imageβ f s t β imageβ f s t' :=
imageβ_subset Subset.rfl ht
#align finset.imageβ_subset_left Finset.imageβ_subset_left
theorem imageβ_subset_right (hs : s β s') : imageβ f s t β imageβ f s' t :=
imageβ_subset hs Subset.rfl
#align finset.imageβ_subset_right Finset.imageβ_subset_right
theorem image_subset_imageβ_left (hb : b β t) : s.image (fun a => f a b) β imageβ f s t :=
image_subset_iff.2 fun _ ha => mem_imageβ_of_mem ha hb
#align finset.image_subset_imageβ_left Finset.image_subset_imageβ_left
theorem image_subset_imageβ_right (ha : a β s) : t.image (fun b => f a b) β imageβ f s t :=
image_subset_iff.2 fun _ => mem_imageβ_of_mem ha
#align finset.image_subset_imageβ_right Finset.image_subset_imageβ_right
| Mathlib/Data/Finset/NAry.lean | 98 | 100 | theorem forall_imageβ_iff {p : Ξ³ β Prop} :
(β z β imageβ f s t, p z) β β x β s, β y β t, p (f x y) := by |
simp_rw [β mem_coe, coe_imageβ, forall_image2_iff]
| 1 |
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
import Mathlib.Analysis.SpecialFunctions.Log.Basic
#align_import analysis.special_functions.arsinh from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open Function Filter Set
open scoped Topology
namespace Real
variable {x y : β}
-- @[pp_nodot] is no longer needed
def arsinh (x : β) :=
log (x + β(1 + x ^ 2))
#align real.arsinh Real.arsinh
theorem exp_arsinh (x : β) : exp (arsinh x) = x + β(1 + x ^ 2) := by
apply exp_log
rw [β neg_lt_iff_pos_add']
apply lt_sqrt_of_sq_lt
simp
#align real.exp_arsinh Real.exp_arsinh
@[simp]
theorem arsinh_zero : arsinh 0 = 0 := by simp [arsinh]
#align real.arsinh_zero Real.arsinh_zero
@[simp]
theorem arsinh_neg (x : β) : arsinh (-x) = -arsinh x := by
rw [β exp_eq_exp, exp_arsinh, exp_neg, exp_arsinh]
apply eq_inv_of_mul_eq_one_left
rw [neg_sq, neg_add_eq_sub, add_comm x, mul_comm, β sq_sub_sq, sq_sqrt, add_sub_cancel_right]
exact add_nonneg zero_le_one (sq_nonneg _)
#align real.arsinh_neg Real.arsinh_neg
@[simp]
theorem sinh_arsinh (x : β) : sinh (arsinh x) = x := by
rw [sinh_eq, β arsinh_neg, exp_arsinh, exp_arsinh, neg_sq]; field_simp
#align real.sinh_arsinh Real.sinh_arsinh
@[simp]
theorem cosh_arsinh (x : β) : cosh (arsinh x) = β(1 + x ^ 2) := by
rw [β sqrt_sq (cosh_pos _).le, cosh_sq', sinh_arsinh]
#align real.cosh_arsinh Real.cosh_arsinh
theorem sinh_surjective : Surjective sinh :=
LeftInverse.surjective sinh_arsinh
#align real.sinh_surjective Real.sinh_surjective
theorem sinh_bijective : Bijective sinh :=
β¨sinh_injective, sinh_surjectiveβ©
#align real.sinh_bijective Real.sinh_bijective
@[simp]
theorem arsinh_sinh (x : β) : arsinh (sinh x) = x :=
rightInverse_of_injective_of_leftInverse sinh_injective sinh_arsinh x
#align real.arsinh_sinh Real.arsinh_sinh
@[simps]
def sinhEquiv : β β β where
toFun := sinh
invFun := arsinh
left_inv := arsinh_sinh
right_inv := sinh_arsinh
#align real.sinh_equiv Real.sinhEquiv
@[simps! (config := .asFn)]
def sinhOrderIso : β βo β where
toEquiv := sinhEquiv
map_rel_iff' := @sinh_le_sinh
#align real.sinh_order_iso Real.sinhOrderIso
@[simps! (config := .asFn)]
def sinhHomeomorph : β ββ β :=
sinhOrderIso.toHomeomorph
#align real.sinh_homeomorph Real.sinhHomeomorph
theorem arsinh_bijective : Bijective arsinh :=
sinhEquiv.symm.bijective
#align real.arsinh_bijective Real.arsinh_bijective
theorem arsinh_injective : Injective arsinh :=
sinhEquiv.symm.injective
#align real.arsinh_injective Real.arsinh_injective
theorem arsinh_surjective : Surjective arsinh :=
sinhEquiv.symm.surjective
#align real.arsinh_surjective Real.arsinh_surjective
theorem arsinh_strictMono : StrictMono arsinh :=
sinhOrderIso.symm.strictMono
#align real.arsinh_strict_mono Real.arsinh_strictMono
@[simp]
theorem arsinh_inj : arsinh x = arsinh y β x = y :=
arsinh_injective.eq_iff
#align real.arsinh_inj Real.arsinh_inj
@[simp]
theorem arsinh_le_arsinh : arsinh x β€ arsinh y β x β€ y :=
sinhOrderIso.symm.le_iff_le
#align real.arsinh_le_arsinh Real.arsinh_le_arsinh
@[gcongr] protected alias β¨_, GCongr.arsinh_le_arsinhβ© := arsinh_le_arsinh
@[simp]
theorem arsinh_lt_arsinh : arsinh x < arsinh y β x < y :=
sinhOrderIso.symm.lt_iff_lt
#align real.arsinh_lt_arsinh Real.arsinh_lt_arsinh
@[simp]
theorem arsinh_eq_zero_iff : arsinh x = 0 β x = 0 :=
arsinh_injective.eq_iff' arsinh_zero
#align real.arsinh_eq_zero_iff Real.arsinh_eq_zero_iff
@[simp]
| Mathlib/Analysis/SpecialFunctions/Arsinh.lean | 164 | 164 | theorem arsinh_nonneg_iff : 0 β€ arsinh x β 0 β€ x := by | rw [β sinh_le_sinh, sinh_zero, sinh_arsinh]
| 1 |
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}
| Mathlib/Combinatorics/SimpleGraph/Density.lean | 57 | 58 | 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]
| 1 |
import Mathlib.Data.Nat.Choose.Basic
import Mathlib.Data.Nat.Factorial.Cast
#align_import data.nat.choose.cast from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496"
open Nat
variable (K : Type*) [DivisionRing K] [CharZero K]
namespace Nat
theorem cast_choose {a b : β} (h : a β€ b) : (b.choose a : K) = b ! / (a ! * (b - a)!) := by
have : β {n : β}, (n ! : K) β 0 := Nat.cast_ne_zero.2 (factorial_ne_zero _)
rw [eq_div_iff_mul_eq (mul_ne_zero this this)]
rw_mod_cast [β mul_assoc, choose_mul_factorial_mul_factorial h]
#align nat.cast_choose Nat.cast_choose
| Mathlib/Data/Nat/Choose/Cast.lean | 31 | 32 | theorem cast_add_choose {a b : β} : ((a + b).choose a : K) = (a + b)! / (a ! * b !) := by |
rw [cast_choose K (_root_.le_add_right le_rfl), add_tsub_cancel_left]
| 1 |
import Mathlib.Data.Nat.Defs
import Mathlib.Tactic.GCongr.Core
import Mathlib.Tactic.Common
import Mathlib.Tactic.Monotonicity.Attr
#align_import data.nat.factorial.basic from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105"
namespace Nat
def factorial : β β β
| 0 => 1
| succ n => succ n * factorial n
#align nat.factorial Nat.factorial
scoped notation:10000 n "!" => Nat.factorial n
section DescFactorial
def descFactorial (n : β) : β β β
| 0 => 1
| k + 1 => (n - k) * descFactorial n k
#align nat.desc_factorial Nat.descFactorial
@[simp]
theorem descFactorial_zero (n : β) : n.descFactorial 0 = 1 :=
rfl
#align nat.desc_factorial_zero Nat.descFactorial_zero
@[simp]
theorem descFactorial_succ (n k : β) : n.descFactorial (k + 1) = (n - k) * n.descFactorial k :=
rfl
#align nat.desc_factorial_succ Nat.descFactorial_succ
| Mathlib/Data/Nat/Factorial/Basic.lean | 340 | 341 | theorem zero_descFactorial_succ (k : β) : (0 : β).descFactorial (k + 1) = 0 := by |
rw [descFactorial_succ, Nat.zero_sub, Nat.zero_mul]
| 1 |
import Mathlib.Algebra.Order.Monoid.Defs
import Mathlib.Algebra.Order.Sub.Defs
import Mathlib.Util.AssertExists
#align_import algebra.order.group.defs from "leanprover-community/mathlib"@"b599f4e4e5cf1fbcb4194503671d3d9e569c1fce"
open Function
universe u
variable {Ξ± : Type u}
class OrderedAddCommGroup (Ξ± : Type u) extends AddCommGroup Ξ±, PartialOrder Ξ± where
protected add_le_add_left : β a b : Ξ±, a β€ b β β c : Ξ±, c + a β€ c + b
#align ordered_add_comm_group OrderedAddCommGroup
class OrderedCommGroup (Ξ± : Type u) extends CommGroup Ξ±, PartialOrder Ξ± where
protected mul_le_mul_left : β a b : Ξ±, a β€ b β β c : Ξ±, c * a β€ c * b
#align ordered_comm_group OrderedCommGroup
attribute [to_additive] OrderedCommGroup
@[to_additive]
instance OrderedCommGroup.to_covariantClass_left_le (Ξ± : Type u) [OrderedCommGroup Ξ±] :
CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·) where
elim a b c bc := OrderedCommGroup.mul_le_mul_left b c bc a
#align ordered_comm_group.to_covariant_class_left_le OrderedCommGroup.to_covariantClass_left_le
#align ordered_add_comm_group.to_covariant_class_left_le OrderedAddCommGroup.to_covariantClass_left_le
-- See note [lower instance priority]
@[to_additive OrderedAddCommGroup.toOrderedCancelAddCommMonoid]
instance (priority := 100) OrderedCommGroup.toOrderedCancelCommMonoid [OrderedCommGroup Ξ±] :
OrderedCancelCommMonoid Ξ± :=
{ βΉOrderedCommGroup Ξ±βΊ with le_of_mul_le_mul_left := fun a b c β¦ le_of_mul_le_mul_left' }
#align ordered_comm_group.to_ordered_cancel_comm_monoid OrderedCommGroup.toOrderedCancelCommMonoid
#align ordered_add_comm_group.to_ordered_cancel_add_comm_monoid OrderedAddCommGroup.toOrderedCancelAddCommMonoid
example (Ξ± : Type u) [OrderedAddCommGroup Ξ±] : CovariantClass Ξ± Ξ± (swap (Β· + Β·)) (Β· < Β·) :=
IsRightCancelAdd.covariant_swap_add_lt_of_covariant_swap_add_le Ξ±
-- Porting note: this instance is not used,
-- and causes timeouts after lean4#2210.
-- It was introduced in https://github.com/leanprover-community/mathlib/pull/17564
-- but without the motivation clearly explained.
@[to_additive "A choice-free shortcut instance."]
theorem OrderedCommGroup.to_contravariantClass_left_le (Ξ± : Type u) [OrderedCommGroup Ξ±] :
ContravariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·) where
elim a b c bc := by simpa using mul_le_mul_left' bc aβ»ΒΉ
#align ordered_comm_group.to_contravariant_class_left_le OrderedCommGroup.to_contravariantClass_left_le
#align ordered_add_comm_group.to_contravariant_class_left_le OrderedAddCommGroup.to_contravariantClass_left_le
-- Porting note: this instance is not used,
-- and causes timeouts after lean4#2210.
-- See further explanation on `OrderedCommGroup.to_contravariantClass_left_le`.
@[to_additive "A choice-free shortcut instance."]
theorem OrderedCommGroup.to_contravariantClass_right_le (Ξ± : Type u) [OrderedCommGroup Ξ±] :
ContravariantClass Ξ± Ξ± (swap (Β· * Β·)) (Β· β€ Β·) where
elim a b c bc := by simpa using mul_le_mul_right' bc aβ»ΒΉ
#align ordered_comm_group.to_contravariant_class_right_le OrderedCommGroup.to_contravariantClass_right_le
#align ordered_add_comm_group.to_contravariant_class_right_le OrderedAddCommGroup.to_contravariantClass_right_le
section Group
variable [Group Ξ±]
section TypeclassesLeftLE
variable [LE Ξ±] [CovariantClass Ξ± Ξ± (Β· * Β·) (Β· β€ Β·)] {a b c d : Ξ±}
@[to_additive (attr := simp) "Uses `left` co(ntra)variant."]
theorem Left.inv_le_one_iff : aβ»ΒΉ β€ 1 β 1 β€ a := by
rw [β mul_le_mul_iff_left a]
simp
#align left.inv_le_one_iff Left.inv_le_one_iff
#align left.neg_nonpos_iff Left.neg_nonpos_iff
@[to_additive (attr := simp) "Uses `left` co(ntra)variant."]
theorem Left.one_le_inv_iff : 1 β€ aβ»ΒΉ β a β€ 1 := by
rw [β mul_le_mul_iff_left a]
simp
#align left.one_le_inv_iff Left.one_le_inv_iff
#align left.nonneg_neg_iff Left.nonneg_neg_iff
@[to_additive (attr := simp)]
theorem le_inv_mul_iff_mul_le : b β€ aβ»ΒΉ * c β a * b β€ c := by
rw [β mul_le_mul_iff_left a]
simp
#align le_inv_mul_iff_mul_le le_inv_mul_iff_mul_le
#align le_neg_add_iff_add_le le_neg_add_iff_add_le
@[to_additive (attr := simp)]
| Mathlib/Algebra/Order/Group/Defs.lean | 120 | 121 | theorem inv_mul_le_iff_le_mul : bβ»ΒΉ * a β€ c β a β€ b * c := by |
rw [β mul_le_mul_iff_left b, mul_inv_cancel_left]
| 1 |
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 _ _
section get
@[simp] theorem inl_getLeft : β (x : Ξ± β Ξ²) (h : x.isLeft), inl (x.getLeft h) = x
| inl _, _ => rfl
@[simp] theorem inr_getRight : β (x : Ξ± β Ξ²) (h : x.isRight), inr (x.getRight h) = x
| inr _, _ => rfl
@[simp] theorem getLeft?_eq_none_iff {x : Ξ± β Ξ²} : x.getLeft? = none β x.isRight := by
cases x <;> simp only [getLeft?, isRight, eq_self_iff_true]
@[simp] theorem getRight?_eq_none_iff {x : Ξ± β Ξ²} : x.getRight? = none β x.isLeft := by
cases x <;> simp only [getRight?, isLeft, eq_self_iff_true]
theorem eq_left_getLeft_of_isLeft : β {x : Ξ± β Ξ²} (h : x.isLeft), x = inl (x.getLeft h)
| inl _, _ => rfl
@[simp] theorem getLeft_eq_iff (h : x.isLeft) : x.getLeft h = a β x = inl a := by
cases x <;> simp at h β’
theorem eq_right_getRight_of_isRight : β {x : Ξ± β Ξ²} (h : x.isRight), x = inr (x.getRight h)
| inr _, _ => rfl
@[simp] theorem getRight_eq_iff (h : x.isRight) : x.getRight h = b β x = inr b := by
cases x <;> simp at h β’
@[simp] theorem getLeft?_eq_some_iff : x.getLeft? = some a β x = inl a := by
cases x <;> simp only [getLeft?, Option.some.injEq, inl.injEq]
@[simp] theorem getRight?_eq_some_iff : x.getRight? = some b β x = inr b := by
cases x <;> simp only [getRight?, Option.some.injEq, inr.injEq]
@[simp] theorem bnot_isLeft (x : Ξ± β Ξ²) : !x.isLeft = x.isRight := by cases x <;> rfl
@[simp] theorem isLeft_eq_false {x : Ξ± β Ξ²} : x.isLeft = false β x.isRight := by cases x <;> simp
theorem not_isLeft {x : Ξ± β Ξ²} : Β¬x.isLeft β x.isRight := by simp
@[simp] theorem bnot_isRight (x : Ξ± β Ξ²) : !x.isRight = x.isLeft := by cases x <;> rfl
@[simp] theorem isRight_eq_false {x : Ξ± β Ξ²} : x.isRight = false β x.isLeft := by cases x <;> simp
| .lake/packages/batteries/Batteries/Data/Sum/Lemmas.lean | 81 | 81 | theorem not_isRight {x : Ξ± β Ξ²} : Β¬x.isRight β x.isLeft := by | simp
| 1 |
import Mathlib.Algebra.Order.Ring.Basic
import Mathlib.Computability.Primrec
import Mathlib.Tactic.Ring
import Mathlib.Tactic.Linarith
#align_import computability.ackermann from "leanprover-community/mathlib"@"9b2660e1b25419042c8da10bf411aa3c67f14383"
open Nat
def ack : β β β β β
| 0, n => n + 1
| m + 1, 0 => ack m 1
| m + 1, n + 1 => ack m (ack (m + 1) n)
#align ack ack
@[simp]
theorem ack_zero (n : β) : ack 0 n = n + 1 := by rw [ack]
#align ack_zero ack_zero
@[simp]
| Mathlib/Computability/Ackermann.lean | 74 | 74 | theorem ack_succ_zero (m : β) : ack (m + 1) 0 = ack m 1 := by | rw [ack]
| 1 |
import Mathlib.Algebra.Group.Prod
import Mathlib.Order.Cover
#align_import algebra.support from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
assert_not_exists MonoidWithZero
open Set
namespace Function
variable {Ξ± Ξ² A B M N P G : Type*}
section One
variable [One M] [One N] [One P]
@[to_additive "`support` of a function is the set of points `x` such that `f x β 0`."]
def mulSupport (f : Ξ± β M) : Set Ξ± := {x | f x β 1}
#align function.mul_support Function.mulSupport
#align function.support Function.support
@[to_additive]
theorem mulSupport_eq_preimage (f : Ξ± β M) : mulSupport f = f β»ΒΉ' {1}αΆ :=
rfl
#align function.mul_support_eq_preimage Function.mulSupport_eq_preimage
#align function.support_eq_preimage Function.support_eq_preimage
@[to_additive]
theorem nmem_mulSupport {f : Ξ± β M} {x : Ξ±} : x β mulSupport f β f x = 1 :=
not_not
#align function.nmem_mul_support Function.nmem_mulSupport
#align function.nmem_support Function.nmem_support
@[to_additive]
theorem compl_mulSupport {f : Ξ± β M} : (mulSupport f)αΆ = { x | f x = 1 } :=
ext fun _ => nmem_mulSupport
#align function.compl_mul_support Function.compl_mulSupport
#align function.compl_support Function.compl_support
@[to_additive (attr := simp)]
theorem mem_mulSupport {f : Ξ± β M} {x : Ξ±} : x β mulSupport f β f x β 1 :=
Iff.rfl
#align function.mem_mul_support Function.mem_mulSupport
#align function.mem_support Function.mem_support
@[to_additive (attr := simp)]
theorem mulSupport_subset_iff {f : Ξ± β M} {s : Set Ξ±} : mulSupport f β s β β x, f x β 1 β x β s :=
Iff.rfl
#align function.mul_support_subset_iff Function.mulSupport_subset_iff
#align function.support_subset_iff Function.support_subset_iff
@[to_additive]
theorem mulSupport_subset_iff' {f : Ξ± β M} {s : Set Ξ±} :
mulSupport f β s β β x β s, f x = 1 :=
forall_congr' fun _ => not_imp_comm
#align function.mul_support_subset_iff' Function.mulSupport_subset_iff'
#align function.support_subset_iff' Function.support_subset_iff'
@[to_additive]
theorem mulSupport_eq_iff {f : Ξ± β M} {s : Set Ξ±} :
mulSupport f = s β (β x, x β s β f x β 1) β§ β x, x β s β f x = 1 := by
simp (config := { contextual := true }) only [ext_iff, mem_mulSupport, ne_eq, iff_def,
not_imp_comm, and_comm, forall_and]
#align function.mul_support_eq_iff Function.mulSupport_eq_iff
#align function.support_eq_iff Function.support_eq_iff
@[to_additive]
theorem ext_iff_mulSupport {f g : Ξ± β M} :
f = g β f.mulSupport = g.mulSupport β§ β x β f.mulSupport, f x = g x :=
β¨fun h β¦ h βΈ β¨rfl, fun _ _ β¦ rflβ©, fun β¨hβ, hββ© β¦ funext fun x β¦ by
if hx : x β f.mulSupport then exact hβ x hx
else rw [nmem_mulSupport.1 hx, nmem_mulSupport.1 (mt (Set.ext_iff.1 hβ x).2 hx)]β©
@[to_additive]
theorem mulSupport_update_of_ne_one [DecidableEq Ξ±] (f : Ξ± β M) (x : Ξ±) {y : M} (hy : y β 1) :
mulSupport (update f x y) = insert x (mulSupport f) := by
ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*]
@[to_additive]
theorem mulSupport_update_one [DecidableEq Ξ±] (f : Ξ± β M) (x : Ξ±) :
mulSupport (update f x 1) = mulSupport f \ {x} := by
ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*]
@[to_additive]
| Mathlib/Algebra/Group/Support.lean | 98 | 100 | theorem mulSupport_update_eq_ite [DecidableEq Ξ±] [DecidableEq M] (f : Ξ± β M) (x : Ξ±) (y : M) :
mulSupport (update f x y) = if y = 1 then mulSupport f \ {x} else insert x (mulSupport f) := by |
rcases eq_or_ne y 1 with rfl | hy <;> simp [mulSupport_update_one, mulSupport_update_of_ne_one, *]
| 1 |
import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra
import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra
import Mathlib.Algebra.Lie.UniversalEnveloping
import Mathlib.GroupTheory.GroupAction.Ring
#align_import algebra.lie.free from "leanprover-community/mathlib"@"841ac1a3d9162bf51c6327812ecb6e5e71883ac4"
universe u v w
noncomputable section
variable (R : Type u) (X : Type v) [CommRing R]
local notation "lib" => FreeNonUnitalNonAssocAlgebra
local notation "lib.lift" => FreeNonUnitalNonAssocAlgebra.lift
local notation "lib.of" => FreeNonUnitalNonAssocAlgebra.of
local notation "lib.lift_of_apply" => FreeNonUnitalNonAssocAlgebra.lift_of_apply
local notation "lib.lift_comp_of" => FreeNonUnitalNonAssocAlgebra.lift_comp_of
namespace FreeLieAlgebra
inductive Rel : lib R X β lib R X β Prop
| lie_self (a : lib R X) : Rel (a * a) 0
| leibniz_lie (a b c : lib R X) : Rel (a * (b * c)) (a * b * c + b * (a * c))
| smul (t : R) {a b : lib R X} : Rel a b β Rel (t β’ a) (t β’ b)
| add_right {a b : lib R X} (c : lib R X) : Rel a b β Rel (a + c) (b + c)
| mul_left (a : lib R X) {b c : lib R X} : Rel b c β Rel (a * b) (a * c)
| mul_right {a b : lib R X} (c : lib R X) : Rel a b β Rel (a * c) (b * c)
#align free_lie_algebra.rel FreeLieAlgebra.Rel
variable {R X}
theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c) := by
rw [add_comm _ b, add_comm _ c]; exact h.add_right _
#align free_lie_algebra.rel.add_left FreeLieAlgebra.Rel.addLeft
theorem Rel.neg {a b : lib R X} (h : Rel R X a b) : Rel R X (-a) (-b) := by
simpa only [neg_one_smul] using h.smul (-1)
#align free_lie_algebra.rel.neg FreeLieAlgebra.Rel.neg
theorem Rel.subLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a - b) (a - c) := by
simpa only [sub_eq_add_neg] using h.neg.addLeft a
#align free_lie_algebra.rel.sub_left FreeLieAlgebra.Rel.subLeft
| Mathlib/Algebra/Lie/Free.lean | 99 | 100 | theorem Rel.subRight {a b : lib R X} (c : lib R X) (h : Rel R X a b) : Rel R X (a - c) (b - c) := by |
simpa only [sub_eq_add_neg] using h.add_right (-c)
| 1 |
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Algebra.Group.Aut
import Mathlib.Data.ZMod.Defs
import Mathlib.Tactic.Ring
#align_import algebra.quandle from "leanprover-community/mathlib"@"28aa996fc6fb4317f0083c4e6daf79878d81be33"
open MulOpposite
universe u v
class Shelf (Ξ± : Type u) where
act : Ξ± β Ξ± β Ξ±
self_distrib : β {x y z : Ξ±}, act x (act y z) = act (act x y) (act x z)
#align shelf Shelf
class UnitalShelf (Ξ± : Type u) extends Shelf Ξ±, One Ξ± :=
(one_act : β a : Ξ±, act 1 a = a)
(act_one : β a : Ξ±, act a 1 = a)
#align unital_shelf UnitalShelf
@[ext]
structure ShelfHom (Sβ : Type*) (Sβ : Type*) [Shelf Sβ] [Shelf Sβ] where
toFun : Sβ β Sβ
map_act' : β {x y : Sβ}, toFun (Shelf.act x y) = Shelf.act (toFun x) (toFun y)
#align shelf_hom ShelfHom
#align shelf_hom.ext_iff ShelfHom.ext_iff
#align shelf_hom.ext ShelfHom.ext
class Rack (Ξ± : Type u) extends Shelf Ξ± where
invAct : Ξ± β Ξ± β Ξ±
left_inv : β x, Function.LeftInverse (invAct x) (act x)
right_inv : β x, Function.RightInverse (invAct x) (act x)
#align rack Rack
scoped[Quandles] infixr:65 " β " => Shelf.act
scoped[Quandles] infixr:65 " ββ»ΒΉ " => Rack.invAct
scoped[Quandles] infixr:25 " ββ " => ShelfHom
open Quandles
namespace Rack
variable {R : Type*} [Rack R]
-- Porting note: No longer a need for `Rack.self_distrib`
export Shelf (self_distrib)
-- porting note, changed name to `act'` to not conflict with `Shelf.act`
def act' (x : R) : R β R where
toFun := Shelf.act x
invFun := invAct x
left_inv := left_inv x
right_inv := right_inv x
#align rack.act Rack.act'
@[simp]
theorem act'_apply (x y : R) : act' x y = x β y :=
rfl
#align rack.act_apply Rack.act'_apply
@[simp]
theorem act'_symm_apply (x y : R) : (act' x).symm y = x ββ»ΒΉ y :=
rfl
#align rack.act_symm_apply Rack.act'_symm_apply
@[simp]
theorem invAct_apply (x y : R) : (act' x)β»ΒΉ y = x ββ»ΒΉ y :=
rfl
#align rack.inv_act_apply Rack.invAct_apply
@[simp]
theorem invAct_act_eq (x y : R) : x ββ»ΒΉ x β y = y :=
left_inv x y
#align rack.inv_act_act_eq Rack.invAct_act_eq
@[simp]
theorem act_invAct_eq (x y : R) : x β x ββ»ΒΉ y = y :=
right_inv x y
#align rack.act_inv_act_eq Rack.act_invAct_eq
theorem left_cancel (x : R) {y y' : R} : x β y = x β y' β y = y' := by
constructor
Β· apply (act' x).injective
rintro rfl
rfl
#align rack.left_cancel Rack.left_cancel
theorem left_cancel_inv (x : R) {y y' : R} : x ββ»ΒΉ y = x ββ»ΒΉ y' β y = y' := by
constructor
Β· apply (act' x).symm.injective
rintro rfl
rfl
#align rack.left_cancel_inv Rack.left_cancel_inv
theorem self_distrib_inv {x y z : R} : x ββ»ΒΉ y ββ»ΒΉ z = (x ββ»ΒΉ y) ββ»ΒΉ x ββ»ΒΉ z := by
rw [β left_cancel (x ββ»ΒΉ y), right_inv, β left_cancel x, right_inv, self_distrib]
repeat' rw [right_inv]
#align rack.self_distrib_inv Rack.self_distrib_inv
theorem ad_conj {R : Type*} [Rack R] (x y : R) : act' (x β y) = act' x * act' y * (act' x)β»ΒΉ := by
rw [eq_mul_inv_iff_mul_eq]; ext z
apply self_distrib.symm
#align rack.ad_conj Rack.ad_conj
instance oppositeRack : Rack Rα΅α΅α΅ where
act x y := op (invAct (unop x) (unop y))
self_distrib := by
intro x y z
induction x using MulOpposite.rec'
induction y using MulOpposite.rec'
induction z using MulOpposite.rec'
simp only [op_inj, unop_op, op_unop]
rw [self_distrib_inv]
invAct x y := op (Shelf.act (unop x) (unop y))
left_inv := MulOpposite.rec' fun x => MulOpposite.rec' fun y => by simp
right_inv := MulOpposite.rec' fun x => MulOpposite.rec' fun y => by simp
#align rack.opposite_rack Rack.oppositeRack
@[simp]
theorem op_act_op_eq {x y : R} : op x β op y = op (x ββ»ΒΉ y) :=
rfl
#align rack.op_act_op_eq Rack.op_act_op_eq
@[simp]
theorem op_invAct_op_eq {x y : R} : op x ββ»ΒΉ op y = op (x β y) :=
rfl
#align rack.op_inv_act_op_eq Rack.op_invAct_op_eq
@[simp]
| Mathlib/Algebra/Quandle.lean | 283 | 283 | theorem self_act_act_eq {x y : R} : (x β x) β y = x β y := by | rw [β right_inv x y, β self_distrib]
| 1 |
import Mathlib.Algebra.Algebra.Subalgebra.Pointwise
import Mathlib.AlgebraicGeometry.PrimeSpectrum.Maximal
import Mathlib.AlgebraicGeometry.PrimeSpectrum.Noetherian
import Mathlib.RingTheory.ChainOfDivisors
import Mathlib.RingTheory.DedekindDomain.Basic
import Mathlib.RingTheory.FractionalIdeal.Operations
#align_import ring_theory.dedekind_domain.ideal from "leanprover-community/mathlib"@"2bbc7e3884ba234309d2a43b19144105a753292e"
variable (R A K : Type*) [CommRing R] [CommRing A] [Field K]
open scoped nonZeroDivisors Polynomial
section Inverse
namespace FractionalIdeal
variable {Rβ : Type*} [CommRing Rβ] [IsDomain Rβ] [Algebra Rβ K] [IsFractionRing Rβ K]
variable {I J : FractionalIdeal Rββ° K}
noncomputable instance : Inv (FractionalIdeal Rββ° K) := β¨fun I => 1 / Iβ©
theorem inv_eq : Iβ»ΒΉ = 1 / I := rfl
#align fractional_ideal.inv_eq FractionalIdeal.inv_eq
theorem inv_zero' : (0 : FractionalIdeal Rββ° K)β»ΒΉ = 0 := div_zero
#align fractional_ideal.inv_zero' FractionalIdeal.inv_zero'
theorem inv_nonzero {J : FractionalIdeal Rββ° K} (h : J β 0) :
Jβ»ΒΉ = β¨(1 : FractionalIdeal Rββ° K) / J, fractional_div_of_nonzero hβ© := div_nonzero h
#align fractional_ideal.inv_nonzero FractionalIdeal.inv_nonzero
theorem coe_inv_of_nonzero {J : FractionalIdeal Rββ° K} (h : J β 0) :
(βJβ»ΒΉ : Submodule Rβ K) = IsLocalization.coeSubmodule K β€ / (J : Submodule Rβ K) := by
simp_rw [inv_nonzero _ h, coe_one, coe_mk, IsLocalization.coeSubmodule_top]
#align fractional_ideal.coe_inv_of_nonzero FractionalIdeal.coe_inv_of_nonzero
variable {K}
theorem mem_inv_iff (hI : I β 0) {x : K} : x β Iβ»ΒΉ β β y β I, x * y β (1 : FractionalIdeal Rββ° K) :=
mem_div_iff_of_nonzero hI
#align fractional_ideal.mem_inv_iff FractionalIdeal.mem_inv_iff
theorem inv_anti_mono (hI : I β 0) (hJ : J β 0) (hIJ : I β€ J) : Jβ»ΒΉ β€ Iβ»ΒΉ := by
-- Porting note: in Lean3, introducing `x` would just give `x β Jβ»ΒΉ β x β Iβ»ΒΉ`, but
-- in Lean4, it goes all the way down to the subtypes
intro x
simp only [val_eq_coe, mem_coe, mem_inv_iff hJ, mem_inv_iff hI]
exact fun h y hy => h y (hIJ hy)
#align fractional_ideal.inv_anti_mono FractionalIdeal.inv_anti_mono
theorem le_self_mul_inv {I : FractionalIdeal Rββ° K} (hI : I β€ (1 : FractionalIdeal Rββ° K)) :
I β€ I * Iβ»ΒΉ :=
le_self_mul_one_div hI
#align fractional_ideal.le_self_mul_inv FractionalIdeal.le_self_mul_inv
variable (K)
theorem coe_ideal_le_self_mul_inv (I : Ideal Rβ) :
(I : FractionalIdeal Rββ° K) β€ I * (I : FractionalIdeal Rββ° K)β»ΒΉ :=
le_self_mul_inv coeIdeal_le_one
#align fractional_ideal.coe_ideal_le_self_mul_inv FractionalIdeal.coe_ideal_le_self_mul_inv
theorem right_inverse_eq (I J : FractionalIdeal Rββ° K) (h : I * J = 1) : J = Iβ»ΒΉ := by
have hI : I β 0 := ne_zero_of_mul_eq_one I J h
suffices h' : I * (1 / I) = 1 from
congr_arg Units.inv <| @Units.ext _ _ (Units.mkOfMulEqOne _ _ h) (Units.mkOfMulEqOne _ _ h') rfl
apply le_antisymm
Β· apply mul_le.mpr _
intro x hx y hy
rw [mul_comm]
exact (mem_div_iff_of_nonzero hI).mp hy x hx
rw [β h]
apply mul_left_mono I
apply (le_div_iff_of_nonzero hI).mpr _
intro y hy x hx
rw [mul_comm]
exact mul_mem_mul hx hy
#align fractional_ideal.right_inverse_eq FractionalIdeal.right_inverse_eq
theorem mul_inv_cancel_iff {I : FractionalIdeal Rββ° K} : I * Iβ»ΒΉ = 1 β β J, I * J = 1 :=
β¨fun h => β¨Iβ»ΒΉ, hβ©, fun β¨J, hJβ© => by rwa [β right_inverse_eq K I J hJ]β©
#align fractional_ideal.mul_inv_cancel_iff FractionalIdeal.mul_inv_cancel_iff
theorem mul_inv_cancel_iff_isUnit {I : FractionalIdeal Rββ° K} : I * Iβ»ΒΉ = 1 β IsUnit I :=
(mul_inv_cancel_iff K).trans isUnit_iff_exists_inv.symm
#align fractional_ideal.mul_inv_cancel_iff_is_unit FractionalIdeal.mul_inv_cancel_iff_isUnit
variable {K' : Type*} [Field K'] [Algebra Rβ K'] [IsFractionRing Rβ K']
@[simp]
| Mathlib/RingTheory/DedekindDomain/Ideal.lean | 136 | 137 | theorem map_inv (I : FractionalIdeal Rββ° K) (h : K ββ[Rβ] K') :
Iβ»ΒΉ.map (h : K ββ[Rβ] K') = (I.map h)β»ΒΉ := by | rw [inv_eq, map_div, map_one, inv_eq]
| 1 |
import Mathlib.Order.Interval.Set.UnorderedInterval
import Mathlib.Algebra.Order.Interval.Set.Monoid
import Mathlib.Data.Set.Pointwise.Basic
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Group.MinMax
#align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2"
open Interval Pointwise
variable {Ξ± : Type*}
namespace Set
section OrderedAddCommGroup
variable [OrderedAddCommGroup Ξ±] (a b c : Ξ±)
@[simp]
theorem preimage_const_add_Ici : (fun x => a + x) β»ΒΉ' Ici b = Ici (b - a) :=
ext fun _x => sub_le_iff_le_add'.symm
#align set.preimage_const_add_Ici Set.preimage_const_add_Ici
@[simp]
theorem preimage_const_add_Ioi : (fun x => a + x) β»ΒΉ' Ioi b = Ioi (b - a) :=
ext fun _x => sub_lt_iff_lt_add'.symm
#align set.preimage_const_add_Ioi Set.preimage_const_add_Ioi
@[simp]
theorem preimage_const_add_Iic : (fun x => a + x) β»ΒΉ' Iic b = Iic (b - a) :=
ext fun _x => le_sub_iff_add_le'.symm
#align set.preimage_const_add_Iic Set.preimage_const_add_Iic
@[simp]
theorem preimage_const_add_Iio : (fun x => a + x) β»ΒΉ' Iio b = Iio (b - a) :=
ext fun _x => lt_sub_iff_add_lt'.symm
#align set.preimage_const_add_Iio Set.preimage_const_add_Iio
@[simp]
theorem preimage_const_add_Icc : (fun x => a + x) β»ΒΉ' Icc b c = Icc (b - a) (c - a) := by
simp [β Ici_inter_Iic]
#align set.preimage_const_add_Icc Set.preimage_const_add_Icc
@[simp]
theorem preimage_const_add_Ico : (fun x => a + x) β»ΒΉ' Ico b c = Ico (b - a) (c - a) := by
simp [β Ici_inter_Iio]
#align set.preimage_const_add_Ico Set.preimage_const_add_Ico
@[simp]
theorem preimage_const_add_Ioc : (fun x => a + x) β»ΒΉ' Ioc b c = Ioc (b - a) (c - a) := by
simp [β Ioi_inter_Iic]
#align set.preimage_const_add_Ioc Set.preimage_const_add_Ioc
@[simp]
theorem preimage_const_add_Ioo : (fun x => a + x) β»ΒΉ' Ioo b c = Ioo (b - a) (c - a) := by
simp [β Ioi_inter_Iio]
#align set.preimage_const_add_Ioo Set.preimage_const_add_Ioo
@[simp]
theorem preimage_add_const_Ici : (fun x => x + a) β»ΒΉ' Ici b = Ici (b - a) :=
ext fun _x => sub_le_iff_le_add.symm
#align set.preimage_add_const_Ici Set.preimage_add_const_Ici
@[simp]
theorem preimage_add_const_Ioi : (fun x => x + a) β»ΒΉ' Ioi b = Ioi (b - a) :=
ext fun _x => sub_lt_iff_lt_add.symm
#align set.preimage_add_const_Ioi Set.preimage_add_const_Ioi
@[simp]
theorem preimage_add_const_Iic : (fun x => x + a) β»ΒΉ' Iic b = Iic (b - a) :=
ext fun _x => le_sub_iff_add_le.symm
#align set.preimage_add_const_Iic Set.preimage_add_const_Iic
@[simp]
theorem preimage_add_const_Iio : (fun x => x + a) β»ΒΉ' Iio b = Iio (b - a) :=
ext fun _x => lt_sub_iff_add_lt.symm
#align set.preimage_add_const_Iio Set.preimage_add_const_Iio
@[simp]
theorem preimage_add_const_Icc : (fun x => x + a) β»ΒΉ' Icc b c = Icc (b - a) (c - a) := by
simp [β Ici_inter_Iic]
#align set.preimage_add_const_Icc Set.preimage_add_const_Icc
@[simp]
theorem preimage_add_const_Ico : (fun x => x + a) β»ΒΉ' Ico b c = Ico (b - a) (c - a) := by
simp [β Ici_inter_Iio]
#align set.preimage_add_const_Ico Set.preimage_add_const_Ico
@[simp]
theorem preimage_add_const_Ioc : (fun x => x + a) β»ΒΉ' Ioc b c = Ioc (b - a) (c - a) := by
simp [β Ioi_inter_Iic]
#align set.preimage_add_const_Ioc Set.preimage_add_const_Ioc
@[simp]
theorem preimage_add_const_Ioo : (fun x => x + a) β»ΒΉ' Ioo b c = Ioo (b - a) (c - a) := by
simp [β Ioi_inter_Iio]
#align set.preimage_add_const_Ioo Set.preimage_add_const_Ioo
@[simp]
theorem preimage_neg_Ici : -Ici a = Iic (-a) :=
ext fun _x => le_neg
#align set.preimage_neg_Ici Set.preimage_neg_Ici
@[simp]
theorem preimage_neg_Iic : -Iic a = Ici (-a) :=
ext fun _x => neg_le
#align set.preimage_neg_Iic Set.preimage_neg_Iic
@[simp]
theorem preimage_neg_Ioi : -Ioi a = Iio (-a) :=
ext fun _x => lt_neg
#align set.preimage_neg_Ioi Set.preimage_neg_Ioi
@[simp]
theorem preimage_neg_Iio : -Iio a = Ioi (-a) :=
ext fun _x => neg_lt
#align set.preimage_neg_Iio Set.preimage_neg_Iio
@[simp]
theorem preimage_neg_Icc : -Icc a b = Icc (-b) (-a) := by simp [β Ici_inter_Iic, inter_comm]
#align set.preimage_neg_Icc Set.preimage_neg_Icc
@[simp]
| Mathlib/Data/Set/Pointwise/Interval.lean | 241 | 242 | theorem preimage_neg_Ico : -Ico a b = Ioc (-b) (-a) := by |
simp [β Ici_inter_Iio, β Ioi_inter_Iic, inter_comm]
| 1 |
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Int.Log
#align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690"
open Set Filter Function
open Topology
noncomputable section
namespace Real
variable {b x y : β}
-- @[pp_nodot] -- Porting note: removed
noncomputable def logb (b x : β) : β :=
log x / log b
#align real.logb Real.logb
theorem log_div_log : log x / log b = logb b x :=
rfl
#align real.log_div_log Real.log_div_log
@[simp]
theorem logb_zero : logb b 0 = 0 := by simp [logb]
#align real.logb_zero Real.logb_zero
@[simp]
theorem logb_one : logb b 1 = 0 := by simp [logb]
#align real.logb_one Real.logb_one
@[simp]
lemma logb_self_eq_one (hb : 1 < b) : logb b b = 1 :=
div_self (log_pos hb).ne'
lemma logb_self_eq_one_iff : logb b b = 1 β b β 0 β§ b β 1 β§ b β -1 :=
Iff.trans β¨fun h h' => by simp [logb, h'] at h, div_selfβ© log_ne_zero
@[simp]
| Mathlib/Analysis/SpecialFunctions/Log/Base.lean | 64 | 64 | theorem logb_abs (x : β) : logb b |x| = logb b x := by | rw [logb, logb, log_abs]
| 1 |
import Mathlib.Control.Monad.Basic
import Mathlib.Control.Monad.Writer
import Mathlib.Init.Control.Lawful
#align_import control.monad.cont from "leanprover-community/mathlib"@"d6814c584384ddf2825ff038e868451a7c956f31"
universe u v w uβ uβ vβ vβ
structure MonadCont.Label (Ξ± : Type w) (m : Type u β Type v) (Ξ² : Type u) where
apply : Ξ± β m Ξ²
#align monad_cont.label MonadCont.Label
def MonadCont.goto {Ξ± Ξ²} {m : Type u β Type v} (f : MonadCont.Label Ξ± m Ξ²) (x : Ξ±) :=
f.apply x
#align monad_cont.goto MonadCont.goto
class MonadCont (m : Type u β Type v) where
callCC : β {Ξ± Ξ²}, (MonadCont.Label Ξ± m Ξ² β m Ξ±) β m Ξ±
#align monad_cont MonadCont
open MonadCont
class LawfulMonadCont (m : Type u β Type v) [Monad m] [MonadCont m]
extends LawfulMonad m : Prop where
callCC_bind_right {Ξ± Ο Ξ³} (cmd : m Ξ±) (next : Label Ο m Ξ³ β Ξ± β m Ο) :
(callCC fun f => cmd >>= next f) = cmd >>= fun x => callCC fun f => next f x
callCC_bind_left {Ξ±} (Ξ²) (x : Ξ±) (dead : Label Ξ± m Ξ² β Ξ² β m Ξ±) :
(callCC fun f : Label Ξ± m Ξ² => goto f x >>= dead f) = pure x
callCC_dummy {Ξ± Ξ²} (dummy : m Ξ±) : (callCC fun _ : Label Ξ± m Ξ² => dummy) = dummy
#align is_lawful_monad_cont LawfulMonadCont
export LawfulMonadCont (callCC_bind_right callCC_bind_left callCC_dummy)
def ContT (r : Type u) (m : Type u β Type v) (Ξ± : Type w) :=
(Ξ± β m r) β m r
#align cont_t ContT
abbrev Cont (r : Type u) (Ξ± : Type w) :=
ContT r id Ξ±
#align cont Cont
variable {m : Type u β Type v} [Monad m]
def ExceptT.mkLabel {Ξ± Ξ² Ξ΅} : Label (Except.{u, u} Ξ΅ Ξ±) m Ξ² β Label Ξ± (ExceptT Ξ΅ m) Ξ²
| β¨fβ© => β¨fun a => monadLift <| f (Except.ok a)β©
#align except_t.mk_label ExceptTβ.mkLabel
theorem ExceptT.goto_mkLabel {Ξ± Ξ² Ξ΅ : Type _} (x : Label (Except.{u, u} Ξ΅ Ξ±) m Ξ²) (i : Ξ±) :
goto (ExceptT.mkLabel x) i = ExceptT.mk (Except.ok <$> goto x (Except.ok i)) := by
cases x; rfl
#align except_t.goto_mk_label ExceptTβ.goto_mkLabel
nonrec def ExceptT.callCC {Ξ΅} [MonadCont m] {Ξ± Ξ² : Type _}
(f : Label Ξ± (ExceptT Ξ΅ m) Ξ² β ExceptT Ξ΅ m Ξ±) : ExceptT Ξ΅ m Ξ± :=
ExceptT.mk (callCC fun x : Label _ m Ξ² => ExceptT.run <| f (ExceptT.mkLabel x))
#align except_t.call_cc ExceptTβ.callCC
instance {Ξ΅} [MonadCont m] : MonadCont (ExceptT Ξ΅ m) where
callCC := ExceptT.callCC
instance {Ξ΅} [MonadCont m] [LawfulMonadCont m] : LawfulMonadCont (ExceptT Ξ΅ m) where
callCC_bind_right := by
intros; simp only [callCC, ExceptT.callCC, ExceptT.run_bind, callCC_bind_right]; ext
dsimp
congr with β¨β© <;> simp [ExceptT.bindCont, @callCC_dummy m _]
callCC_bind_left := by
intros
simp only [callCC, ExceptT.callCC, ExceptT.goto_mkLabel, map_eq_bind_pure_comp, Function.comp,
ExceptT.run_bind, ExceptT.run_mk, bind_assoc, pure_bind, @callCC_bind_left m _]
ext; rfl
callCC_dummy := by intros; simp only [callCC, ExceptT.callCC, @callCC_dummy m _]; ext; rfl
def OptionT.mkLabel {Ξ± Ξ²} : Label (Option.{u} Ξ±) m Ξ² β Label Ξ± (OptionT m) Ξ²
| β¨fβ© => β¨fun a => monadLift <| f (some a)β©
#align option_t.mk_label OptionTβ.mkLabel
theorem OptionT.goto_mkLabel {Ξ± Ξ² : Type _} (x : Label (Option.{u} Ξ±) m Ξ²) (i : Ξ±) :
goto (OptionT.mkLabel x) i = OptionT.mk (goto x (some i) >>= fun a => pure (some a)) :=
rfl
#align option_t.goto_mk_label OptionTβ.goto_mkLabel
nonrec def OptionT.callCC [MonadCont m] {Ξ± Ξ² : Type _} (f : Label Ξ± (OptionT m) Ξ² β OptionT m Ξ±) :
OptionT m Ξ± :=
OptionT.mk (callCC fun x : Label _ m Ξ² => OptionT.run <| f (OptionT.mkLabel x) : m (Option Ξ±))
#align option_t.call_cc OptionTβ.callCC
instance [MonadCont m] : MonadCont (OptionT m) where
callCC := OptionT.callCC
instance [MonadCont m] [LawfulMonadCont m] : LawfulMonadCont (OptionT m) where
callCC_bind_right := by
intros; simp only [callCC, OptionT.callCC, OptionT.run_bind, callCC_bind_right]; ext
dsimp
congr with β¨β© <;> simp [@callCC_dummy m _]
callCC_bind_left := by
intros;
simp only [callCC, OptionT.callCC, OptionT.goto_mkLabel, OptionT.run_bind, OptionT.run_mk,
bind_assoc, pure_bind, @callCC_bind_left m _]
ext; rfl
callCC_dummy := by intros; simp only [callCC, OptionT.callCC, @callCC_dummy m _]; ext; rfl
def WriterT.mkLabel {Ξ± Ξ² Ο} [EmptyCollection Ο] : Label (Ξ± Γ Ο) m Ξ² β Label Ξ± (WriterT Ο m) Ξ²
| β¨fβ© => β¨fun a => monadLift <| f (a, β
)β©
def WriterT.mkLabel' {Ξ± Ξ² Ο} [Monoid Ο] : Label (Ξ± Γ Ο) m Ξ² β Label Ξ± (WriterT Ο m) Ξ²
| β¨fβ© => β¨fun a => monadLift <| f (a, 1)β©
#align writer_t.mk_label WriterTβ.mkLabel'
| Mathlib/Control/Monad/Cont.lean | 193 | 194 | theorem WriterT.goto_mkLabel {Ξ± Ξ² Ο : Type _} [EmptyCollection Ο] (x : Label (Ξ± Γ Ο) m Ξ²) (i : Ξ±) :
goto (WriterT.mkLabel x) i = monadLift (goto x (i, β
)) := by | cases x; rfl
| 1 |
import Mathlib.CategoryTheory.Subobject.Lattice
#align_import category_theory.subobject.limits from "leanprover-community/mathlib"@"956af7c76589f444f2e1313911bad16366ea476d"
universe v u
noncomputable section
open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Subobject Opposite
variable {C : Type u} [Category.{v} C] {X Y Z : C}
namespace CategoryTheory
namespace Limits
section Kernel
variable [HasZeroMorphisms C] (f : X βΆ Y) [HasKernel f]
abbrev kernelSubobject : Subobject X :=
Subobject.mk (kernel.ΞΉ f)
#align category_theory.limits.kernel_subobject CategoryTheory.Limits.kernelSubobject
def kernelSubobjectIso : (kernelSubobject f : C) β
kernel f :=
Subobject.underlyingIso (kernel.ΞΉ f)
#align category_theory.limits.kernel_subobject_iso CategoryTheory.Limits.kernelSubobjectIso
@[reassoc (attr := simp), elementwise (attr := simp)]
theorem kernelSubobject_arrow :
(kernelSubobjectIso f).hom β« kernel.ΞΉ f = (kernelSubobject f).arrow := by
simp [kernelSubobjectIso]
#align category_theory.limits.kernel_subobject_arrow CategoryTheory.Limits.kernelSubobject_arrow
@[reassoc (attr := simp), elementwise (attr := simp)]
| Mathlib/CategoryTheory/Subobject/Limits.lean | 104 | 106 | theorem kernelSubobject_arrow' :
(kernelSubobjectIso f).inv β« (kernelSubobject f).arrow = kernel.ΞΉ f := by |
simp [kernelSubobjectIso]
| 1 |
import Mathlib.Analysis.NormedSpace.Multilinear.Basic
import Mathlib.Analysis.NormedSpace.Units
import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness
import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul
#align_import analysis.normed_space.bounded_linear_maps from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a"
noncomputable section
open Topology
open Filter (Tendsto)
open Metric ContinuousLinearMap
variable {π : Type*} [NontriviallyNormedField π] {E : Type*} [NormedAddCommGroup E]
[NormedSpace π E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π F] {G : Type*}
[NormedAddCommGroup G] [NormedSpace π G]
structure IsBoundedLinearMap (π : Type*) [NormedField π] {E : Type*} [NormedAddCommGroup E]
[NormedSpace π E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π F] (f : E β F) extends
IsLinearMap π f : Prop where
bound : β M, 0 < M β§ β x : E, βf xβ β€ M * βxβ
#align is_bounded_linear_map IsBoundedLinearMap
theorem IsLinearMap.with_bound {f : E β F} (hf : IsLinearMap π f) (M : β)
(h : β x : E, βf xβ β€ M * βxβ) : IsBoundedLinearMap π f :=
β¨hf,
by_cases
(fun (this : M β€ 0) =>
β¨1, zero_lt_one, fun x =>
(h x).trans <| mul_le_mul_of_nonneg_right (this.trans zero_le_one) (norm_nonneg x)β©)
fun (this : Β¬M β€ 0) => β¨M, lt_of_not_ge this, hβ©β©
#align is_linear_map.with_bound IsLinearMap.with_bound
theorem ContinuousLinearMap.isBoundedLinearMap (f : E βL[π] F) : IsBoundedLinearMap π f :=
{ f.toLinearMap.isLinear with bound := f.bound }
#align continuous_linear_map.is_bounded_linear_map ContinuousLinearMap.isBoundedLinearMap
section
variable {ΞΉ : Type*} [Fintype ΞΉ]
theorem isBoundedLinearMap_prod_multilinear {E : ΞΉ β Type*} [β i, NormedAddCommGroup (E i)]
[β i, NormedSpace π (E i)] :
IsBoundedLinearMap π fun p : ContinuousMultilinearMap π E F Γ ContinuousMultilinearMap π E G =>
p.1.prod p.2 where
map_add pβ pβ := by ext : 1; rfl
map_smul c p := by ext : 1; rfl
bound := by
refine β¨1, zero_lt_one, fun p β¦ ?_β©
rw [one_mul]
apply ContinuousMultilinearMap.opNorm_le_bound _ (norm_nonneg _) _
intro m
rw [ContinuousMultilinearMap.prod_apply, norm_prod_le_iff]
constructor
Β· exact (p.1.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_fst_le p) <| by positivity)
Β· exact (p.2.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_snd_le p) <| by positivity)
#align is_bounded_linear_map_prod_multilinear isBoundedLinearMap_prod_multilinear
theorem isBoundedLinearMap_continuousMultilinearMap_comp_linear (g : G βL[π] E) :
IsBoundedLinearMap π fun f : ContinuousMultilinearMap π (fun _ : ΞΉ => E) F =>
f.compContinuousLinearMap fun _ => g := by
refine
IsLinearMap.with_bound
β¨fun fβ fβ => by ext; rfl,
fun c f => by ext; rflβ©
(βgβ ^ Fintype.card ΞΉ) fun f => ?_
apply ContinuousMultilinearMap.opNorm_le_bound _ _ _
Β· apply_rules [mul_nonneg, pow_nonneg, norm_nonneg]
intro m
calc
βf (g β m)β β€ βfβ * β i, βg (m i)β := f.le_opNorm _
_ β€ βfβ * β i, βgβ * βm iβ := by
apply mul_le_mul_of_nonneg_left _ (norm_nonneg _)
exact Finset.prod_le_prod (fun i _ => norm_nonneg _) fun i _ => g.le_opNorm _
_ = βgβ ^ Fintype.card ΞΉ * βfβ * β i, βm iβ := by
simp only [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ]
ring
#align is_bounded_linear_map_continuous_multilinear_map_comp_linear isBoundedLinearMap_continuousMultilinearMap_comp_linear
end
section BilinearMap
namespace ContinuousLinearMap
variable {R : Type*}
variable {πβ π' : Type*} [NontriviallyNormedField π'] [NontriviallyNormedField πβ]
variable {M : Type*} [TopologicalSpace M]
variable {Οββ : π β+* πβ}
variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace πβ G'] [NormedSpace π' G']
variable [SMulCommClass πβ π' G']
section Semiring
variable [Semiring R] [AddCommMonoid M] [Module R M] {Οββ : R β+* π'}
theorem map_addβ (f : M βSL[Οββ] F βSL[Οββ] G') (x x' : M) (y : F) :
f (x + x') y = f x y + f x' y := by rw [f.map_add, add_apply]
#align continuous_linear_map.map_addβ ContinuousLinearMap.map_addβ
theorem map_zeroβ (f : M βSL[Οββ] F βSL[Οββ] G') (y : F) : f 0 y = 0 := by
rw [f.map_zero, zero_apply]
#align continuous_linear_map.map_zeroβ ContinuousLinearMap.map_zeroβ
| Mathlib/Analysis/NormedSpace/BoundedLinearMaps.lean | 293 | 294 | theorem map_smulβββ (f : M βSL[Οββ] F βSL[Οββ] G') (c : R) (x : M) (y : F) :
f (c β’ x) y = Οββ c β’ f x y := by | rw [f.map_smulββ, smul_apply]
| 1 |
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]
| 1 |
import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots
import Mathlib.FieldTheory.Finite.Trace
import Mathlib.Algebra.Group.AddChar
import Mathlib.Data.ZMod.Units
import Mathlib.Analysis.Complex.Polynomial
#align_import number_theory.legendre_symbol.add_character from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472"
universe u v
namespace AddChar
section Additive
-- The domain and target of our additive characters. Now we restrict to a ring in the domain.
variable {R : Type u} [CommRing R] {R' : Type v} [CommMonoid R']
lemma val_mem_rootsOfUnity (Ο : AddChar R R') (a : R) (h : 0 < ringChar R) :
(Ο.val_isUnit a).unit β rootsOfUnity (ringChar R).toPNat' R' := by
simp only [mem_rootsOfUnity', IsUnit.unit_spec, Nat.toPNat'_coe, h, βreduceIte,
β map_nsmul_eq_pow, nsmul_eq_mul, CharP.cast_eq_zero, zero_mul, map_zero_eq_one]
def IsPrimitive (Ο : AddChar R R') : Prop :=
β a : R, a β 0 β IsNontrivial (mulShift Ο a)
#align add_char.is_primitive AddChar.IsPrimitive
lemma IsPrimitive.compMulHom_of_isPrimitive {R'' : Type*} [CommMonoid R''] {Ο : AddChar R R'}
{f : R' β* R''} (hΟ : Ο.IsPrimitive) (hf : Function.Injective f) :
(f.compAddChar Ο).IsPrimitive := by
intro a a_ne_zero
obtain β¨r, ne_oneβ© := hΟ a a_ne_zero
rw [mulShift_apply] at ne_one
simp only [IsNontrivial, mulShift_apply, f.coe_compAddChar, Function.comp_apply]
exact β¨r, fun H β¦ ne_one <| hf <| f.map_one βΈ Hβ©
theorem to_mulShift_inj_of_isPrimitive {Ο : AddChar R R'} (hΟ : IsPrimitive Ο) :
Function.Injective Ο.mulShift := by
intro a b h
apply_fun fun x => x * mulShift Ο (-b) at h
simp only [mulShift_mul, mulShift_zero, add_right_neg] at h
have hβ := hΟ (a + -b)
rw [h, isNontrivial_iff_ne_trivial, β sub_eq_add_neg, sub_ne_zero] at hβ
exact not_not.mp fun h => hβ h rfl
#align add_char.to_mul_shift_inj_of_is_primitive AddChar.to_mulShift_inj_of_isPrimitive
-- `AddCommGroup.equiv_direct_sum_zmod_of_fintype`
-- gives the structure theorem for finite abelian groups.
-- This could be used to show that the map above is a bijection.
-- We leave this for a later occasion.
theorem IsNontrivial.isPrimitive {F : Type u} [Field F] {Ο : AddChar F R'} (hΟ : IsNontrivial Ο) :
IsPrimitive Ο := by
intro a ha
cases' hΟ with x h
use aβ»ΒΉ * x
rwa [mulShift_apply, mul_inv_cancel_leftβ ha]
#align add_char.is_nontrivial.is_primitive AddChar.IsNontrivial.isPrimitive
lemma not_isPrimitive_mulShift [Finite R] (e : AddChar R R') {r : R}
(hr : Β¬ IsUnit r) : Β¬ IsPrimitive (e.mulShift r) := by
simp only [IsPrimitive, not_forall]
simp only [isUnit_iff_mem_nonZeroDivisors_of_finite, mem_nonZeroDivisors_iff, not_forall] at hr
rcases hr with β¨x, h, h'β©
exact β¨x, h', by simp only [mulShift_mulShift, mul_comm r, h, mulShift_zero, not_ne_iff,
isNontrivial_iff_ne_trivial]β©
-- Porting note(#5171): this linter isn't ported yet.
-- can't prove that they always exist (referring to providing an `Inhabited` instance)
-- @[nolint has_nonempty_instance]
structure PrimitiveAddChar (R : Type u) [CommRing R] (R' : Type v) [Field R'] where
n : β+
char : AddChar R (CyclotomicField n R')
prim : IsPrimitive char
#align add_char.primitive_add_char AddChar.PrimitiveAddChar
#align add_char.primitive_add_char.n AddChar.PrimitiveAddChar.n
#align add_char.primitive_add_char.char AddChar.PrimitiveAddChar.char
#align add_char.primitive_add_char.prim AddChar.PrimitiveAddChar.prim
section ZModChar
variable {C : Type v} [CommMonoid C]
section ZModCharDef
def zmodChar (n : β+) {ΞΆ : C} (hΞΆ : ΞΆ ^ (n : β) = 1) : AddChar (ZMod n) C where
toFun a := ΞΆ ^ a.val
map_zero_eq_one' := by simp only [ZMod.val_zero, pow_zero]
map_add_eq_mul' x y := by simp only [ZMod.val_add, β pow_eq_pow_mod _ hΞΆ, β pow_add]
#align add_char.zmod_char AddChar.zmodChar
theorem zmodChar_apply {n : β+} {ΞΆ : C} (hΞΆ : ΞΆ ^ (n : β) = 1) (a : ZMod n) :
zmodChar n hΞΆ a = ΞΆ ^ a.val :=
rfl
#align add_char.zmod_char_apply AddChar.zmodChar_apply
| Mathlib/NumberTheory/LegendreSymbol/AddCharacter.lean | 169 | 171 | theorem zmodChar_apply' {n : β+} {ΞΆ : C} (hΞΆ : ΞΆ ^ (n : β) = 1) (a : β) :
zmodChar n hΞΆ a = ΞΆ ^ a := by |
rw [pow_eq_pow_mod a hΞΆ, zmodChar_apply, ZMod.val_natCast a]
| 1 |
import Mathlib.Topology.MetricSpace.ProperSpace
import Mathlib.Topology.MetricSpace.Cauchy
open Set Filter Bornology
open scoped ENNReal Uniformity Topology Pointwise
universe u v w
variable {Ξ± : Type u} {Ξ² : Type v} {X ΞΉ : Type*}
variable [PseudoMetricSpace Ξ±]
namespace Metric
#align metric.bounded Bornology.IsBounded
section Bounded
variable {x : Ξ±} {s t : Set Ξ±} {r : β}
#noalign metric.bounded_iff_is_bounded
#align metric.bounded_empty Bornology.isBounded_empty
#align metric.bounded_iff_mem_bounded Bornology.isBounded_iff_forall_mem
#align metric.bounded.mono Bornology.IsBounded.subset
theorem isBounded_closedBall : IsBounded (closedBall x r) :=
isBounded_iff.2 β¨r + r, fun y hy z hz =>
calc dist y z β€ dist y x + dist z x := dist_triangle_right _ _ _
_ β€ r + r := add_le_add hy hzβ©
#align metric.bounded_closed_ball Metric.isBounded_closedBall
theorem isBounded_ball : IsBounded (ball x r) :=
isBounded_closedBall.subset ball_subset_closedBall
#align metric.bounded_ball Metric.isBounded_ball
theorem isBounded_sphere : IsBounded (sphere x r) :=
isBounded_closedBall.subset sphere_subset_closedBall
#align metric.bounded_sphere Metric.isBounded_sphere
theorem isBounded_iff_subset_closedBall (c : Ξ±) : IsBounded s β β r, s β closedBall c r :=
β¨fun h β¦ (isBounded_iff.1 (h.insert c)).imp fun _r hr _x hx β¦ hr (.inr hx) (mem_insert _ _),
fun β¨_r, hrβ© β¦ isBounded_closedBall.subset hrβ©
#align metric.bounded_iff_subset_ball Metric.isBounded_iff_subset_closedBall
theorem _root_.Bornology.IsBounded.subset_closedBall (h : IsBounded s) (c : Ξ±) :
β r, s β closedBall c r :=
(isBounded_iff_subset_closedBall c).1 h
#align metric.bounded.subset_ball Bornology.IsBounded.subset_closedBall
theorem _root_.Bornology.IsBounded.subset_ball_lt (h : IsBounded s) (a : β) (c : Ξ±) :
β r, a < r β§ s β ball c r :=
let β¨r, hrβ© := h.subset_closedBall c
β¨max r a + 1, (le_max_right _ _).trans_lt (lt_add_one _), hr.trans <| closedBall_subset_ball <|
(le_max_left _ _).trans_lt (lt_add_one _)β©
theorem _root_.Bornology.IsBounded.subset_ball (h : IsBounded s) (c : Ξ±) : β r, s β ball c r :=
(h.subset_ball_lt 0 c).imp fun _ β¦ And.right
theorem isBounded_iff_subset_ball (c : Ξ±) : IsBounded s β β r, s β ball c r :=
β¨(IsBounded.subset_ball Β· c), fun β¨_r, hrβ© β¦ isBounded_ball.subset hrβ©
theorem _root_.Bornology.IsBounded.subset_closedBall_lt (h : IsBounded s) (a : β) (c : Ξ±) :
β r, a < r β§ s β closedBall c r :=
let β¨r, har, hrβ© := h.subset_ball_lt a c
β¨r, har, hr.trans ball_subset_closedBallβ©
#align metric.bounded.subset_ball_lt Bornology.IsBounded.subset_closedBall_lt
theorem isBounded_closure_of_isBounded (h : IsBounded s) : IsBounded (closure s) :=
let β¨C, hβ© := isBounded_iff.1 h
isBounded_iff.2 β¨C, fun _a ha _b hb => isClosed_Iic.closure_subset <|
map_mem_closureβ continuous_dist ha hb hβ©
#align metric.bounded_closure_of_bounded Metric.isBounded_closure_of_isBounded
protected theorem _root_.Bornology.IsBounded.closure (h : IsBounded s) : IsBounded (closure s) :=
isBounded_closure_of_isBounded h
#align metric.bounded.closure Bornology.IsBounded.closure
@[simp]
theorem isBounded_closure_iff : IsBounded (closure s) β IsBounded s :=
β¨fun h => h.subset subset_closure, fun h => h.closureβ©
#align metric.bounded_closure_iff Metric.isBounded_closure_iff
#align metric.bounded_union Bornology.isBounded_union
#align metric.bounded.union Bornology.IsBounded.union
#align metric.bounded_bUnion Bornology.isBounded_biUnion
#align metric.bounded.prod Bornology.IsBounded.prod
theorem hasBasis_cobounded_compl_closedBall (c : Ξ±) :
(cobounded Ξ±).HasBasis (fun _ β¦ True) (fun r β¦ (closedBall c r)αΆ) :=
β¨compl_surjective.forall.2 fun _ β¦ (isBounded_iff_subset_closedBall c).trans <| by simpβ©
theorem hasBasis_cobounded_compl_ball (c : Ξ±) :
(cobounded Ξ±).HasBasis (fun _ β¦ True) (fun r β¦ (ball c r)αΆ) :=
β¨compl_surjective.forall.2 fun _ β¦ (isBounded_iff_subset_ball c).trans <| by simpβ©
@[simp]
theorem comap_dist_right_atTop (c : Ξ±) : comap (dist Β· c) atTop = cobounded Ξ± :=
(atTop_basis.comap _).eq_of_same_basis <| by
simpa only [compl_def, mem_ball, not_lt] using hasBasis_cobounded_compl_ball c
@[simp]
theorem comap_dist_left_atTop (c : Ξ±) : comap (dist c) atTop = cobounded Ξ± := by
simpa only [dist_comm _ c] using comap_dist_right_atTop c
@[simp]
theorem tendsto_dist_right_atTop_iff (c : Ξ±) {f : Ξ² β Ξ±} {l : Filter Ξ²} :
Tendsto (fun x β¦ dist (f x) c) l atTop β Tendsto f l (cobounded Ξ±) := by
rw [β comap_dist_right_atTop c, tendsto_comap_iff, Function.comp_def]
@[simp]
| Mathlib/Topology/MetricSpace/Bounded.lean | 142 | 144 | theorem tendsto_dist_left_atTop_iff (c : Ξ±) {f : Ξ² β Ξ±} {l : Filter Ξ²} :
Tendsto (fun x β¦ dist c (f x)) l atTop β Tendsto f l (cobounded Ξ±) := by |
simp only [dist_comm c, tendsto_dist_right_atTop_iff]
| 1 |
import Mathlib.Data.Finset.Pointwise
#align_import combinatorics.additive.e_transform from "leanprover-community/mathlib"@"207c92594599a06e7c134f8d00a030a83e6c7259"
open MulOpposite
open Pointwise
variable {Ξ± : Type*} [DecidableEq Ξ±]
namespace Finset
section Group
variable [Group Ξ±] (e : Ξ±) (x : Finset Ξ± Γ Finset Ξ±)
@[to_additive (attr := simps) "An **e-transform**.
Turns `(s, t)` into `(s β© s +α΅₯ e, t βͺ -e +α΅₯ t)`. This reduces the sum of the two sets."]
def mulETransformLeft : Finset Ξ± Γ Finset Ξ± :=
(x.1 β© op e β’ x.1, x.2 βͺ eβ»ΒΉ β’ x.2)
#align finset.mul_e_transform_left Finset.mulETransformLeft
#align finset.add_e_transform_left Finset.addETransformLeft
@[to_additive (attr := simps) "An **e-transform**.
Turns `(s, t)` into `(s βͺ s +α΅₯ e, t β© -e +α΅₯ t)`. This reduces the sum of the two sets."]
def mulETransformRight : Finset Ξ± Γ Finset Ξ± :=
(x.1 βͺ op e β’ x.1, x.2 β© eβ»ΒΉ β’ x.2)
#align finset.mul_e_transform_right Finset.mulETransformRight
#align finset.add_e_transform_right Finset.addETransformRight
@[to_additive (attr := simp)]
theorem mulETransformLeft_one : mulETransformLeft 1 x = x := by simp [mulETransformLeft]
#align finset.mul_e_transform_left_one Finset.mulETransformLeft_one
#align finset.add_e_transform_left_zero Finset.addETransformLeft_zero
@[to_additive (attr := simp)]
| Mathlib/Combinatorics/Additive/ETransform.lean | 137 | 137 | theorem mulETransformRight_one : mulETransformRight 1 x = x := by | simp [mulETransformRight]
| 1 |
import Mathlib.Topology.PartialHomeomorph
import Mathlib.Analysis.Normed.Group.AddTorsor
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Data.Real.Sqrt
#align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
open Set Metric Pointwise
variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β E]
noncomputable section
@[simps (config := .lemmasOnly)]
def PartialHomeomorph.univUnitBall : PartialHomeomorph E E where
toFun x := (β(1 + βxβ ^ 2))β»ΒΉ β’ x
invFun y := (β(1 - β(y : E)β ^ 2))β»ΒΉ β’ (y : E)
source := univ
target := ball 0 1
map_source' x _ := by
have : 0 < 1 + βxβ ^ 2 := by positivity
rw [mem_ball_zero_iff, norm_smul, Real.norm_eq_abs, abs_inv, β _root_.div_eq_inv_mul,
div_lt_one (abs_pos.mpr <| Real.sqrt_ne_zero'.mpr this), β abs_norm x, β sq_lt_sq,
abs_norm, Real.sq_sqrt this.le]
exact lt_one_add _
map_target' _ _ := trivial
left_inv' x _ := by
field_simp [norm_smul, smul_smul, (zero_lt_one_add_norm_sq x).ne', sq_abs,
Real.sq_sqrt (zero_lt_one_add_norm_sq x).le, β Real.sqrt_div (zero_lt_one_add_norm_sq x).le]
right_inv' y hy := by
have : 0 < 1 - βyβ ^ 2 := by nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
field_simp [norm_smul, smul_smul, this.ne', sq_abs, Real.sq_sqrt this.le,
β Real.sqrt_div this.le]
open_source := isOpen_univ
open_target := isOpen_ball
continuousOn_toFun := by
suffices Continuous fun (x:E) => (β(1 + βxβ ^ 2))β»ΒΉ
from (this.smul continuous_id).continuousOn
refine Continuous.invβ ?_ fun x => Real.sqrt_ne_zero'.mpr (by positivity)
continuity
continuousOn_invFun := by
have : β y β ball (0 : E) 1, β(1 - β(y : E)β ^ 2) β 0 := fun y hy β¦ by
rw [Real.sqrt_ne_zero']
nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
exact ContinuousOn.smul (ContinuousOn.invβ
(continuousOn_const.sub (continuous_norm.continuousOn.pow _)).sqrt this) continuousOn_id
@[simp]
theorem PartialHomeomorph.univUnitBall_apply_zero : univUnitBall (0 : E) = 0 := by
simp [PartialHomeomorph.univUnitBall_apply]
@[simp]
theorem PartialHomeomorph.univUnitBall_symm_apply_zero : univUnitBall.symm (0 : E) = 0 := by
simp [PartialHomeomorph.univUnitBall_symm_apply]
@[simps! (config := .lemmasOnly)]
def Homeomorph.unitBall : E ββ ball (0 : E) 1 :=
(Homeomorph.Set.univ _).symm.trans PartialHomeomorph.univUnitBall.toHomeomorphSourceTarget
#align homeomorph_unit_ball Homeomorph.unitBall
@[simp]
theorem Homeomorph.coe_unitBall_apply_zero :
(Homeomorph.unitBall (0 : E) : E) = 0 :=
PartialHomeomorph.univUnitBall_apply_zero
#align coe_homeomorph_unit_ball_apply_zero Homeomorph.coe_unitBall_apply_zero
variable {P : Type*} [PseudoMetricSpace P] [NormedAddTorsor E P]
namespace PartialHomeomorph
@[simps!]
def unitBallBall (c : P) (r : β) (hr : 0 < r) : PartialHomeomorph E P :=
((Homeomorph.smulOfNeZero r hr.ne').trans
(IsometryEquiv.vaddConst c).toHomeomorph).toPartialHomeomorphOfImageEq
(ball 0 1) isOpen_ball (ball c r) <| by
change (IsometryEquiv.vaddConst c) β (r β’ Β·) '' ball (0 : E) 1 = ball c r
rw [image_comp, image_smul, smul_unitBall hr.ne', IsometryEquiv.image_ball]
simp [abs_of_pos hr]
def univBall (c : P) (r : β) : PartialHomeomorph E P :=
if h : 0 < r then univUnitBall.trans' (unitBallBall c r h) rfl
else (IsometryEquiv.vaddConst c).toHomeomorph.toPartialHomeomorph
@[simp]
theorem univBall_source (c : P) (r : β) : (univBall c r).source = univ := by
unfold univBall; split_ifs <;> rfl
theorem univBall_target (c : P) {r : β} (hr : 0 < r) : (univBall c r).target = ball c r := by
rw [univBall, dif_pos hr]; rfl
theorem ball_subset_univBall_target (c : P) (r : β) : ball c r β (univBall c r).target := by
by_cases hr : 0 < r
Β· rw [univBall_target c hr]
Β· rw [univBall, dif_neg hr]
exact subset_univ _
@[simp]
theorem univBall_apply_zero (c : P) (r : β) : univBall c r 0 = c := by
unfold univBall; split_ifs <;> simp
@[simp]
theorem univBall_symm_apply_center (c : P) (r : β) : (univBall c r).symm c = 0 := by
have : 0 β (univBall c r).source := by simp
simpa only [univBall_apply_zero] using (univBall c r).left_inv this
@[continuity]
| Mathlib/Analysis/NormedSpace/HomeomorphBall.lean | 149 | 150 | theorem continuous_univBall (c : P) (r : β) : Continuous (univBall c r) := by |
simpa [continuous_iff_continuousOn_univ] using (univBall c r).continuousOn
| 1 |
import Mathlib.Order.Interval.Set.OrdConnected
import Mathlib.Order.Antisymmetrization
#align_import order.cover from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
open Set OrderDual
variable {Ξ± Ξ² : Type*}
section WeaklyCovers
section LT
variable [LT Ξ±] {a b : Ξ±}
def CovBy (a b : Ξ±) : Prop :=
a < b β§ β β¦cβ¦, a < c β Β¬c < b
#align covby CovBy
infixl:50 " β " => CovBy
theorem CovBy.lt (h : a β b) : a < b :=
h.1
#align covby.lt CovBy.lt
| Mathlib/Order/Cover.lean | 233 | 234 | theorem not_covBy_iff (h : a < b) : Β¬a β b β β c, a < c β§ c < b := by |
simp_rw [CovBy, h, true_and_iff, not_forall, exists_prop, not_not]
| 1 |
import Mathlib.CategoryTheory.Monoidal.Functor
#align_import category_theory.monoidal.End from "leanprover-community/mathlib"@"85075bccb68ab7fa49fb05db816233fb790e4fe9"
universe v u
namespace CategoryTheory
variable (C : Type u) [Category.{v} C]
def endofunctorMonoidalCategory : MonoidalCategory (C β₯€ C) where
tensorObj F G := F β G
whiskerLeft X _ _ F := whiskerLeft X F
whiskerRight F X := whiskerRight F X
tensorHom Ξ± Ξ² := Ξ± β« Ξ²
tensorUnit := π C
associator F G H := Functor.associator F G H
leftUnitor F := Functor.leftUnitor F
rightUnitor F := Functor.rightUnitor F
#align category_theory.endofunctor_monoidal_category CategoryTheory.endofunctorMonoidalCategory
open CategoryTheory.MonoidalCategory
attribute [local instance] endofunctorMonoidalCategory
@[simp] theorem endofunctorMonoidalCategory_tensorUnit_obj (X : C) :
(π_ (C β₯€ C)).obj X = X := rfl
@[simp] theorem endofunctorMonoidalCategory_tensorUnit_map {X Y : C} (f : X βΆ Y) :
(π_ (C β₯€ C)).map f = f := rfl
@[simp] theorem endofunctorMonoidalCategory_tensorObj_obj (F G : C β₯€ C) (X : C) :
(F β G).obj X = G.obj (F.obj X) := rfl
@[simp] theorem endofunctorMonoidalCategory_tensorObj_map (F G : C β₯€ C) {X Y : C} (f : X βΆ Y) :
(F β G).map f = G.map (F.map f) := rfl
@[simp] theorem endofunctorMonoidalCategory_tensorMap_app
{F G H K : C β₯€ C} {Ξ± : F βΆ G} {Ξ² : H βΆ K} (X : C) :
(Ξ± β Ξ²).app X = Ξ².app (F.obj X) β« K.map (Ξ±.app X) := rfl
@[simp] theorem endofunctorMonoidalCategory_whiskerLeft_app
{F H K : C β₯€ C} {Ξ² : H βΆ K} (X : C) :
(F β Ξ²).app X = Ξ².app (F.obj X) := rfl
@[simp] theorem endofunctorMonoidalCategory_whiskerRight_app
{F G H : C β₯€ C} {Ξ± : F βΆ G} (X : C) :
(Ξ± β· H).app X = H.map (Ξ±.app X) := rfl
@[simp] theorem endofunctorMonoidalCategory_associator_hom_app (F G H : C β₯€ C) (X : C) :
(Ξ±_ F G H).hom.app X = π _ := rfl
@[simp] theorem endofunctorMonoidalCategory_associator_inv_app (F G H : C β₯€ C) (X : C) :
(Ξ±_ F G H).inv.app X = π _ := rfl
@[simp] theorem endofunctorMonoidalCategory_leftUnitor_hom_app (F : C β₯€ C) (X : C) :
(Ξ»_ F).hom.app X = π _ := rfl
@[simp] theorem endofunctorMonoidalCategory_leftUnitor_inv_app (F : C β₯€ C) (X : C) :
(Ξ»_ F).inv.app X = π _ := rfl
@[simp] theorem endofunctorMonoidalCategory_rightUnitor_hom_app (F : C β₯€ C) (X : C) :
(Ο_ F).hom.app X = π _ := rfl
@[simp] theorem endofunctorMonoidalCategory_rightUnitor_inv_app (F : C β₯€ C) (X : C) :
(Ο_ F).inv.app X = π _ := rfl
@[simps!]
def tensoringRightMonoidal [MonoidalCategory.{v} C] : MonoidalFunctor C (C β₯€ C) :=
{ tensoringRight C with
Ξ΅ := (rightUnitorNatIso C).inv
ΞΌ := fun X Y => (isoWhiskerRight (curriedAssociatorNatIso C)
((evaluation C (C β₯€ C)).obj X β (evaluation C C).obj Y)).hom }
#align category_theory.tensoring_right_monoidal CategoryTheory.tensoringRightMonoidal
variable {C}
variable {M : Type*} [Category M] [MonoidalCategory M] (F : MonoidalFunctor M (C β₯€ C))
@[reassoc (attr := simp)]
theorem ΞΌ_hom_inv_app (i j : M) (X : C) : (F.ΞΌ i j).app X β« (F.ΞΌIso i j).inv.app X = π _ :=
(F.ΞΌIso i j).hom_inv_id_app X
#align category_theory.ΞΌ_hom_inv_app CategoryTheory.ΞΌ_hom_inv_app
@[reassoc (attr := simp)]
theorem ΞΌ_inv_hom_app (i j : M) (X : C) : (F.ΞΌIso i j).inv.app X β« (F.ΞΌ i j).app X = π _ :=
(F.ΞΌIso i j).inv_hom_id_app X
#align category_theory.ΞΌ_inv_hom_app CategoryTheory.ΞΌ_inv_hom_app
@[reassoc (attr := simp)]
theorem Ξ΅_hom_inv_app (X : C) : F.Ξ΅.app X β« F.Ξ΅Iso.inv.app X = π _ :=
F.Ξ΅Iso.hom_inv_id_app X
#align category_theory.Ξ΅_hom_inv_app CategoryTheory.Ξ΅_hom_inv_app
@[reassoc (attr := simp)]
theorem Ξ΅_inv_hom_app (X : C) : F.Ξ΅Iso.inv.app X β« F.Ξ΅.app X = π _ :=
F.Ξ΅Iso.inv_hom_id_app X
#align category_theory.Ξ΅_inv_hom_app CategoryTheory.Ξ΅_inv_hom_app
@[reassoc (attr := simp)]
theorem Ξ΅_naturality {X Y : C} (f : X βΆ Y) : F.Ξ΅.app X β« (F.obj (π_ M)).map f = f β« F.Ξ΅.app Y :=
(F.Ξ΅.naturality f).symm
#align category_theory.Ξ΅_naturality CategoryTheory.Ξ΅_naturality
@[reassoc (attr := simp)]
| Mathlib/CategoryTheory/Monoidal/End.lean | 129 | 131 | theorem Ξ΅_inv_naturality {X Y : C} (f : X βΆ Y) :
(MonoidalFunctor.Ξ΅Iso F).inv.app X β« (π_ (C β₯€ C)).map f = F.Ξ΅Iso.inv.app X β« f := by |
aesop_cat
| 1 |
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Integral.DominatedConvergence
import Mathlib.MeasureTheory.Integral.SetIntegral
#align_import measure_theory.constructions.prod.integral from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
noncomputable section
open scoped Classical Topology ENNReal MeasureTheory
open Set Function Real ENNReal
open MeasureTheory MeasurableSpace MeasureTheory.Measure
open TopologicalSpace
open Filter hiding prod_eq map
variable {Ξ± Ξ±' Ξ² Ξ²' Ξ³ E : Type*}
variable [MeasurableSpace Ξ±] [MeasurableSpace Ξ±'] [MeasurableSpace Ξ²] [MeasurableSpace Ξ²']
variable [MeasurableSpace Ξ³]
variable {ΞΌ ΞΌ' : Measure Ξ±} {Ξ½ Ξ½' : Measure Ξ²} {Ο : Measure Ξ³}
variable [NormedAddCommGroup E]
theorem measurableSet_integrable [SigmaFinite Ξ½] β¦f : Ξ± β Ξ² β Eβ¦
(hf : StronglyMeasurable (uncurry f)) : MeasurableSet {x | Integrable (f x) Ξ½} := by
simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and_iff]
exact measurableSet_lt (Measurable.lintegral_prod_right hf.ennnorm) measurable_const
#align measurable_set_integrable measurableSet_integrable
section
variable [NormedSpace β E]
theorem MeasureTheory.StronglyMeasurable.integral_prod_right [SigmaFinite Ξ½] β¦f : Ξ± β Ξ² β Eβ¦
(hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => β« y, f x y βΞ½ := by
by_cases hE : CompleteSpace E; swap; Β· simp [integral, hE, stronglyMeasurable_const]
borelize E
haveI : SeparableSpace (range (uncurry f) βͺ {0} : Set E) :=
hf.separableSpace_range_union_singleton
let s : β β SimpleFunc (Ξ± Γ Ξ²) E :=
SimpleFunc.approxOn _ hf.measurable (range (uncurry f) βͺ {0}) 0 (by simp)
let s' : β β Ξ± β SimpleFunc Ξ² E := fun n x => (s n).comp (Prod.mk x) measurable_prod_mk_left
let f' : β β Ξ± β E := fun n => {x | Integrable (f x) Ξ½}.indicator fun x => (s' n x).integral Ξ½
have hf' : β n, StronglyMeasurable (f' n) := by
intro n; refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf)
have : β x, ((s' n x).range.filter fun x => x β 0) β (s n).range := by
intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y
simp_rw [SimpleFunc.mem_range]; rintro β¨z, rflβ©; exact β¨(x, z), rflβ©
simp only [SimpleFunc.integral_eq_sum_of_subset (this _)]
refine Finset.stronglyMeasurable_sum _ fun x _ => ?_
refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _
simp only [s', SimpleFunc.coe_comp, preimage_comp]
apply measurable_measure_prod_mk_left
exact (s n).measurableSet_fiber x
have h2f' : Tendsto f' atTop (π fun x : Ξ± => β« y : Ξ², f x y βΞ½) := by
rw [tendsto_pi_nhds]; intro x
by_cases hfx : Integrable (f x) Ξ½
Β· have (n) : Integrable (s' n x) Ξ½ := by
apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable
filter_upwards with y
simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n
simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem,
mem_setOf_eq]
refine
tendsto_integral_of_dominated_convergence (fun y => βf x yβ + βf x yβ)
(fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_
Β· refine fun n => eventually_of_forall fun y =>
SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n
-- Porting note: Lean 3 solved the following two subgoals on its own
Β· exact hf.measurable
Β· simp
Β· refine eventually_of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_
-- Porting note: Lean 3 solved the following two subgoals on its own
Β· exact hf.measurable.of_uncurry_left
Β· simp
apply subset_closure
simp [-uncurry_apply_pair]
Β· simp [f', hfx, integral_undef]
exact stronglyMeasurable_of_tendsto _ hf' h2f'
#align measure_theory.strongly_measurable.integral_prod_right MeasureTheory.StronglyMeasurable.integral_prod_right
| Mathlib/MeasureTheory/Constructions/Prod/Integral.lean | 127 | 129 | theorem MeasureTheory.StronglyMeasurable.integral_prod_right' [SigmaFinite Ξ½] β¦f : Ξ± Γ Ξ² β Eβ¦
(hf : StronglyMeasurable f) : StronglyMeasurable fun x => β« y, f (x, y) βΞ½ := by |
rw [β uncurry_curry f] at hf; exact hf.integral_prod_right
| 1 |
import Mathlib.Order.Interval.Finset.Nat
#align_import data.fin.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
assert_not_exists MonoidWithZero
open Finset Fin Function
namespace Fin
variable (n : β)
instance instLocallyFiniteOrder : LocallyFiniteOrder (Fin n) :=
OrderIso.locallyFiniteOrder Fin.orderIsoSubtype
instance instLocallyFiniteOrderBot : LocallyFiniteOrderBot (Fin n) :=
OrderIso.locallyFiniteOrderBot Fin.orderIsoSubtype
instance instLocallyFiniteOrderTop : β n, LocallyFiniteOrderTop (Fin n)
| 0 => IsEmpty.toLocallyFiniteOrderTop
| _ + 1 => inferInstance
variable {n} (a b : Fin n)
theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : β) b).fin n :=
rfl
#align fin.Icc_eq_finset_subtype Fin.Icc_eq_finset_subtype
theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : β) b).fin n :=
rfl
#align fin.Ico_eq_finset_subtype Fin.Ico_eq_finset_subtype
theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : β) b).fin n :=
rfl
#align fin.Ioc_eq_finset_subtype Fin.Ioc_eq_finset_subtype
theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : β) b).fin n :=
rfl
#align fin.Ioo_eq_finset_subtype Fin.Ioo_eq_finset_subtype
theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : β) b).fin n := rfl
#align fin.uIcc_eq_finset_subtype Fin.uIcc_eq_finset_subtype
@[simp]
theorem map_valEmbedding_Icc : (Icc a b).map Fin.valEmbedding = Icc βa βb := by
simp [Icc_eq_finset_subtype, Finset.fin, Finset.map_map, Icc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Icc Fin.map_valEmbedding_Icc
@[simp]
theorem map_valEmbedding_Ico : (Ico a b).map Fin.valEmbedding = Ico βa βb := by
simp [Ico_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ico Fin.map_valEmbedding_Ico
@[simp]
theorem map_valEmbedding_Ioc : (Ioc a b).map Fin.valEmbedding = Ioc βa βb := by
simp [Ioc_eq_finset_subtype, Finset.fin, Finset.map_map, Ioc_filter_lt_of_lt_right]
#align fin.map_subtype_embedding_Ioc Fin.map_valEmbedding_Ioc
@[simp]
theorem map_valEmbedding_Ioo : (Ioo a b).map Fin.valEmbedding = Ioo βa βb := by
simp [Ioo_eq_finset_subtype, Finset.fin, Finset.map_map]
#align fin.map_subtype_embedding_Ioo Fin.map_valEmbedding_Ioo
@[simp]
theorem map_subtype_embedding_uIcc : (uIcc a b).map valEmbedding = uIcc βa βb :=
map_valEmbedding_Icc _ _
#align fin.map_subtype_embedding_uIcc Fin.map_subtype_embedding_uIcc
@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a := by
rw [β Nat.card_Icc, β map_valEmbedding_Icc, card_map]
#align fin.card_Icc Fin.card_Icc
@[simp]
theorem card_Ico : (Ico a b).card = b - a := by
rw [β Nat.card_Ico, β map_valEmbedding_Ico, card_map]
#align fin.card_Ico Fin.card_Ico
@[simp]
theorem card_Ioc : (Ioc a b).card = b - a := by
rw [β Nat.card_Ioc, β map_valEmbedding_Ioc, card_map]
#align fin.card_Ioc Fin.card_Ioc
@[simp]
| Mathlib/Order/Interval/Finset/Fin.lean | 119 | 120 | theorem card_Ioo : (Ioo a b).card = b - a - 1 := by |
rw [β Nat.card_Ioo, β map_valEmbedding_Ioo, card_map]
| 1 |
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]
| 1 |
import Batteries.Data.List.Basic
namespace Batteries
inductive AssocList (Ξ± : Type u) (Ξ² : Type v) where
| nil
| cons (key : Ξ±) (value : Ξ²) (tail : AssocList Ξ± Ξ²)
deriving Inhabited
namespace AssocList
@[simp] def toList : AssocList Ξ± Ξ² β List (Ξ± Γ Ξ²)
| nil => []
| cons a b es => (a, b) :: es.toList
instance : EmptyCollection (AssocList Ξ± Ξ²) := β¨nilβ©
@[simp] theorem empty_eq : (β
: AssocList Ξ± Ξ²) = nil := rfl
def isEmpty : AssocList Ξ± Ξ² β Bool
| nil => true
| _ => false
@[simp] theorem isEmpty_eq (l : AssocList Ξ± Ξ²) : isEmpty l = l.toList.isEmpty := by
cases l <;> simp [*, isEmpty, List.isEmpty]
def length (L : AssocList Ξ± Ξ²) : Nat :=
match L with
| .nil => 0
| .cons _ _ t => t.length + 1
@[simp] theorem length_nil : length (nil : AssocList Ξ± Ξ²) = 0 := rfl
@[simp] theorem length_cons : length (cons a b t) = length t + 1 := rfl
| .lake/packages/batteries/Batteries/Data/AssocList.lean | 55 | 56 | theorem length_toList (l : AssocList Ξ± Ξ²) : l.toList.length = l.length := by |
induction l <;> simp_all
| 1 |
import Mathlib.Algebra.Group.Defs
import Mathlib.Algebra.GroupWithZero.Defs
import Mathlib.Data.Int.Cast.Defs
import Mathlib.Tactic.Spread
import Mathlib.Util.AssertExists
#align_import algebra.ring.defs from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f"
universe u v w x
variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {R : Type x}
open Function
class Distrib (R : Type*) extends Mul R, Add R where
protected left_distrib : β a b c : R, a * (b + c) = a * b + a * c
protected right_distrib : β a b c : R, (a + b) * c = a * c + b * c
#align distrib Distrib
class LeftDistribClass (R : Type*) [Mul R] [Add R] : Prop where
protected left_distrib : β a b c : R, a * (b + c) = a * b + a * c
#align left_distrib_class LeftDistribClass
class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where
protected right_distrib : β a b c : R, (a + b) * c = a * c + b * c
#align right_distrib_class RightDistribClass
-- see Note [lower instance priority]
instance (priority := 100) Distrib.leftDistribClass (R : Type*) [Distrib R] : LeftDistribClass R :=
β¨Distrib.left_distribβ©
#align distrib.left_distrib_class Distrib.leftDistribClass
-- see Note [lower instance priority]
instance (priority := 100) Distrib.rightDistribClass (R : Type*) [Distrib R] :
RightDistribClass R :=
β¨Distrib.right_distribβ©
#align distrib.right_distrib_class Distrib.rightDistribClass
theorem left_distrib [Mul R] [Add R] [LeftDistribClass R] (a b c : R) :
a * (b + c) = a * b + a * c :=
LeftDistribClass.left_distrib a b c
#align left_distrib left_distrib
alias mul_add := left_distrib
#align mul_add mul_add
theorem right_distrib [Mul R] [Add R] [RightDistribClass R] (a b c : R) :
(a + b) * c = a * c + b * c :=
RightDistribClass.right_distrib a b c
#align right_distrib right_distrib
alias add_mul := right_distrib
#align add_mul add_mul
theorem distrib_three_right [Mul R] [Add R] [RightDistribClass R] (a b c d : R) :
(a + b + c) * d = a * d + b * d + c * d := by simp [right_distrib]
#align distrib_three_right distrib_three_right
class NonUnitalNonAssocSemiring (Ξ± : Type u) extends AddCommMonoid Ξ±, Distrib Ξ±, MulZeroClass Ξ±
#align non_unital_non_assoc_semiring NonUnitalNonAssocSemiring
class NonUnitalSemiring (Ξ± : Type u) extends NonUnitalNonAssocSemiring Ξ±, SemigroupWithZero Ξ±
#align non_unital_semiring NonUnitalSemiring
class NonAssocSemiring (Ξ± : Type u) extends NonUnitalNonAssocSemiring Ξ±, MulZeroOneClass Ξ±,
AddCommMonoidWithOne Ξ±
#align non_assoc_semiring NonAssocSemiring
class NonUnitalNonAssocRing (Ξ± : Type u) extends AddCommGroup Ξ±, NonUnitalNonAssocSemiring Ξ±
#align non_unital_non_assoc_ring NonUnitalNonAssocRing
class NonUnitalRing (Ξ± : Type*) extends NonUnitalNonAssocRing Ξ±, NonUnitalSemiring Ξ±
#align non_unital_ring NonUnitalRing
class NonAssocRing (Ξ± : Type*) extends NonUnitalNonAssocRing Ξ±, NonAssocSemiring Ξ±,
AddCommGroupWithOne Ξ±
#align non_assoc_ring NonAssocRing
class Semiring (Ξ± : Type u) extends NonUnitalSemiring Ξ±, NonAssocSemiring Ξ±, MonoidWithZero Ξ±
#align semiring Semiring
class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R
#align ring Ring
section DistribMulOneClass
variable [Add Ξ±] [MulOneClass Ξ±]
theorem add_one_mul [RightDistribClass Ξ±] (a b : Ξ±) : (a + 1) * b = a * b + b := by
rw [add_mul, one_mul]
#align add_one_mul add_one_mul
theorem mul_add_one [LeftDistribClass Ξ±] (a b : Ξ±) : a * (b + 1) = a * b + a := by
rw [mul_add, mul_one]
#align mul_add_one mul_add_one
| Mathlib/Algebra/Ring/Defs.lean | 164 | 165 | theorem one_add_mul [RightDistribClass Ξ±] (a b : Ξ±) : (1 + a) * b = b + a * b := by |
rw [add_mul, one_mul]
| 1 |
import Mathlib.Topology.Category.TopCat.Limits.Products
#align_import topology.category.Top.limits.pullbacks from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
-- Porting note: every ML3 decl has an uppercase letter
set_option linter.uppercaseLean3 false
open TopologicalSpace
open CategoryTheory
open CategoryTheory.Limits
universe v u w
noncomputable section
namespace TopCat
variable {J : Type v} [SmallCategory J]
section Pullback
variable {X Y Z : TopCat.{u}}
abbrev pullbackFst (f : X βΆ Z) (g : Y βΆ Z) : TopCat.of { p : X Γ Y // f p.1 = g p.2 } βΆ X :=
β¨Prod.fst β Subtype.val, by
apply Continuous.comp <;> set_option tactic.skipAssignedInstances false in continuityβ©
#align Top.pullback_fst TopCat.pullbackFst
lemma pullbackFst_apply (f : X βΆ Z) (g : Y βΆ Z) (x) : pullbackFst f g x = x.1.1 := rfl
abbrev pullbackSnd (f : X βΆ Z) (g : Y βΆ Z) : TopCat.of { p : X Γ Y // f p.1 = g p.2 } βΆ Y :=
β¨Prod.snd β Subtype.val, by
apply Continuous.comp <;> set_option tactic.skipAssignedInstances false in continuityβ©
#align Top.pullback_snd TopCat.pullbackSnd
lemma pullbackSnd_apply (f : X βΆ Z) (g : Y βΆ Z) (x) : pullbackSnd f g x = x.1.2 := rfl
def pullbackCone (f : X βΆ Z) (g : Y βΆ Z) : PullbackCone f g :=
PullbackCone.mk (pullbackFst f g) (pullbackSnd f g)
(by
dsimp [pullbackFst, pullbackSnd, Function.comp_def]
ext β¨x, hβ©
-- Next 2 lines were
-- `rw [comp_apply, ContinuousMap.coe_mk, comp_apply, ContinuousMap.coe_mk]`
-- `exact h` before leanprover/lean4#2644
rw [comp_apply, comp_apply]
congr!)
#align Top.pullback_cone TopCat.pullbackCone
def pullbackConeIsLimit (f : X βΆ Z) (g : Y βΆ Z) : IsLimit (pullbackCone f g) :=
PullbackCone.isLimitAux' _
(by
intro S
constructor; swap
Β· exact
{ toFun := fun x =>
β¨β¨S.fst x, S.snd xβ©, by simpa using ConcreteCategory.congr_hom S.condition xβ©
continuous_toFun := by
apply Continuous.subtype_mk <| Continuous.prod_mk ?_ ?_
Β· exact (PullbackCone.fst S)|>.continuous_toFun
Β· exact (PullbackCone.snd S)|>.continuous_toFun
}
refine β¨?_, ?_, ?_β©
Β· delta pullbackCone
ext a
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [comp_apply, ContinuousMap.coe_mk]
Β· delta pullbackCone
ext a
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [comp_apply, ContinuousMap.coe_mk]
Β· intro m hβ hβ
-- Porting note: used to be ext x
apply ContinuousMap.ext; intro x
apply Subtype.ext
apply Prod.ext
Β· simpa using ConcreteCategory.congr_hom hβ x
Β· simpa using ConcreteCategory.congr_hom hβ x)
#align Top.pullback_cone_is_limit TopCat.pullbackConeIsLimit
def pullbackIsoProdSubtype (f : X βΆ Z) (g : Y βΆ Z) :
pullback f g β
TopCat.of { p : X Γ Y // f p.1 = g p.2 } :=
(limit.isLimit _).conePointUniqueUpToIso (pullbackConeIsLimit f g)
#align Top.pullback_iso_prod_subtype TopCat.pullbackIsoProdSubtype
@[reassoc (attr := simp)]
theorem pullbackIsoProdSubtype_inv_fst (f : X βΆ Z) (g : Y βΆ Z) :
(pullbackIsoProdSubtype f g).inv β« pullback.fst = pullbackFst f g := by
simp [pullbackCone, pullbackIsoProdSubtype]
#align Top.pullback_iso_prod_subtype_inv_fst TopCat.pullbackIsoProdSubtype_inv_fst
theorem pullbackIsoProdSubtype_inv_fst_apply (f : X βΆ Z) (g : Y βΆ Z)
(x : { p : X Γ Y // f p.1 = g p.2 }) :
(pullback.fst : pullback f g βΆ _) ((pullbackIsoProdSubtype f g).inv x) = (x : X Γ Y).fst :=
ConcreteCategory.congr_hom (pullbackIsoProdSubtype_inv_fst f g) x
#align Top.pullback_iso_prod_subtype_inv_fst_apply TopCat.pullbackIsoProdSubtype_inv_fst_apply
@[reassoc (attr := simp)]
theorem pullbackIsoProdSubtype_inv_snd (f : X βΆ Z) (g : Y βΆ Z) :
(pullbackIsoProdSubtype f g).inv β« pullback.snd = pullbackSnd f g := by
simp [pullbackCone, pullbackIsoProdSubtype]
#align Top.pullback_iso_prod_subtype_inv_snd TopCat.pullbackIsoProdSubtype_inv_snd
theorem pullbackIsoProdSubtype_inv_snd_apply (f : X βΆ Z) (g : Y βΆ Z)
(x : { p : X Γ Y // f p.1 = g p.2 }) :
(pullback.snd : pullback f g βΆ _) ((pullbackIsoProdSubtype f g).inv x) = (x : X Γ Y).snd :=
ConcreteCategory.congr_hom (pullbackIsoProdSubtype_inv_snd f g) x
#align Top.pullback_iso_prod_subtype_inv_snd_apply TopCat.pullbackIsoProdSubtype_inv_snd_apply
| Mathlib/Topology/Category/TopCat/Limits/Pullbacks.lean | 126 | 128 | theorem pullbackIsoProdSubtype_hom_fst (f : X βΆ Z) (g : Y βΆ Z) :
(pullbackIsoProdSubtype f g).hom β« pullbackFst f g = pullback.fst := by |
rw [β Iso.eq_inv_comp, pullbackIsoProdSubtype_inv_fst]
| 1 |
import Mathlib.Order.ConditionallyCompleteLattice.Basic
import Mathlib.Order.LatticeIntervals
import Mathlib.Order.Interval.Set.OrdConnected
#align_import order.complete_lattice_intervals from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
open scoped Classical
open Set
variable {ΞΉ : Sort*} {Ξ± : Type*} (s : Set Ξ±)
section InfSet
variable [Preorder Ξ±] [InfSet Ξ±]
noncomputable def subsetInfSet [Inhabited s] : InfSet s where
sInf t :=
if ht : t.Nonempty β§ BddBelow t β§ sInf ((β) '' t : Set Ξ±) β s
then β¨sInf ((β) '' t : Set Ξ±), ht.2.2β©
else default
#align subset_has_Inf subsetInfSet
attribute [local instance] subsetInfSet
@[simp]
theorem subset_sInf_def [Inhabited s] :
@sInf s _ = fun t =>
if ht : t.Nonempty β§ BddBelow t β§ sInf ((β) '' t : Set Ξ±) β s
then β¨sInf ((β) '' t : Set Ξ±), ht.2.2β© else
default :=
rfl
#align subset_Inf_def subset_sInf_def
theorem subset_sInf_of_within [Inhabited s] {t : Set s}
(h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((β) '' t : Set Ξ±) β s) :
sInf ((β) '' t : Set Ξ±) = (@sInf s _ t : Ξ±) := by simp [dif_pos, h, h', h'']
#align subset_Inf_of_within subset_sInf_of_within
| Mathlib/Order/CompleteLatticeIntervals.lean | 102 | 104 | theorem subset_sInf_emptyset [Inhabited s] :
sInf (β
: Set s) = default := by |
simp [sInf]
| 1 |
import Mathlib.Algebra.FreeNonUnitalNonAssocAlgebra
import Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra
import Mathlib.Algebra.Lie.UniversalEnveloping
import Mathlib.GroupTheory.GroupAction.Ring
#align_import algebra.lie.free from "leanprover-community/mathlib"@"841ac1a3d9162bf51c6327812ecb6e5e71883ac4"
universe u v w
noncomputable section
variable (R : Type u) (X : Type v) [CommRing R]
local notation "lib" => FreeNonUnitalNonAssocAlgebra
local notation "lib.lift" => FreeNonUnitalNonAssocAlgebra.lift
local notation "lib.of" => FreeNonUnitalNonAssocAlgebra.of
local notation "lib.lift_of_apply" => FreeNonUnitalNonAssocAlgebra.lift_of_apply
local notation "lib.lift_comp_of" => FreeNonUnitalNonAssocAlgebra.lift_comp_of
namespace FreeLieAlgebra
inductive Rel : lib R X β lib R X β Prop
| lie_self (a : lib R X) : Rel (a * a) 0
| leibniz_lie (a b c : lib R X) : Rel (a * (b * c)) (a * b * c + b * (a * c))
| smul (t : R) {a b : lib R X} : Rel a b β Rel (t β’ a) (t β’ b)
| add_right {a b : lib R X} (c : lib R X) : Rel a b β Rel (a + c) (b + c)
| mul_left (a : lib R X) {b c : lib R X} : Rel b c β Rel (a * b) (a * c)
| mul_right {a b : lib R X} (c : lib R X) : Rel a b β Rel (a * c) (b * c)
#align free_lie_algebra.rel FreeLieAlgebra.Rel
variable {R X}
| Mathlib/Algebra/Lie/Free.lean | 87 | 88 | theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c) := by |
rw [add_comm _ b, add_comm _ c]; exact h.add_right _
| 1 |
import Mathlib.Topology.Algebra.InfiniteSum.Group
import Mathlib.Logic.Encodable.Lattice
noncomputable section
open Filter Finset Function Encodable
open scoped Topology
variable {M : Type*} [CommMonoid M] [TopologicalSpace M] {m m' : M}
variable {G : Type*} [CommGroup G] {g g' : G}
-- don't declare [TopologicalAddGroup G] here as some results require [UniformAddGroup G] instead
section Nat
section Monoid
namespace HasProd
@[to_additive "If `f : β β M` has sum `m`, then the partial sums `β i β range n, f i` converge
to `m`."]
theorem tendsto_prod_nat {f : β β M} (h : HasProd f m) :
Tendsto (fun n β¦ β i β range n, f i) atTop (π m) :=
h.comp tendsto_finset_range
#align has_sum.tendsto_sum_nat HasSum.tendsto_sum_nat
@[to_additive "If `f : β β M` is summable, then the partial sums `β i β range n, f i` converge
to `β' i, f i`."]
theorem Multipliable.tendsto_prod_tprod_nat {f : β β M} (h : Multipliable f) :
Tendsto (fun n β¦ β i β range n, f i) atTop (π (β' i, f i)) :=
tendsto_prod_nat h.hasProd
section tprod
variable [T2Space M] {Ξ± Ξ² Ξ³ : Type*}
section UniformGroup
variable [UniformSpace G] [UniformGroup G]
@[to_additive]
theorem cauchySeq_finset_iff_nat_tprod_vanishing {f : β β G} :
(CauchySeq fun s : Finset β β¦ β n β s, f n) β
β e β π (1 : G), β N : β, β t β {n | N β€ n}, (β' n : t, f n) β e := by
refine cauchySeq_finset_iff_tprod_vanishing.trans β¨fun vanish e he β¦ ?_, fun vanish e he β¦ ?_β©
Β· obtain β¨s, hsβ© := vanish e he
refine β¨if h : s.Nonempty then s.max' h + 1 else 0,
fun t ht β¦ hs _ <| Set.disjoint_left.mpr ?_β©
split_ifs at ht with h
Β· exact fun m hmt hms β¦ (s.le_max' _ hms).not_lt (Nat.succ_le_iff.mp <| ht hmt)
Β· exact fun _ _ hs β¦ h β¨_, hsβ©
Β· obtain β¨N, hNβ© := vanish e he
exact β¨range N, fun t ht β¦ hN _ fun n hnt β¦
le_of_not_lt fun h β¦ Set.disjoint_left.mp ht hnt (mem_range.mpr h)β©
variable [CompleteSpace G]
@[to_additive]
| Mathlib/Topology/Algebra/InfiniteSum/NatInt.lean | 290 | 292 | theorem multipliable_iff_nat_tprod_vanishing {f : β β G} : Multipliable f β
β e β π 1, β N : β, β t β {n | N β€ n}, (β' n : t, f n) β e := by |
rw [multipliable_iff_cauchySeq_finset, cauchySeq_finset_iff_nat_tprod_vanishing]
| 1 |
import Mathlib.Order.UpperLower.Basic
import Mathlib.Data.Finset.Preimage
#align_import combinatorics.young.young_diagram from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf"
open Function
@[ext]
structure YoungDiagram where
cells : Finset (β Γ β)
isLowerSet : IsLowerSet (cells : Set (β Γ β))
#align young_diagram YoungDiagram
namespace YoungDiagram
instance : SetLike YoungDiagram (β Γ β) where
-- Porting note (#11215): TODO: figure out how to do this correctly
coe := fun y => y.cells
coe_injective' ΞΌ Ξ½ h := by rwa [YoungDiagram.ext_iff, β Finset.coe_inj]
@[simp]
theorem mem_cells {ΞΌ : YoungDiagram} (c : β Γ β) : c β ΞΌ.cells β c β ΞΌ :=
Iff.rfl
#align young_diagram.mem_cells YoungDiagram.mem_cells
@[simp]
theorem mem_mk (c : β Γ β) (cells) (isLowerSet) :
c β YoungDiagram.mk cells isLowerSet β c β cells :=
Iff.rfl
#align young_diagram.mem_mk YoungDiagram.mem_mk
instance decidableMem (ΞΌ : YoungDiagram) : DecidablePred (Β· β ΞΌ) :=
inferInstanceAs (DecidablePred (Β· β ΞΌ.cells))
#align young_diagram.decidable_mem YoungDiagram.decidableMem
theorem up_left_mem (ΞΌ : YoungDiagram) {i1 i2 j1 j2 : β} (hi : i1 β€ i2) (hj : j1 β€ j2)
(hcell : (i2, j2) β ΞΌ) : (i1, j1) β ΞΌ :=
ΞΌ.isLowerSet (Prod.mk_le_mk.mpr β¨hi, hjβ©) hcell
#align young_diagram.up_left_mem YoungDiagram.up_left_mem
protected abbrev card (ΞΌ : YoungDiagram) : β :=
ΞΌ.cells.card
#align young_diagram.card YoungDiagram.card
section Rows
def row (ΞΌ : YoungDiagram) (i : β) : Finset (β Γ β) :=
ΞΌ.cells.filter fun c => c.fst = i
#align young_diagram.row YoungDiagram.row
theorem mem_row_iff {ΞΌ : YoungDiagram} {i : β} {c : β Γ β} : c β ΞΌ.row i β c β ΞΌ β§ c.fst = i := by
simp [row]
#align young_diagram.mem_row_iff YoungDiagram.mem_row_iff
theorem mk_mem_row_iff {ΞΌ : YoungDiagram} {i j : β} : (i, j) β ΞΌ.row i β (i, j) β ΞΌ := by simp [row]
#align young_diagram.mk_mem_row_iff YoungDiagram.mk_mem_row_iff
protected theorem exists_not_mem_row (ΞΌ : YoungDiagram) (i : β) : β j, (i, j) β ΞΌ := by
obtain β¨j, hjβ© :=
Infinite.exists_not_mem_finset
(ΞΌ.cells.preimage (Prod.mk i) fun _ _ _ _ h => by
cases h
rfl)
rw [Finset.mem_preimage] at hj
exact β¨j, hjβ©
#align young_diagram.exists_not_mem_row YoungDiagram.exists_not_mem_row
def rowLen (ΞΌ : YoungDiagram) (i : β) : β :=
Nat.find <| ΞΌ.exists_not_mem_row i
#align young_diagram.row_len YoungDiagram.rowLen
theorem mem_iff_lt_rowLen {ΞΌ : YoungDiagram} {i j : β} : (i, j) β ΞΌ β j < ΞΌ.rowLen i := by
rw [rowLen, Nat.lt_find_iff]
push_neg
exact β¨fun h _ hmj => ΞΌ.up_left_mem (by rfl) hmj h, fun h => h _ (by rfl)β©
#align young_diagram.mem_iff_lt_row_len YoungDiagram.mem_iff_lt_rowLen
theorem row_eq_prod {ΞΌ : YoungDiagram} {i : β} : ΞΌ.row i = {i} ΓΛ’ Finset.range (ΞΌ.rowLen i) := by
ext β¨a, bβ©
simp only [Finset.mem_product, Finset.mem_singleton, Finset.mem_range, mem_row_iff,
mem_iff_lt_rowLen, and_comm, and_congr_right_iff]
rintro rfl
rfl
#align young_diagram.row_eq_prod YoungDiagram.row_eq_prod
| Mathlib/Combinatorics/Young/YoungDiagram.lean | 321 | 322 | theorem rowLen_eq_card (ΞΌ : YoungDiagram) {i : β} : ΞΌ.rowLen i = (ΞΌ.row i).card := by |
simp [row_eq_prod]
| 1 |
import Mathlib.Data.ENNReal.Inv
#align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520"
open Set NNReal ENNReal
namespace ENNReal
section iSup
@[simp]
theorem iSup_eq_zero {ΞΉ : Sort*} {f : ΞΉ β ββ₯0β} : β¨ i, f i = 0 β β i, f i = 0 :=
iSup_eq_bot
#align ennreal.supr_eq_zero ENNReal.iSup_eq_zero
@[simp]
| Mathlib/Data/ENNReal/Real.lean | 676 | 676 | theorem iSup_zero_eq_zero {ΞΉ : Sort*} : β¨ _ : ΞΉ, (0 : ββ₯0β) = 0 := by | simp
| 1 |
import Mathlib.Data.Finset.Lattice
import Mathlib.Data.Multiset.Powerset
#align_import data.finset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
namespace Finset
open Function Multiset
variable {Ξ± : Type*} {s t : Finset Ξ±}
section Powerset
def powerset (s : Finset Ξ±) : Finset (Finset Ξ±) :=
β¨(s.1.powerset.pmap Finset.mk) fun _t h => nodup_of_le (mem_powerset.1 h) s.nodup,
s.nodup.powerset.pmap fun _a _ha _b _hb => congr_arg Finset.valβ©
#align finset.powerset Finset.powerset
@[simp]
theorem mem_powerset {s t : Finset Ξ±} : s β powerset t β s β t := by
cases s
simp [powerset, mem_mk, mem_pmap, mk.injEq, mem_powerset, exists_prop, exists_eq_right,
β val_le_iff]
#align finset.mem_powerset Finset.mem_powerset
@[simp, norm_cast]
theorem coe_powerset (s : Finset Ξ±) :
(s.powerset : Set (Finset Ξ±)) = ((β) : Finset Ξ± β Set Ξ±) β»ΒΉ' (s : Set Ξ±).powerset := by
ext
simp
#align finset.coe_powerset Finset.coe_powerset
-- Porting note: remove @[simp], simp can prove it
theorem empty_mem_powerset (s : Finset Ξ±) : β
β powerset s :=
mem_powerset.2 (empty_subset _)
#align finset.empty_mem_powerset Finset.empty_mem_powerset
-- Porting note: remove @[simp], simp can prove it
theorem mem_powerset_self (s : Finset Ξ±) : s β powerset s :=
mem_powerset.2 Subset.rfl
#align finset.mem_powerset_self Finset.mem_powerset_self
@[aesop safe apply (rule_sets := [finsetNonempty])]
theorem powerset_nonempty (s : Finset Ξ±) : s.powerset.Nonempty :=
β¨β
, empty_mem_powerset _β©
#align finset.powerset_nonempty Finset.powerset_nonempty
@[simp]
theorem powerset_mono {s t : Finset Ξ±} : powerset s β powerset t β s β t :=
β¨fun h => mem_powerset.1 <| h <| mem_powerset_self _, fun st _u h =>
mem_powerset.2 <| Subset.trans (mem_powerset.1 h) stβ©
#align finset.powerset_mono Finset.powerset_mono
theorem powerset_injective : Injective (powerset : Finset Ξ± β Finset (Finset Ξ±)) :=
(injective_of_le_imp_le _) powerset_mono.1
#align finset.powerset_injective Finset.powerset_injective
@[simp]
theorem powerset_inj : powerset s = powerset t β s = t :=
powerset_injective.eq_iff
#align finset.powerset_inj Finset.powerset_inj
@[simp]
theorem powerset_empty : (β
: Finset Ξ±).powerset = {β
} :=
rfl
#align finset.powerset_empty Finset.powerset_empty
@[simp]
| Mathlib/Data/Finset/Powerset.lean | 83 | 84 | theorem powerset_eq_singleton_empty : s.powerset = {β
} β s = β
:= by |
rw [β powerset_empty, powerset_inj]
| 1 |
import Mathlib.Data.Int.AbsoluteValue
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic
#align_import linear_algebra.matrix.absolute_value from "leanprover-community/mathlib"@"ab0a2959c83b06280ef576bc830d4aa5fe8c8e61"
open Matrix
namespace Matrix
open Equiv Finset
variable {R S : Type*} [CommRing R] [Nontrivial R] [LinearOrderedCommRing S]
variable {n : Type*} [Fintype n] [DecidableEq n]
| Mathlib/LinearAlgebra/Matrix/AbsoluteValue.lean | 37 | 49 | theorem det_le {A : Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : β i j, abv (A i j) β€ x) :
abv A.det β€ Nat.factorial (Fintype.card n) β’ x ^ Fintype.card n :=
calc
abv A.det = abv (β Ο : Perm n, Perm.sign Ο β’ β i, A (Ο i) i) := congr_arg abv (det_apply _)
_ β€ β Ο : Perm n, abv (Perm.sign Ο β’ β i, A (Ο i) i) := abv.sum_le _ _
_ = β Ο : Perm n, β i, abv (A (Ο i) i) :=
(sum_congr rfl fun Ο _ => by rw [abv.map_units_int_smul, abv.map_prod])
_ β€ β _Ο : Perm n, β _i : n, x :=
(sum_le_sum fun _ _ => prod_le_prod (fun _ _ => abv.nonneg _) fun _ _ => hx _ _)
_ = β _Ο : Perm n, x ^ Fintype.card n :=
(sum_congr rfl fun _ _ => by rw [prod_const, Finset.card_univ])
_ = Nat.factorial (Fintype.card n) β’ x ^ Fintype.card n := by |
rw [sum_const, Finset.card_univ, Fintype.card_perm]
| 1 |
import Mathlib.Topology.MetricSpace.PseudoMetric
#align_import topology.metric_space.basic from "leanprover-community/mathlib"@"c8f305514e0d47dfaa710f5a52f0d21b588e6328"
open Set Filter Bornology
open scoped NNReal Uniformity
universe u v w
variable {Ξ± : Type u} {Ξ² : Type v} {X ΞΉ : Type*}
variable [PseudoMetricSpace Ξ±]
class MetricSpace (Ξ± : Type u) extends PseudoMetricSpace Ξ± : Type u where
eq_of_dist_eq_zero : β {x y : Ξ±}, dist x y = 0 β x = y
#align metric_space MetricSpace
@[ext]
theorem MetricSpace.ext {Ξ± : Type*} {m m' : MetricSpace Ξ±} (h : m.toDist = m'.toDist) :
m = m' := by
cases m; cases m'; congr; ext1; assumption
#align metric_space.ext MetricSpace.ext
def MetricSpace.ofDistTopology {Ξ± : Type u} [TopologicalSpace Ξ±] (dist : Ξ± β Ξ± β β)
(dist_self : β x : Ξ±, dist x x = 0) (dist_comm : β x y : Ξ±, dist x y = dist y x)
(dist_triangle : β x y z : Ξ±, dist x z β€ dist x y + dist y z)
(H : β s : Set Ξ±, IsOpen s β β x β s, β Ξ΅ > 0, β y, dist x y < Ξ΅ β y β s)
(eq_of_dist_eq_zero : β x y : Ξ±, dist x y = 0 β x = y) : MetricSpace Ξ± :=
{ PseudoMetricSpace.ofDistTopology dist dist_self dist_comm dist_triangle H with
eq_of_dist_eq_zero := eq_of_dist_eq_zero _ _ }
#align metric_space.of_dist_topology MetricSpace.ofDistTopology
variable {Ξ³ : Type w} [MetricSpace Ξ³]
theorem eq_of_dist_eq_zero {x y : Ξ³} : dist x y = 0 β x = y :=
MetricSpace.eq_of_dist_eq_zero
#align eq_of_dist_eq_zero eq_of_dist_eq_zero
@[simp]
theorem dist_eq_zero {x y : Ξ³} : dist x y = 0 β x = y :=
Iff.intro eq_of_dist_eq_zero fun this => this βΈ dist_self _
#align dist_eq_zero dist_eq_zero
@[simp]
theorem zero_eq_dist {x y : Ξ³} : 0 = dist x y β x = y := by rw [eq_comm, dist_eq_zero]
#align zero_eq_dist zero_eq_dist
theorem dist_ne_zero {x y : Ξ³} : dist x y β 0 β x β y := by
simpa only [not_iff_not] using dist_eq_zero
#align dist_ne_zero dist_ne_zero
@[simp]
theorem dist_le_zero {x y : Ξ³} : dist x y β€ 0 β x = y := by
simpa [le_antisymm_iff, dist_nonneg] using @dist_eq_zero _ _ x y
#align dist_le_zero dist_le_zero
@[simp]
theorem dist_pos {x y : Ξ³} : 0 < dist x y β x β y := by
simpa only [not_le] using not_congr dist_le_zero
#align dist_pos dist_pos
theorem eq_of_forall_dist_le {x y : Ξ³} (h : β Ξ΅ > 0, dist x y β€ Ξ΅) : x = y :=
eq_of_dist_eq_zero (eq_of_le_of_forall_le_of_dense dist_nonneg h)
#align eq_of_forall_dist_le eq_of_forall_dist_le
| Mathlib/Topology/MetricSpace/Basic.lean | 96 | 97 | theorem eq_of_nndist_eq_zero {x y : Ξ³} : nndist x y = 0 β x = y := by |
simp only [β NNReal.eq_iff, β dist_nndist, imp_self, NNReal.coe_zero, dist_eq_zero]
| 1 |
import Mathlib.Tactic.CategoryTheory.Reassoc
#align_import category_theory.isomorphism from "leanprover-community/mathlib"@"8350c34a64b9bc3fc64335df8006bffcadc7baa6"
universe v u
-- morphism levels before object levels. See note [CategoryTheory universes].
namespace CategoryTheory
open Category
structure Iso {C : Type u} [Category.{v} C] (X Y : C) where
hom : X βΆ Y
inv : Y βΆ X
hom_inv_id : hom β« inv = π X := by aesop_cat
inv_hom_id : inv β« hom = π Y := by aesop_cat
#align category_theory.iso CategoryTheory.Iso
#align category_theory.iso.hom CategoryTheory.Iso.hom
#align category_theory.iso.inv CategoryTheory.Iso.inv
#align category_theory.iso.inv_hom_id CategoryTheory.Iso.inv_hom_id
#align category_theory.iso.hom_inv_id CategoryTheory.Iso.hom_inv_id
attribute [reassoc (attr := simp)] Iso.hom_inv_id Iso.inv_hom_id
#align category_theory.iso.hom_inv_id_assoc CategoryTheory.Iso.hom_inv_id_assoc
#align category_theory.iso.inv_hom_id_assoc CategoryTheory.Iso.inv_hom_id_assoc
infixr:10 " β
" => Iso -- type as \cong or \iso
variable {C : Type u} [Category.{v} C] {X Y Z : C}
class IsIso (f : X βΆ Y) : Prop where
out : β inv : Y βΆ X, f β« inv = π X β§ inv β« f = π Y
#align category_theory.is_iso CategoryTheory.IsIso
noncomputable def inv (f : X βΆ Y) [I : IsIso f] : Y βΆ X :=
Classical.choose I.1
#align category_theory.inv CategoryTheory.inv
namespace IsIso
@[simp]
theorem hom_inv_id (f : X βΆ Y) [I : IsIso f] : f β« inv f = π X :=
(Classical.choose_spec I.1).left
#align category_theory.is_iso.hom_inv_id CategoryTheory.IsIso.hom_inv_id
@[simp]
theorem inv_hom_id (f : X βΆ Y) [I : IsIso f] : inv f β« f = π Y :=
(Classical.choose_spec I.1).right
#align category_theory.is_iso.inv_hom_id CategoryTheory.IsIso.inv_hom_id
-- FIXME putting @[reassoc] on the `hom_inv_id` above somehow unfolds `inv`
-- This happens even if we make `inv` irreducible!
-- I don't understand how this is happening: it is likely a bug.
-- attribute [reassoc] hom_inv_id inv_hom_id
-- #print hom_inv_id_assoc
-- theorem CategoryTheory.IsIso.hom_inv_id_assoc {X Y : C} (f : X βΆ Y) [I : IsIso f]
-- {Z : C} (h : X βΆ Z),
-- f β« Classical.choose (_ : Exists fun inv β¦ f β« inv = π X β§ inv β« f = π Y) β« h = h := ...
@[simp]
| Mathlib/CategoryTheory/Iso.lean | 290 | 291 | theorem hom_inv_id_assoc (f : X βΆ Y) [I : IsIso f] {Z} (g : X βΆ Z) : f β« inv f β« g = g := by |
simp [β Category.assoc]
| 1 |
import Mathlib.Data.List.Nodup
import Mathlib.Data.List.Zip
import Mathlib.Data.Nat.Defs
import Mathlib.Data.List.Infix
#align_import data.list.rotate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u
variable {Ξ± : Type u}
open Nat Function
namespace List
theorem rotate_mod (l : List Ξ±) (n : β) : l.rotate (n % l.length) = l.rotate n := by simp [rotate]
#align list.rotate_mod List.rotate_mod
@[simp]
theorem rotate_nil (n : β) : ([] : List Ξ±).rotate n = [] := by simp [rotate]
#align list.rotate_nil List.rotate_nil
@[simp]
theorem rotate_zero (l : List Ξ±) : l.rotate 0 = l := by simp [rotate]
#align list.rotate_zero List.rotate_zero
-- Porting note: removing simp, simp can prove it
theorem rotate'_nil (n : β) : ([] : List Ξ±).rotate' n = [] := by cases n <;> rfl
#align list.rotate'_nil List.rotate'_nil
@[simp]
theorem rotate'_zero (l : List Ξ±) : l.rotate' 0 = l := by cases l <;> rfl
#align list.rotate'_zero List.rotate'_zero
theorem rotate'_cons_succ (l : List Ξ±) (a : Ξ±) (n : β) :
(a :: l : List Ξ±).rotate' n.succ = (l ++ [a]).rotate' n := by simp [rotate']
#align list.rotate'_cons_succ List.rotate'_cons_succ
@[simp]
theorem length_rotate' : β (l : List Ξ±) (n : β), (l.rotate' n).length = l.length
| [], _ => by simp
| a :: l, 0 => rfl
| a :: l, n + 1 => by rw [List.rotate', length_rotate' (l ++ [a]) n]; simp
#align list.length_rotate' List.length_rotate'
theorem rotate'_eq_drop_append_take :
β {l : List Ξ±} {n : β}, n β€ l.length β l.rotate' n = l.drop n ++ l.take n
| [], n, h => by simp [drop_append_of_le_length h]
| l, 0, h => by simp [take_append_of_le_length h]
| a :: l, n + 1, h => by
have hnl : n β€ l.length := le_of_succ_le_succ h
have hnl' : n β€ (l ++ [a]).length := by
rw [length_append, length_cons, List.length]; exact le_of_succ_le h
rw [rotate'_cons_succ, rotate'_eq_drop_append_take hnl', drop, take,
drop_append_of_le_length hnl, take_append_of_le_length hnl]; simp
#align list.rotate'_eq_drop_append_take List.rotate'_eq_drop_append_take
theorem rotate'_rotate' : β (l : List Ξ±) (n m : β), (l.rotate' n).rotate' m = l.rotate' (n + m)
| a :: l, 0, m => by simp
| [], n, m => by simp
| a :: l, n + 1, m => by
rw [rotate'_cons_succ, rotate'_rotate' _ n, Nat.add_right_comm, β rotate'_cons_succ,
Nat.succ_eq_add_one]
#align list.rotate'_rotate' List.rotate'_rotate'
@[simp]
theorem rotate'_length (l : List Ξ±) : rotate' l l.length = l := by
rw [rotate'_eq_drop_append_take le_rfl]; simp
#align list.rotate'_length List.rotate'_length
@[simp]
theorem rotate'_length_mul (l : List Ξ±) : β n : β, l.rotate' (l.length * n) = l
| 0 => by simp
| n + 1 =>
calc
l.rotate' (l.length * (n + 1)) =
(l.rotate' (l.length * n)).rotate' (l.rotate' (l.length * n)).length := by
simp [-rotate'_length, Nat.mul_succ, rotate'_rotate']
_ = l := by rw [rotate'_length, rotate'_length_mul l n]
#align list.rotate'_length_mul List.rotate'_length_mul
theorem rotate'_mod (l : List Ξ±) (n : β) : l.rotate' (n % l.length) = l.rotate' n :=
calc
l.rotate' (n % l.length) =
(l.rotate' (n % l.length)).rotate' ((l.rotate' (n % l.length)).length * (n / l.length)) :=
by rw [rotate'_length_mul]
_ = l.rotate' n := by rw [rotate'_rotate', length_rotate', Nat.mod_add_div]
#align list.rotate'_mod List.rotate'_mod
theorem rotate_eq_rotate' (l : List Ξ±) (n : β) : l.rotate n = l.rotate' n :=
if h : l.length = 0 then by simp_all [length_eq_zero]
else by
rw [β rotate'_mod,
rotate'_eq_drop_append_take (le_of_lt (Nat.mod_lt _ (Nat.pos_of_ne_zero h)))];
simp [rotate]
#align list.rotate_eq_rotate' List.rotate_eq_rotate'
theorem rotate_cons_succ (l : List Ξ±) (a : Ξ±) (n : β) :
(a :: l : List Ξ±).rotate (n + 1) = (l ++ [a]).rotate n := by
rw [rotate_eq_rotate', rotate_eq_rotate', rotate'_cons_succ]
#align list.rotate_cons_succ List.rotate_cons_succ
@[simp]
theorem mem_rotate : β {l : List Ξ±} {a : Ξ±} {n : β}, a β l.rotate n β a β l
| [], _, n => by simp
| a :: l, _, 0 => by simp
| a :: l, _, n + 1 => by simp [rotate_cons_succ, mem_rotate, or_comm]
#align list.mem_rotate List.mem_rotate
@[simp]
| Mathlib/Data/List/Rotate.lean | 132 | 133 | theorem length_rotate (l : List Ξ±) (n : β) : (l.rotate n).length = l.length := by |
rw [rotate_eq_rotate', length_rotate']
| 1 |
import Mathlib.FieldTheory.Separable
import Mathlib.FieldTheory.SplittingField.Construction
import Mathlib.Algebra.CharP.Reduced
open Function Polynomial
class PerfectRing (R : Type*) (p : β) [CommSemiring R] [ExpChar R p] : Prop where
bijective_frobenius : Bijective <| frobenius R p
section PerfectRing
variable (R : Type*) (p m n : β) [CommSemiring R] [ExpChar R p]
lemma PerfectRing.ofSurjective (R : Type*) (p : β) [CommRing R] [ExpChar R p]
[IsReduced R] (h : Surjective <| frobenius R p) : PerfectRing R p :=
β¨frobenius_inj R p, hβ©
#align perfect_ring.of_surjective PerfectRing.ofSurjective
instance PerfectRing.ofFiniteOfIsReduced (R : Type*) [CommRing R] [ExpChar R p]
[Finite R] [IsReduced R] : PerfectRing R p :=
ofSurjective _ _ <| Finite.surjective_of_injective (frobenius_inj R p)
variable [PerfectRing R p]
@[simp]
theorem bijective_frobenius : Bijective (frobenius R p) := PerfectRing.bijective_frobenius
theorem bijective_iterateFrobenius : Bijective (iterateFrobenius R p n) :=
coe_iterateFrobenius R p n βΈ (bijective_frobenius R p).iterate n
@[simp]
theorem injective_frobenius : Injective (frobenius R p) := (bijective_frobenius R p).1
@[simp]
theorem surjective_frobenius : Surjective (frobenius R p) := (bijective_frobenius R p).2
@[simps! apply]
noncomputable def frobeniusEquiv : R β+* R :=
RingEquiv.ofBijective (frobenius R p) PerfectRing.bijective_frobenius
#align frobenius_equiv frobeniusEquiv
@[simp]
theorem coe_frobeniusEquiv : β(frobeniusEquiv R p) = frobenius R p := rfl
#align coe_frobenius_equiv coe_frobeniusEquiv
theorem frobeniusEquiv_def (x : R) : frobeniusEquiv R p x = x ^ p := rfl
@[simps! apply]
noncomputable def iterateFrobeniusEquiv : R β+* R :=
RingEquiv.ofBijective (iterateFrobenius R p n) (bijective_iterateFrobenius R p n)
@[simp]
theorem coe_iterateFrobeniusEquiv : β(iterateFrobeniusEquiv R p n) = iterateFrobenius R p n := rfl
theorem iterateFrobeniusEquiv_def (x : R) : iterateFrobeniusEquiv R p n x = x ^ p ^ n := rfl
theorem iterateFrobeniusEquiv_add_apply (x : R) : iterateFrobeniusEquiv R p (m + n) x =
iterateFrobeniusEquiv R p m (iterateFrobeniusEquiv R p n x) :=
iterateFrobenius_add_apply R p m n x
theorem iterateFrobeniusEquiv_add : iterateFrobeniusEquiv R p (m + n) =
(iterateFrobeniusEquiv R p n).trans (iterateFrobeniusEquiv R p m) :=
RingEquiv.ext (iterateFrobeniusEquiv_add_apply R p m n)
theorem iterateFrobeniusEquiv_symm_add_apply (x : R) : (iterateFrobeniusEquiv R p (m + n)).symm x =
(iterateFrobeniusEquiv R p m).symm ((iterateFrobeniusEquiv R p n).symm x) :=
(iterateFrobeniusEquiv R p (m + n)).injective <| by rw [RingEquiv.apply_symm_apply, add_comm,
iterateFrobeniusEquiv_add_apply, RingEquiv.apply_symm_apply, RingEquiv.apply_symm_apply]
theorem iterateFrobeniusEquiv_symm_add : (iterateFrobeniusEquiv R p (m + n)).symm =
(iterateFrobeniusEquiv R p n).symm.trans (iterateFrobeniusEquiv R p m).symm :=
RingEquiv.ext (iterateFrobeniusEquiv_symm_add_apply R p m n)
theorem iterateFrobeniusEquiv_zero_apply (x : R) : iterateFrobeniusEquiv R p 0 x = x := by
rw [iterateFrobeniusEquiv_def, pow_zero, pow_one]
theorem iterateFrobeniusEquiv_one_apply (x : R) : iterateFrobeniusEquiv R p 1 x = x ^ p := by
rw [iterateFrobeniusEquiv_def, pow_one]
@[simp]
theorem iterateFrobeniusEquiv_zero : iterateFrobeniusEquiv R p 0 = RingEquiv.refl R :=
RingEquiv.ext (iterateFrobeniusEquiv_zero_apply R p)
@[simp]
theorem iterateFrobeniusEquiv_one : iterateFrobeniusEquiv R p 1 = frobeniusEquiv R p :=
RingEquiv.ext (iterateFrobeniusEquiv_one_apply R p)
theorem iterateFrobeniusEquiv_eq_pow : iterateFrobeniusEquiv R p n = frobeniusEquiv R p ^ n :=
DFunLike.ext' <| show _ = β(RingAut.toPerm _ _) by
rw [map_pow, Equiv.Perm.coe_pow]; exact (pow_iterate p n).symm
theorem iterateFrobeniusEquiv_symm :
(iterateFrobeniusEquiv R p n).symm = (frobeniusEquiv R p).symm ^ n := by
rw [iterateFrobeniusEquiv_eq_pow]; exact (inv_pow _ _).symm
@[simp]
theorem frobeniusEquiv_symm_apply_frobenius (x : R) :
(frobeniusEquiv R p).symm (frobenius R p x) = x :=
leftInverse_surjInv PerfectRing.bijective_frobenius x
@[simp]
theorem frobenius_apply_frobeniusEquiv_symm (x : R) :
frobenius R p ((frobeniusEquiv R p).symm x) = x :=
surjInv_eq _ _
@[simp]
theorem frobenius_comp_frobeniusEquiv_symm :
(frobenius R p).comp (frobeniusEquiv R p).symm = RingHom.id R := by
ext; simp
@[simp]
| Mathlib/FieldTheory/Perfect.lean | 151 | 153 | theorem frobeniusEquiv_symm_comp_frobenius :
((frobeniusEquiv R p).symm : R β+* R).comp (frobenius R p) = RingHom.id R := by |
ext; simp
| 1 |
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Combinatorics.Additive.AP.Three.Defs
import Mathlib.Combinatorics.Pigeonhole
import Mathlib.Data.Complex.ExponentialBounds
#align_import combinatorics.additive.behrend from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8"
open Nat hiding log
open Finset Metric Real
open scoped Pointwise
lemma threeAPFree_frontier {π E : Type*} [LinearOrderedField π] [TopologicalSpace E]
[AddCommMonoid E] [Module π E] {s : Set E} (hsβ : IsClosed s) (hsβ : StrictConvex π s) :
ThreeAPFree (frontier s) := by
intro a ha b hb c hc habc
obtain rfl : (1 / 2 : π) β’ a + (1 / 2 : π) β’ c = b := by
rwa [β smul_add, one_div, inv_smul_eq_iffβ (show (2 : π) β 0 by norm_num), two_smul]
have :=
hsβ.eq (hsβ.frontier_subset ha) (hsβ.frontier_subset hc) one_half_pos one_half_pos
(add_halves _) hb.2
simp [this, β add_smul]
ring_nf
simp
#align add_salem_spencer_frontier threeAPFree_frontier
lemma threeAPFree_sphere {E : Type*} [NormedAddCommGroup E] [NormedSpace β E]
[StrictConvexSpace β E] (x : E) (r : β) : ThreeAPFree (sphere x r) := by
obtain rfl | hr := eq_or_ne r 0
Β· rw [sphere_zero]
exact threeAPFree_singleton _
Β· convert threeAPFree_frontier isClosed_ball (strictConvex_closedBall β x r)
exact (frontier_closedBall _ hr).symm
#align add_salem_spencer_sphere threeAPFree_sphere
namespace Behrend
variable {Ξ± Ξ² : Type*} {n d k N : β} {x : Fin n β β}
def box (n d : β) : Finset (Fin n β β) :=
Fintype.piFinset fun _ => range d
#align behrend.box Behrend.box
theorem mem_box : x β box n d β β i, x i < d := by simp only [box, Fintype.mem_piFinset, mem_range]
#align behrend.mem_box Behrend.mem_box
@[simp]
theorem card_box : (box n d).card = d ^ n := by simp [box]
#align behrend.card_box Behrend.card_box
@[simp]
theorem box_zero : box (n + 1) 0 = β
:= by simp [box]
#align behrend.box_zero Behrend.box_zero
def sphere (n d k : β) : Finset (Fin n β β) :=
(box n d).filter fun x => β i, x i ^ 2 = k
#align behrend.sphere Behrend.sphere
theorem sphere_zero_subset : sphere n d 0 β 0 := fun x => by simp [sphere, Function.funext_iff]
#align behrend.sphere_zero_subset Behrend.sphere_zero_subset
@[simp]
theorem sphere_zero_right (n k : β) : sphere (n + 1) 0 k = β
:= by simp [sphere]
#align behrend.sphere_zero_right Behrend.sphere_zero_right
theorem sphere_subset_box : sphere n d k β box n d :=
filter_subset _ _
#align behrend.sphere_subset_box Behrend.sphere_subset_box
theorem norm_of_mem_sphere {x : Fin n β β} (hx : x β sphere n d k) :
β(WithLp.equiv 2 _).symm ((β) β x : Fin n β β)β = ββk := by
rw [EuclideanSpace.norm_eq]
dsimp
simp_rw [abs_cast, β cast_pow, β cast_sum, (mem_filter.1 hx).2]
#align behrend.norm_of_mem_sphere Behrend.norm_of_mem_sphere
theorem sphere_subset_preimage_metric_sphere : (sphere n d k : Set (Fin n β β)) β
(fun x : Fin n β β => (WithLp.equiv 2 _).symm ((β) β x : Fin n β β)) β»ΒΉ'
Metric.sphere (0 : PiLp 2 fun _ : Fin n => β) (ββk) :=
fun x hx => by rw [Set.mem_preimage, mem_sphere_zero_iff_norm, norm_of_mem_sphere hx]
#align behrend.sphere_subset_preimage_metric_sphere Behrend.sphere_subset_preimage_metric_sphere
@[simps]
def map (d : β) : (Fin n β β) β+ β where
toFun a := β i, a i * d ^ (i : β)
map_zero' := by simp_rw [Pi.zero_apply, zero_mul, sum_const_zero]
map_add' a b := by simp_rw [Pi.add_apply, add_mul, sum_add_distrib]
#align behrend.map Behrend.map
-- @[simp] -- Porting note (#10618): simp can prove this
| Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean | 147 | 147 | theorem map_zero (d : β) (a : Fin 0 β β) : map d a = 0 := by | simp [map]
| 1 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {Ξ± : Type u} [Preorder Ξ±] {a : Ξ±} : Β¬a < a := _root_.lt_irrefl a
theorem eq_of_eq_of_eq {Ξ±} [OrderedSemiring Ξ±] {a b : Ξ±} (ha : a = 0) (hb : b = 0) : a + b = 0 := by
simp [*]
theorem le_of_eq_of_le {Ξ±} [OrderedSemiring Ξ±] {a b : Ξ±} (ha : a = 0) (hb : b β€ 0) : a + b β€ 0 := by
simp [*]
theorem lt_of_eq_of_lt {Ξ±} [OrderedSemiring Ξ±] {a b : Ξ±} (ha : a = 0) (hb : b < 0) : a + b < 0 := by
simp [*]
theorem le_of_le_of_eq {Ξ±} [OrderedSemiring Ξ±] {a b : Ξ±} (ha : a β€ 0) (hb : b = 0) : a + b β€ 0 := by
simp [*]
theorem lt_of_lt_of_eq {Ξ±} [OrderedSemiring Ξ±] {a b : Ξ±} (ha : a < 0) (hb : b = 0) : a + b < 0 := by
simp [*]
theorem mul_neg {Ξ±} [StrictOrderedRing Ξ±] {a b : Ξ±} (ha : a < 0) (hb : 0 < b) : b * a < 0 :=
have : (-b)*a > 0 := mul_pos_of_neg_of_neg (neg_neg_of_pos hb) ha
neg_of_neg_pos (by simpa)
theorem mul_nonpos {Ξ±} [OrderedRing Ξ±] {a b : Ξ±} (ha : a β€ 0) (hb : 0 < b) : b * a β€ 0 :=
have : (-b)*a β₯ 0 := mul_nonneg_of_nonpos_of_nonpos (le_of_lt (neg_neg_of_pos hb)) ha
by simpa
-- used alongside `mul_neg` and `mul_nonpos`, so has the same argument pattern for uniformity
@[nolint unusedArguments]
| Mathlib/Tactic/Linarith/Lemmas.lean | 52 | 53 | theorem mul_eq {Ξ±} [OrderedSemiring Ξ±] {a b : Ξ±} (ha : a = 0) (_ : 0 < b) : b * a = 0 := by |
simp [*]
| 1 |
import Mathlib.Init.Function
#align_import data.option.n_ary from "leanprover-community/mathlib"@"995b47e555f1b6297c7cf16855f1023e355219fb"
universe u
open Function
namespace Option
variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {f : Ξ± β Ξ² β Ξ³} {a : Option Ξ±} {b : Option Ξ²} {c : Option Ξ³}
def mapβ (f : Ξ± β Ξ² β Ξ³) (a : Option Ξ±) (b : Option Ξ²) : Option Ξ³ :=
a.bind fun a => b.map <| f a
#align option.mapβ Option.mapβ
theorem mapβ_def {Ξ± Ξ² Ξ³ : Type u} (f : Ξ± β Ξ² β Ξ³) (a : Option Ξ±) (b : Option Ξ²) :
mapβ f a b = f <$> a <*> b := by
cases a <;> rfl
#align option.mapβ_def Option.mapβ_def
-- Porting note (#10618): In Lean3, was `@[simp]` but now `simp` can prove it
theorem mapβ_some_some (f : Ξ± β Ξ² β Ξ³) (a : Ξ±) (b : Ξ²) : mapβ f (some a) (some b) = f a b := rfl
#align option.mapβ_some_some Option.mapβ_some_some
theorem mapβ_coe_coe (f : Ξ± β Ξ² β Ξ³) (a : Ξ±) (b : Ξ²) : mapβ f a b = f a b := rfl
#align option.mapβ_coe_coe Option.mapβ_coe_coe
@[simp]
theorem mapβ_none_left (f : Ξ± β Ξ² β Ξ³) (b : Option Ξ²) : mapβ f none b = none := rfl
#align option.mapβ_none_left Option.mapβ_none_left
@[simp]
theorem mapβ_none_right (f : Ξ± β Ξ² β Ξ³) (a : Option Ξ±) : mapβ f a none = none := by cases a <;> rfl
#align option.mapβ_none_right Option.mapβ_none_right
@[simp]
theorem mapβ_coe_left (f : Ξ± β Ξ² β Ξ³) (a : Ξ±) (b : Option Ξ²) : mapβ f a b = b.map fun b => f a b :=
rfl
#align option.mapβ_coe_left Option.mapβ_coe_left
-- Porting note: This proof was `rfl` in Lean3, but now is not.
@[simp]
theorem mapβ_coe_right (f : Ξ± β Ξ² β Ξ³) (a : Option Ξ±) (b : Ξ²) :
mapβ f a b = a.map fun a => f a b := by cases a <;> rfl
#align option.mapβ_coe_right Option.mapβ_coe_right
-- Porting note: Removed the `@[simp]` tag as membership of an `Option` is no-longer simp-normal.
theorem mem_mapβ_iff {c : Ξ³} : c β mapβ f a b β β a' b', a' β a β§ b' β b β§ f a' b' = c := by
simp [mapβ, bind_eq_some]
#align option.mem_mapβ_iff Option.mem_mapβ_iff
@[simp]
theorem mapβ_eq_none_iff : mapβ f a b = none β a = none β¨ b = none := by
cases a <;> cases b <;> simp
#align option.mapβ_eq_none_iff Option.mapβ_eq_none_iff
theorem mapβ_swap (f : Ξ± β Ξ² β Ξ³) (a : Option Ξ±) (b : Option Ξ²) :
mapβ f a b = mapβ (fun a b => f b a) b a := by cases a <;> cases b <;> rfl
#align option.mapβ_swap Option.mapβ_swap
theorem map_mapβ (f : Ξ± β Ξ² β Ξ³) (g : Ξ³ β Ξ΄) :
(mapβ f a b).map g = mapβ (fun a b => g (f a b)) a b := by cases a <;> cases b <;> rfl
#align option.map_mapβ Option.map_mapβ
| Mathlib/Data/Option/NAry.lean | 95 | 96 | theorem mapβ_map_left (f : Ξ³ β Ξ² β Ξ΄) (g : Ξ± β Ξ³) :
mapβ f (a.map g) b = mapβ (fun a b => f (g a) b) a b := by | cases a <;> rfl
| 1 |
import Mathlib.Algebra.GroupPower.IterateHom
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Order.Iterate
import Mathlib.Order.SemiconjSup
import Mathlib.Tactic.Monotonicity
import Mathlib.Topology.Order.MonotoneContinuity
#align_import dynamics.circle.rotation_number.translation_number from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open scoped Classical
open Filter Set Int Topology
open Function hiding Commute
structure CircleDeg1Lift extends β βo β : Type where
map_add_one' : β x, toFun (x + 1) = toFun x + 1
#align circle_deg1_lift CircleDeg1Lift
namespace CircleDeg1Lift
instance : FunLike CircleDeg1Lift β β where
coe f := f.toFun
coe_injective' | β¨β¨_, _β©, _β©, β¨β¨_, _β©, _β©, rfl => rfl
instance : OrderHomClass CircleDeg1Lift β β where
map_rel f _ _ h := f.monotone' h
@[simp] theorem coe_mk (f h) : β(mk f h) = f := rfl
#align circle_deg1_lift.coe_mk CircleDeg1Lift.coe_mk
variable (f g : CircleDeg1Lift)
@[simp] theorem coe_toOrderHom : βf.toOrderHom = f := rfl
protected theorem monotone : Monotone f := f.monotone'
#align circle_deg1_lift.monotone CircleDeg1Lift.monotone
@[mono] theorem mono {x y} (h : x β€ y) : f x β€ f y := f.monotone h
#align circle_deg1_lift.mono CircleDeg1Lift.mono
theorem strictMono_iff_injective : StrictMono f β Injective f :=
f.monotone.strictMono_iff_injective
#align circle_deg1_lift.strict_mono_iff_injective CircleDeg1Lift.strictMono_iff_injective
@[simp]
theorem map_add_one : β x, f (x + 1) = f x + 1 :=
f.map_add_one'
#align circle_deg1_lift.map_add_one CircleDeg1Lift.map_add_one
@[simp]
theorem map_one_add (x : β) : f (1 + x) = 1 + f x := by rw [add_comm, map_add_one, add_comm 1]
#align circle_deg1_lift.map_one_add CircleDeg1Lift.map_one_add
#noalign circle_deg1_lift.coe_inj -- Use `DFunLike.coe_inj`
@[ext]
theorem ext β¦f g : CircleDeg1Liftβ¦ (h : β x, f x = g x) : f = g :=
DFunLike.ext f g h
#align circle_deg1_lift.ext CircleDeg1Lift.ext
theorem ext_iff {f g : CircleDeg1Lift} : f = g β β x, f x = g x :=
DFunLike.ext_iff
#align circle_deg1_lift.ext_iff CircleDeg1Lift.ext_iff
instance : Monoid CircleDeg1Lift where
mul f g :=
{ toOrderHom := f.1.comp g.1
map_add_one' := fun x => by simp [map_add_one] }
one := β¨.id, fun _ => rflβ©
mul_one f := rfl
one_mul f := rfl
mul_assoc fβ fβ fβ := DFunLike.coe_injective rfl
instance : Inhabited CircleDeg1Lift := β¨1β©
@[simp]
theorem coe_mul : β(f * g) = f β g :=
rfl
#align circle_deg1_lift.coe_mul CircleDeg1Lift.coe_mul
theorem mul_apply (x) : (f * g) x = f (g x) :=
rfl
#align circle_deg1_lift.mul_apply CircleDeg1Lift.mul_apply
@[simp]
theorem coe_one : β(1 : CircleDeg1Lift) = id :=
rfl
#align circle_deg1_lift.coe_one CircleDeg1Lift.coe_one
instance unitsHasCoeToFun : CoeFun CircleDeg1LiftΛ£ fun _ => β β β :=
β¨fun f => β(f : CircleDeg1Lift)β©
#align circle_deg1_lift.units_has_coe_to_fun CircleDeg1Lift.unitsHasCoeToFun
#noalign circle_deg1_lift.units_coe -- now LHS = RHS
@[simp]
theorem units_inv_apply_apply (f : CircleDeg1LiftΛ£) (x : β) :
(fβ»ΒΉ : CircleDeg1LiftΛ£) (f x) = x := by simp only [β mul_apply, f.inv_mul, coe_one, id]
#align circle_deg1_lift.units_inv_apply_apply CircleDeg1Lift.units_inv_apply_apply
@[simp]
| Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean | 218 | 219 | theorem units_apply_inv_apply (f : CircleDeg1LiftΛ£) (x : β) :
f ((fβ»ΒΉ : CircleDeg1LiftΛ£) x) = x := by | simp only [β mul_apply, f.mul_inv, coe_one, id]
| 1 |
import Mathlib.Algebra.BigOperators.Group.Finset
#align_import data.nat.gcd.big_operators from "leanprover-community/mathlib"@"008205aa645b3f194c1da47025c5f110c8406eab"
namespace Nat
variable {ΞΉ : Type*}
theorem coprime_list_prod_left_iff {l : List β} {k : β} :
Coprime l.prod k β β n β l, Coprime n k := by
induction l <;> simp [Nat.coprime_mul_iff_left, *]
theorem coprime_list_prod_right_iff {k : β} {l : List β} :
Coprime k l.prod β β n β l, Coprime k n := by
simp_rw [coprime_comm (n := k), coprime_list_prod_left_iff]
theorem coprime_multiset_prod_left_iff {m : Multiset β} {k : β} :
Coprime m.prod k β β n β m, Coprime n k := by
induction m using Quotient.inductionOn; simpa using coprime_list_prod_left_iff
theorem coprime_multiset_prod_right_iff {k : β} {m : Multiset β} :
Coprime k m.prod β β n β m, Coprime k n := by
induction m using Quotient.inductionOn; simpa using coprime_list_prod_right_iff
theorem coprime_prod_left_iff {t : Finset ΞΉ} {s : ΞΉ β β} {x : β} :
Coprime (β i β t, s i) x β β i β t, Coprime (s i) x := by
simpa using coprime_multiset_prod_left_iff (m := t.val.map s)
theorem coprime_prod_right_iff {x : β} {t : Finset ΞΉ} {s : ΞΉ β β} :
Coprime x (β i β t, s i) β β i β t, Coprime x (s i) := by
simpa using coprime_multiset_prod_right_iff (m := t.val.map s)
alias β¨_, Coprime.prod_leftβ© := coprime_prod_left_iff
#align nat.coprime_prod_left Nat.Coprime.prod_left
alias β¨_, Coprime.prod_rightβ© := coprime_prod_right_iff
#align nat.coprime_prod_right Nat.Coprime.prod_right
| Mathlib/Data/Nat/GCD/BigOperators.lean | 52 | 54 | theorem coprime_fintype_prod_left_iff [Fintype ΞΉ] {s : ΞΉ β β} {x : β} :
Coprime (β i, s i) x β β i, Coprime (s i) x := by |
simp [coprime_prod_left_iff]
| 1 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.Polynomial.Degree.Lemmas
#align_import data.polynomial.erase_lead from "leanprover-community/mathlib"@"fa256f00ce018e7b40e1dc756e403c86680bf448"
noncomputable section
open Polynomial
open Polynomial Finset
namespace Polynomial
variable {R : Type*} [Semiring R] {f : R[X]}
def eraseLead (f : R[X]) : R[X] :=
Polynomial.erase f.natDegree f
#align polynomial.erase_lead Polynomial.eraseLead
section EraseLead
theorem eraseLead_support (f : R[X]) : f.eraseLead.support = f.support.erase f.natDegree := by
simp only [eraseLead, support_erase]
#align polynomial.erase_lead_support Polynomial.eraseLead_support
theorem eraseLead_coeff (i : β) :
f.eraseLead.coeff i = if i = f.natDegree then 0 else f.coeff i := by
simp only [eraseLead, coeff_erase]
#align polynomial.erase_lead_coeff Polynomial.eraseLead_coeff
@[simp]
theorem eraseLead_coeff_natDegree : f.eraseLead.coeff f.natDegree = 0 := by simp [eraseLead_coeff]
#align polynomial.erase_lead_coeff_nat_degree Polynomial.eraseLead_coeff_natDegree
theorem eraseLead_coeff_of_ne (i : β) (hi : i β f.natDegree) : f.eraseLead.coeff i = f.coeff i := by
simp [eraseLead_coeff, hi]
#align polynomial.erase_lead_coeff_of_ne Polynomial.eraseLead_coeff_of_ne
@[simp]
theorem eraseLead_zero : eraseLead (0 : R[X]) = 0 := by simp only [eraseLead, erase_zero]
#align polynomial.erase_lead_zero Polynomial.eraseLead_zero
@[simp]
theorem eraseLead_add_monomial_natDegree_leadingCoeff (f : R[X]) :
f.eraseLead + monomial f.natDegree f.leadingCoeff = f :=
(add_comm _ _).trans (f.monomial_add_erase _)
#align polynomial.erase_lead_add_monomial_nat_degree_leading_coeff Polynomial.eraseLead_add_monomial_natDegree_leadingCoeff
@[simp]
theorem eraseLead_add_C_mul_X_pow (f : R[X]) :
f.eraseLead + C f.leadingCoeff * X ^ f.natDegree = f := by
rw [C_mul_X_pow_eq_monomial, eraseLead_add_monomial_natDegree_leadingCoeff]
set_option linter.uppercaseLean3 false in
#align polynomial.erase_lead_add_C_mul_X_pow Polynomial.eraseLead_add_C_mul_X_pow
@[simp]
theorem self_sub_monomial_natDegree_leadingCoeff {R : Type*} [Ring R] (f : R[X]) :
f - monomial f.natDegree f.leadingCoeff = f.eraseLead :=
(eq_sub_iff_add_eq.mpr (eraseLead_add_monomial_natDegree_leadingCoeff f)).symm
#align polynomial.self_sub_monomial_nat_degree_leading_coeff Polynomial.self_sub_monomial_natDegree_leadingCoeff
@[simp]
theorem self_sub_C_mul_X_pow {R : Type*} [Ring R] (f : R[X]) :
f - C f.leadingCoeff * X ^ f.natDegree = f.eraseLead := by
rw [C_mul_X_pow_eq_monomial, self_sub_monomial_natDegree_leadingCoeff]
set_option linter.uppercaseLean3 false in
#align polynomial.self_sub_C_mul_X_pow Polynomial.self_sub_C_mul_X_pow
theorem eraseLead_ne_zero (f0 : 2 β€ f.support.card) : eraseLead f β 0 := by
rw [Ne, β card_support_eq_zero, eraseLead_support]
exact
(zero_lt_one.trans_le <| (tsub_le_tsub_right f0 1).trans Finset.pred_card_le_card_erase).ne.symm
#align polynomial.erase_lead_ne_zero Polynomial.eraseLead_ne_zero
theorem lt_natDegree_of_mem_eraseLead_support {a : β} (h : a β (eraseLead f).support) :
a < f.natDegree := by
rw [eraseLead_support, mem_erase] at h
exact (le_natDegree_of_mem_supp a h.2).lt_of_ne h.1
#align polynomial.lt_nat_degree_of_mem_erase_lead_support Polynomial.lt_natDegree_of_mem_eraseLead_support
theorem ne_natDegree_of_mem_eraseLead_support {a : β} (h : a β (eraseLead f).support) :
a β f.natDegree :=
(lt_natDegree_of_mem_eraseLead_support h).ne
#align polynomial.ne_nat_degree_of_mem_erase_lead_support Polynomial.ne_natDegree_of_mem_eraseLead_support
theorem natDegree_not_mem_eraseLead_support : f.natDegree β (eraseLead f).support := fun h =>
ne_natDegree_of_mem_eraseLead_support h rfl
#align polynomial.nat_degree_not_mem_erase_lead_support Polynomial.natDegree_not_mem_eraseLead_support
theorem eraseLead_support_card_lt (h : f β 0) : (eraseLead f).support.card < f.support.card := by
rw [eraseLead_support]
exact card_lt_card (erase_ssubset <| natDegree_mem_support_of_nonzero h)
#align polynomial.erase_lead_support_card_lt Polynomial.eraseLead_support_card_lt
theorem card_support_eraseLead_add_one (h : f β 0) :
f.eraseLead.support.card + 1 = f.support.card := by
set c := f.support.card with hc
cases hβ : c
case zero =>
by_contra
exact h (card_support_eq_zero.mp hβ)
case succ =>
rw [eraseLead_support, card_erase_of_mem (natDegree_mem_support_of_nonzero h), β hc, hβ]
rfl
@[simp]
theorem card_support_eraseLead : f.eraseLead.support.card = f.support.card - 1 := by
by_cases hf : f = 0
Β· rw [hf, eraseLead_zero, support_zero, card_empty]
Β· rw [β card_support_eraseLead_add_one hf, add_tsub_cancel_right]
| Mathlib/Algebra/Polynomial/EraseLead.lean | 132 | 134 | theorem card_support_eraseLead' {c : β} (fc : f.support.card = c + 1) :
f.eraseLead.support.card = c := by |
rw [card_support_eraseLead, fc, add_tsub_cancel_right]
| 1 |
import Mathlib.Topology.MetricSpace.Algebra
import Mathlib.Analysis.Normed.Field.Basic
#align_import analysis.normed.mul_action from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
variable {Ξ± Ξ² : Type*}
section SeminormedAddGroup
variable [SeminormedAddGroup Ξ±] [SeminormedAddGroup Ξ²] [SMulZeroClass Ξ± Ξ²]
variable [BoundedSMul Ξ± Ξ²]
theorem norm_smul_le (r : Ξ±) (x : Ξ²) : βr β’ xβ β€ βrβ * βxβ := by
simpa [smul_zero] using dist_smul_pair r 0 x
#align norm_smul_le norm_smul_le
theorem nnnorm_smul_le (r : Ξ±) (x : Ξ²) : βr β’ xββ β€ βrββ * βxββ :=
norm_smul_le _ _
#align nnnorm_smul_le nnnorm_smul_le
| Mathlib/Analysis/Normed/MulAction.lean | 37 | 38 | theorem dist_smul_le (s : Ξ±) (x y : Ξ²) : dist (s β’ x) (s β’ y) β€ βsβ * dist x y := by |
simpa only [dist_eq_norm, sub_zero] using dist_smul_pair s x y
| 1 |
import Mathlib.Analysis.LocallyConvex.Basic
#align_import analysis.locally_convex.balanced_core_hull from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Set Pointwise Topology Filter
variable {π E ΞΉ : Type*}
section balancedHull
section SeminormedRing
variable [SeminormedRing π]
section SMul
variable (π) [SMul π E] {s t : Set E} {x : E}
def balancedCore (s : Set E) :=
ββ { t : Set E | Balanced π t β§ t β s }
#align balanced_core balancedCore
def balancedCoreAux (s : Set E) :=
β (r : π) (_ : 1 β€ βrβ), r β’ s
#align balanced_core_aux balancedCoreAux
def balancedHull (s : Set E) :=
β (r : π) (_ : βrβ β€ 1), r β’ s
#align balanced_hull balancedHull
variable {π}
theorem balancedCore_subset (s : Set E) : balancedCore π s β s :=
sUnion_subset fun _ ht => ht.2
#align balanced_core_subset balancedCore_subset
theorem balancedCore_empty : balancedCore π (β
: Set E) = β
:=
eq_empty_of_subset_empty (balancedCore_subset _)
#align balanced_core_empty balancedCore_empty
| Mathlib/Analysis/LocallyConvex/BalancedCoreHull.lean | 81 | 82 | theorem mem_balancedCore_iff : x β balancedCore π s β β t, Balanced π t β§ t β s β§ x β t := by |
simp_rw [balancedCore, mem_sUnion, mem_setOf_eq, and_assoc]
| 1 |
import Mathlib.LinearAlgebra.Projectivization.Basic
#align_import linear_algebra.projective_space.independence from "leanprover-community/mathlib"@"1e82f5ec4645f6a92bb9e02fce51e44e3bc3e1fe"
open scoped LinearAlgebra.Projectivization
variable {ΞΉ K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {f : ΞΉ β β K V}
namespace Projectivization
inductive Independent : (ΞΉ β β K V) β Prop
| mk (f : ΞΉ β V) (hf : β i : ΞΉ, f i β 0) (hl : LinearIndependent K f) :
Independent fun i => mk K (f i) (hf i)
#align projectivization.independent Projectivization.Independent
theorem independent_iff : Independent f β LinearIndependent K (Projectivization.rep β f) := by
refine β¨?_, fun h => ?_β©
Β· rintro β¨ff, hff, hhβ©
choose a ha using fun i : ΞΉ => exists_smul_eq_mk_rep K (ff i) (hff i)
convert hh.units_smul a
ext i
exact (ha i).symm
Β· convert Independent.mk _ _ h
Β· simp only [mk_rep, Function.comp_apply]
Β· intro i
apply rep_nonzero
#align projectivization.independent_iff Projectivization.independent_iff
theorem independent_iff_completeLattice_independent :
Independent f β CompleteLattice.Independent fun i => (f i).submodule := by
refine β¨?_, fun h => ?_β©
Β· rintro β¨f, hf, hiβ©
simp only [submodule_mk]
exact (CompleteLattice.independent_iff_linearIndependent_of_ne_zero (R := K) hf).mpr hi
Β· rw [independent_iff]
refine h.linearIndependent (Projectivization.submodule β f) (fun i => ?_) fun i => ?_
Β· simpa only [Function.comp_apply, submodule_eq] using Submodule.mem_span_singleton_self _
Β· exact rep_nonzero (f i)
#align projectivization.independent_iff_complete_lattice_independent Projectivization.independent_iff_completeLattice_independent
inductive Dependent : (ΞΉ β β K V) β Prop
| mk (f : ΞΉ β V) (hf : β i : ΞΉ, f i β 0) (h : Β¬LinearIndependent K f) :
Dependent fun i => mk K (f i) (hf i)
#align projectivization.dependent Projectivization.Dependent
theorem dependent_iff : Dependent f β Β¬LinearIndependent K (Projectivization.rep β f) := by
refine β¨?_, fun h => ?_β©
Β· rintro β¨ff, hff, hh1β©
contrapose! hh1
choose a ha using fun i : ΞΉ => exists_smul_eq_mk_rep K (ff i) (hff i)
convert hh1.units_smul aβ»ΒΉ
ext i
simp only [β ha, inv_smul_smul, Pi.smul_apply', Pi.inv_apply, Function.comp_apply]
Β· convert Dependent.mk _ _ h
Β· simp only [mk_rep, Function.comp_apply]
Β· exact fun i => rep_nonzero (f i)
#align projectivization.dependent_iff Projectivization.dependent_iff
theorem dependent_iff_not_independent : Dependent f β Β¬Independent f := by
rw [dependent_iff, independent_iff]
#align projectivization.dependent_iff_not_independent Projectivization.dependent_iff_not_independent
| Mathlib/LinearAlgebra/Projectivization/Independence.lean | 103 | 104 | theorem independent_iff_not_dependent : Independent f β Β¬Dependent f := by |
rw [dependent_iff_not_independent, Classical.not_not]
| 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.