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 | complexity_score float64 2.72 139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B | diff_level int64 0 2 | file_diff_level float64 0 2 | theorem_same_file int64 1 32 | rank_file int64 0 2.51k |
|---|---|---|---|---|---|---|---|---|---|---|---|
import Mathlib.Order.CompleteLattice
import Mathlib.Order.GaloisConnection
import Mathlib.Data.Set.Lattice
import Mathlib.Tactic.AdaptationNote
#align_import data.rel from "leanprover-community/mathlib"@"706d88f2b8fdfeb0b22796433d7a6c1a010af9f2"
variable {Ξ± Ξ² Ξ³ : Type*}
def Rel (Ξ± Ξ² : Type*) :=
Ξ± β Ξ² β Prop -- deriving CompleteLattice, Inhabited
#align rel Rel
-- Porting note: `deriving` above doesn't work.
instance : CompleteLattice (Rel Ξ± Ξ²) := show CompleteLattice (Ξ± β Ξ² β Prop) from inferInstance
instance : Inhabited (Rel Ξ± Ξ²) := show Inhabited (Ξ± β Ξ² β Prop) from inferInstance
namespace Function
def graph (f : Ξ± β Ξ²) : Rel Ξ± Ξ² := fun x y => f x = y
#align function.graph Function.graph
@[simp] lemma graph_def (f : Ξ± β Ξ²) (x y) : f.graph x y β (f x = y) := Iff.rfl
theorem graph_injective : Injective (graph : (Ξ± β Ξ²) β Rel Ξ± Ξ²) := by
intro _ g h
ext x
have h2 := congr_funβ h x (g x)
simp only [graph_def, eq_iff_iff, iff_true] at h2
exact h2
@[simp] lemma graph_inj {f g : Ξ± β Ξ²} : f.graph = g.graph β f = g := graph_injective.eq_iff
| Mathlib/Data/Rel.lean | 384 | 384 | theorem graph_id : graph id = @Eq Ξ± := by | simp (config := { unfoldPartialApp := true }) [graph]
| 1 | 2.718282 | 0 | 1 | 15 | 904 |
import Mathlib.Data.Multiset.Basic
import Mathlib.Data.Vector.Basic
import Mathlib.Data.Setoid.Basic
import Mathlib.Tactic.ApplyFun
#align_import data.sym.basic from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
assert_not_exists MonoidWithZero
set_option autoImplicit true
open Function
def Sym (Ξ± : Type*) (n : β) :=
{ s : Multiset Ξ± // Multiset.card s = n }
#align sym Sym
-- Porting note (#11445): new definition
@[coe] def Sym.toMultiset {Ξ± : Type*} {n : β} (s : Sym Ξ± n) : Multiset Ξ± :=
s.1
instance Sym.hasCoe (Ξ± : Type*) (n : β) : CoeOut (Sym Ξ± n) (Multiset Ξ±) :=
β¨Sym.toMultisetβ©
#align sym.has_coe Sym.hasCoe
-- Porting note: instance needed for Data.Finset.Sym
instance [DecidableEq Ξ±] : DecidableEq (Sym Ξ± n) :=
inferInstanceAs <| DecidableEq <| Subtype _
abbrev Vector.Perm.isSetoid (Ξ± : Type*) (n : β) : Setoid (Vector Ξ± n) :=
(List.isSetoid Ξ±).comap Subtype.val
#align vector.perm.is_setoid Vector.Perm.isSetoid
attribute [local instance] Vector.Perm.isSetoid
namespace Sym
variable {Ξ± Ξ² : Type*} {n n' m : β} {s : Sym Ξ± n} {a b : Ξ±}
theorem coe_injective : Injective ((β) : Sym Ξ± n β Multiset Ξ±) :=
Subtype.coe_injective
#align sym.coe_injective Sym.coe_injective
@[simp, norm_cast]
theorem coe_inj {sβ sβ : Sym Ξ± n} : (sβ : Multiset Ξ±) = sβ β sβ = sβ :=
coe_injective.eq_iff
#align sym.coe_inj Sym.coe_inj
-- Porting note (#10756): new theorem
@[ext] theorem ext {sβ sβ : Sym Ξ± n} (h : (sβ : Multiset Ξ±) = βsβ) : sβ = sβ :=
coe_injective h
-- Porting note (#10756): new theorem
@[simp]
theorem val_eq_coe (s : Sym Ξ± n) : s.1 = βs :=
rfl
@[match_pattern] -- Porting note: removed `@[simps]`, generated bad lemma
abbrev mk (m : Multiset Ξ±) (h : Multiset.card m = n) : Sym Ξ± n :=
β¨m, hβ©
#align sym.mk Sym.mk
@[match_pattern]
def nil : Sym Ξ± 0 :=
β¨0, Multiset.card_zeroβ©
#align sym.nil Sym.nil
@[simp]
theorem coe_nil : β(@Sym.nil Ξ±) = (0 : Multiset Ξ±) :=
rfl
#align sym.coe_nil Sym.coe_nil
@[match_pattern]
def cons (a : Ξ±) (s : Sym Ξ± n) : Sym Ξ± n.succ :=
β¨a ::β s.1, by rw [Multiset.card_cons, s.2]β©
#align sym.cons Sym.cons
@[inherit_doc]
infixr:67 " ::β " => cons
@[simp]
theorem cons_inj_right (a : Ξ±) (s s' : Sym Ξ± n) : a ::β s = a ::β s' β s = s' :=
Subtype.ext_iff.trans <| (Multiset.cons_inj_right _).trans Subtype.ext_iff.symm
#align sym.cons_inj_right Sym.cons_inj_right
@[simp]
theorem cons_inj_left (a a' : Ξ±) (s : Sym Ξ± n) : a ::β s = a' ::β s β a = a' :=
Subtype.ext_iff.trans <| Multiset.cons_inj_left _
#align sym.cons_inj_left Sym.cons_inj_left
theorem cons_swap (a b : Ξ±) (s : Sym Ξ± n) : a ::β b ::β s = b ::β a ::β s :=
Subtype.ext <| Multiset.cons_swap a b s.1
#align sym.cons_swap Sym.cons_swap
theorem coe_cons (s : Sym Ξ± n) (a : Ξ±) : (a ::β s : Multiset Ξ±) = a ::β s :=
rfl
#align sym.coe_cons Sym.coe_cons
def ofVector : Vector Ξ± n β Sym Ξ± n :=
fun x => β¨βx.val, (Multiset.coe_card _).trans x.2β©
instance : Coe (Vector Ξ± n) (Sym Ξ± n) where coe x := ofVector x
@[simp]
theorem ofVector_nil : β(Vector.nil : Vector Ξ± 0) = (Sym.nil : Sym Ξ± 0) :=
rfl
#align sym.of_vector_nil Sym.ofVector_nil
@[simp]
| Mathlib/Data/Sym/Basic.lean | 156 | 158 | theorem ofVector_cons (a : Ξ±) (v : Vector Ξ± n) : β(Vector.cons a v) = a ::β (βv : Sym Ξ± n) := by |
cases v
rfl
| 2 | 7.389056 | 1 | 1 | 1 | 905 |
import Mathlib.Data.Set.Basic
#align_import data.set.bool_indicator from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e"
open Bool
namespace Set
variable {Ξ± : Type*} (s : Set Ξ±)
noncomputable def boolIndicator (x : Ξ±) :=
@ite _ (x β s) (Classical.propDecidable _) true false
#align set.bool_indicator Set.boolIndicator
| Mathlib/Data/Set/BoolIndicator.lean | 27 | 29 | theorem mem_iff_boolIndicator (x : Ξ±) : x β s β s.boolIndicator x = true := by |
unfold boolIndicator
split_ifs with h <;> simp [h]
| 2 | 7.389056 | 1 | 1 | 4 | 906 |
import Mathlib.Data.Set.Basic
#align_import data.set.bool_indicator from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e"
open Bool
namespace Set
variable {Ξ± : Type*} (s : Set Ξ±)
noncomputable def boolIndicator (x : Ξ±) :=
@ite _ (x β s) (Classical.propDecidable _) true false
#align set.bool_indicator Set.boolIndicator
theorem mem_iff_boolIndicator (x : Ξ±) : x β s β s.boolIndicator x = true := by
unfold boolIndicator
split_ifs with h <;> simp [h]
#align set.mem_iff_bool_indicator Set.mem_iff_boolIndicator
| Mathlib/Data/Set/BoolIndicator.lean | 32 | 34 | theorem not_mem_iff_boolIndicator (x : Ξ±) : x β s β s.boolIndicator x = false := by |
unfold boolIndicator
split_ifs with h <;> simp [h]
| 2 | 7.389056 | 1 | 1 | 4 | 906 |
import Mathlib.Data.Set.Basic
#align_import data.set.bool_indicator from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e"
open Bool
namespace Set
variable {Ξ± : Type*} (s : Set Ξ±)
noncomputable def boolIndicator (x : Ξ±) :=
@ite _ (x β s) (Classical.propDecidable _) true false
#align set.bool_indicator Set.boolIndicator
theorem mem_iff_boolIndicator (x : Ξ±) : x β s β s.boolIndicator x = true := by
unfold boolIndicator
split_ifs with h <;> simp [h]
#align set.mem_iff_bool_indicator Set.mem_iff_boolIndicator
theorem not_mem_iff_boolIndicator (x : Ξ±) : x β s β s.boolIndicator x = false := by
unfold boolIndicator
split_ifs with h <;> simp [h]
#align set.not_mem_iff_bool_indicator Set.not_mem_iff_boolIndicator
theorem preimage_boolIndicator_true : s.boolIndicator β»ΒΉ' {true} = s :=
ext fun x β¦ (s.mem_iff_boolIndicator x).symm
#align set.preimage_bool_indicator_true Set.preimage_boolIndicator_true
theorem preimage_boolIndicator_false : s.boolIndicator β»ΒΉ' {false} = sαΆ :=
ext fun x β¦ (s.not_mem_iff_boolIndicator x).symm
#align set.preimage_bool_indicator_false Set.preimage_boolIndicator_false
open scoped Classical
| Mathlib/Data/Set/BoolIndicator.lean | 47 | 51 | theorem preimage_boolIndicator_eq_union (t : Set Bool) :
s.boolIndicator β»ΒΉ' t = (if true β t then s else β
) βͺ if false β t then sαΆ else β
:= by |
ext x
simp only [boolIndicator, mem_preimage]
split_ifs <;> simp [*]
| 3 | 20.085537 | 1 | 1 | 4 | 906 |
import Mathlib.Data.Set.Basic
#align_import data.set.bool_indicator from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e"
open Bool
namespace Set
variable {Ξ± : Type*} (s : Set Ξ±)
noncomputable def boolIndicator (x : Ξ±) :=
@ite _ (x β s) (Classical.propDecidable _) true false
#align set.bool_indicator Set.boolIndicator
theorem mem_iff_boolIndicator (x : Ξ±) : x β s β s.boolIndicator x = true := by
unfold boolIndicator
split_ifs with h <;> simp [h]
#align set.mem_iff_bool_indicator Set.mem_iff_boolIndicator
theorem not_mem_iff_boolIndicator (x : Ξ±) : x β s β s.boolIndicator x = false := by
unfold boolIndicator
split_ifs with h <;> simp [h]
#align set.not_mem_iff_bool_indicator Set.not_mem_iff_boolIndicator
theorem preimage_boolIndicator_true : s.boolIndicator β»ΒΉ' {true} = s :=
ext fun x β¦ (s.mem_iff_boolIndicator x).symm
#align set.preimage_bool_indicator_true Set.preimage_boolIndicator_true
theorem preimage_boolIndicator_false : s.boolIndicator β»ΒΉ' {false} = sαΆ :=
ext fun x β¦ (s.not_mem_iff_boolIndicator x).symm
#align set.preimage_bool_indicator_false Set.preimage_boolIndicator_false
open scoped Classical
theorem preimage_boolIndicator_eq_union (t : Set Bool) :
s.boolIndicator β»ΒΉ' t = (if true β t then s else β
) βͺ if false β t then sαΆ else β
:= by
ext x
simp only [boolIndicator, mem_preimage]
split_ifs <;> simp [*]
#align set.preimage_bool_indicator_eq_union Set.preimage_boolIndicator_eq_union
| Mathlib/Data/Set/BoolIndicator.lean | 54 | 58 | theorem preimage_boolIndicator (t : Set Bool) :
s.boolIndicator β»ΒΉ' t = univ β¨
s.boolIndicator β»ΒΉ' t = s β¨ s.boolIndicator β»ΒΉ' t = sαΆ β¨ s.boolIndicator β»ΒΉ' t = β
:= by |
simp only [preimage_boolIndicator_eq_union]
split_ifs <;> simp [s.union_compl_self]
| 2 | 7.389056 | 1 | 1 | 4 | 906 |
import Mathlib.Analysis.Calculus.FDeriv.Basic
import Mathlib.Analysis.NormedSpace.BoundedLinearMaps
#align_import analysis.calculus.fderiv.linear from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee"
open Filter Asymptotics ContinuousLinearMap Set Metric
open scoped Classical
open Topology NNReal Filter Asymptotics ENNReal
noncomputable section
section
variable {π : Type*} [NontriviallyNormedField π]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π F]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π G]
variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π G']
variable {f fβ fβ g : E β F}
variable {f' fβ' fβ' g' : E βL[π] F}
variable (e : E βL[π] F)
variable {x : E}
variable {s t : Set E}
variable {L Lβ Lβ : Filter E}
section ContinuousLinearMap
@[fun_prop]
protected theorem ContinuousLinearMap.hasStrictFDerivAt {x : E} : HasStrictFDerivAt e e x :=
(isLittleO_zero _ _).congr_left fun x => by simp only [e.map_sub, sub_self]
#align continuous_linear_map.has_strict_fderiv_at ContinuousLinearMap.hasStrictFDerivAt
protected theorem ContinuousLinearMap.hasFDerivAtFilter : HasFDerivAtFilter e e x L :=
.of_isLittleO <| (isLittleO_zero _ _).congr_left fun x => by simp only [e.map_sub, sub_self]
#align continuous_linear_map.has_fderiv_at_filter ContinuousLinearMap.hasFDerivAtFilter
@[fun_prop]
protected theorem ContinuousLinearMap.hasFDerivWithinAt : HasFDerivWithinAt e e s x :=
e.hasFDerivAtFilter
#align continuous_linear_map.has_fderiv_within_at ContinuousLinearMap.hasFDerivWithinAt
@[fun_prop]
protected theorem ContinuousLinearMap.hasFDerivAt : HasFDerivAt e e x :=
e.hasFDerivAtFilter
#align continuous_linear_map.has_fderiv_at ContinuousLinearMap.hasFDerivAt
@[simp, fun_prop]
protected theorem ContinuousLinearMap.differentiableAt : DifferentiableAt π e x :=
e.hasFDerivAt.differentiableAt
#align continuous_linear_map.differentiable_at ContinuousLinearMap.differentiableAt
@[fun_prop]
protected theorem ContinuousLinearMap.differentiableWithinAt : DifferentiableWithinAt π e s x :=
e.differentiableAt.differentiableWithinAt
#align continuous_linear_map.differentiable_within_at ContinuousLinearMap.differentiableWithinAt
@[simp]
protected theorem ContinuousLinearMap.fderiv : fderiv π e x = e :=
e.hasFDerivAt.fderiv
#align continuous_linear_map.fderiv ContinuousLinearMap.fderiv
protected theorem ContinuousLinearMap.fderivWithin (hxs : UniqueDiffWithinAt π s x) :
fderivWithin π e s x = e := by
rw [DifferentiableAt.fderivWithin e.differentiableAt hxs]
exact e.fderiv
#align continuous_linear_map.fderiv_within ContinuousLinearMap.fderivWithin
@[simp, fun_prop]
protected theorem ContinuousLinearMap.differentiable : Differentiable π e := fun _ =>
e.differentiableAt
#align continuous_linear_map.differentiable ContinuousLinearMap.differentiable
@[fun_prop]
protected theorem ContinuousLinearMap.differentiableOn : DifferentiableOn π e s :=
e.differentiable.differentiableOn
#align continuous_linear_map.differentiable_on ContinuousLinearMap.differentiableOn
theorem IsBoundedLinearMap.hasFDerivAtFilter (h : IsBoundedLinearMap π f) :
HasFDerivAtFilter f h.toContinuousLinearMap x L :=
h.toContinuousLinearMap.hasFDerivAtFilter
#align is_bounded_linear_map.has_fderiv_at_filter IsBoundedLinearMap.hasFDerivAtFilter
@[fun_prop]
theorem IsBoundedLinearMap.hasFDerivWithinAt (h : IsBoundedLinearMap π f) :
HasFDerivWithinAt f h.toContinuousLinearMap s x :=
h.hasFDerivAtFilter
#align is_bounded_linear_map.has_fderiv_within_at IsBoundedLinearMap.hasFDerivWithinAt
@[fun_prop]
theorem IsBoundedLinearMap.hasFDerivAt (h : IsBoundedLinearMap π f) :
HasFDerivAt f h.toContinuousLinearMap x :=
h.hasFDerivAtFilter
#align is_bounded_linear_map.has_fderiv_at IsBoundedLinearMap.hasFDerivAt
@[fun_prop]
theorem IsBoundedLinearMap.differentiableAt (h : IsBoundedLinearMap π f) : DifferentiableAt π f x :=
h.hasFDerivAt.differentiableAt
#align is_bounded_linear_map.differentiable_at IsBoundedLinearMap.differentiableAt
@[fun_prop]
theorem IsBoundedLinearMap.differentiableWithinAt (h : IsBoundedLinearMap π f) :
DifferentiableWithinAt π f s x :=
h.differentiableAt.differentiableWithinAt
#align is_bounded_linear_map.differentiable_within_at IsBoundedLinearMap.differentiableWithinAt
theorem IsBoundedLinearMap.fderiv (h : IsBoundedLinearMap π f) :
fderiv π f x = h.toContinuousLinearMap :=
HasFDerivAt.fderiv h.hasFDerivAt
#align is_bounded_linear_map.fderiv IsBoundedLinearMap.fderiv
| Mathlib/Analysis/Calculus/FDeriv/Linear.lean | 136 | 139 | theorem IsBoundedLinearMap.fderivWithin (h : IsBoundedLinearMap π f)
(hxs : UniqueDiffWithinAt π s x) : fderivWithin π f s x = h.toContinuousLinearMap := by |
rw [DifferentiableAt.fderivWithin h.differentiableAt hxs]
exact h.fderiv
| 2 | 7.389056 | 1 | 1 | 1 | 907 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
| Mathlib/LinearAlgebra/LinearIndependent.lean | 126 | 128 | theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by |
simp [LinearIndependent, LinearMap.ker_eq_bot']
| 1 | 2.718282 | 0 | 1 | 7 | 908 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
| Mathlib/LinearAlgebra/LinearIndependent.lean | 131 | 151 | theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by |
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
| 11 | 59,874.141715 | 2 | 1 | 7 | 908 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
#align linear_independent_iff' linearIndependent_iff'
| Mathlib/LinearAlgebra/LinearIndependent.lean | 154 | 164 | theorem linearIndependent_iff'' :
LinearIndependent R v β
β (s : Finset ΞΉ) (g : ΞΉ β R), (β i β s, g i = 0) β
β i β s, g i β’ v i = 0 β β i, g i = 0 := by |
classical
exact linearIndependent_iff'.trans
β¨fun H s g hg hv i => if his : i β s then H s g hv i his else hg i his, fun H s g hg i hi => by
convert
H s (fun j => if j β s then g j else 0) (fun j hj => if_neg hj)
(by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i
exact (if_pos hi).symmβ©
| 7 | 1,096.633158 | 2 | 1 | 7 | 908 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
#align linear_independent_iff' linearIndependent_iff'
theorem linearIndependent_iff'' :
LinearIndependent R v β
β (s : Finset ΞΉ) (g : ΞΉ β R), (β i β s, g i = 0) β
β i β s, g i β’ v i = 0 β β i, g i = 0 := by
classical
exact linearIndependent_iff'.trans
β¨fun H s g hg hv i => if his : i β s then H s g hv i his else hg i his, fun H s g hg i hi => by
convert
H s (fun j => if j β s then g j else 0) (fun j hj => if_neg hj)
(by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i
exact (if_pos hi).symmβ©
#align linear_independent_iff'' linearIndependent_iff''
| Mathlib/LinearAlgebra/LinearIndependent.lean | 167 | 171 | theorem not_linearIndependent_iff :
Β¬LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β§ β i β s, g i β 0 := by |
rw [linearIndependent_iff']
simp only [exists_prop, not_forall]
| 2 | 7.389056 | 1 | 1 | 7 | 908 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
#align linear_independent_iff' linearIndependent_iff'
theorem linearIndependent_iff'' :
LinearIndependent R v β
β (s : Finset ΞΉ) (g : ΞΉ β R), (β i β s, g i = 0) β
β i β s, g i β’ v i = 0 β β i, g i = 0 := by
classical
exact linearIndependent_iff'.trans
β¨fun H s g hg hv i => if his : i β s then H s g hv i his else hg i his, fun H s g hg i hi => by
convert
H s (fun j => if j β s then g j else 0) (fun j hj => if_neg hj)
(by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i
exact (if_pos hi).symmβ©
#align linear_independent_iff'' linearIndependent_iff''
theorem not_linearIndependent_iff :
Β¬LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β§ β i β s, g i β 0 := by
rw [linearIndependent_iff']
simp only [exists_prop, not_forall]
#align not_linear_independent_iff not_linearIndependent_iff
| Mathlib/LinearAlgebra/LinearIndependent.lean | 174 | 181 | theorem Fintype.linearIndependent_iff [Fintype ΞΉ] :
LinearIndependent R v β β g : ΞΉ β R, β i, g i β’ v i = 0 β β i, g i = 0 := by |
refine
β¨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H =>
linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _β©
rw [β hs]
refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm
rw [hg i hi, zero_smul]
| 6 | 403.428793 | 2 | 1 | 7 | 908 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
#align linear_independent_iff' linearIndependent_iff'
theorem linearIndependent_iff'' :
LinearIndependent R v β
β (s : Finset ΞΉ) (g : ΞΉ β R), (β i β s, g i = 0) β
β i β s, g i β’ v i = 0 β β i, g i = 0 := by
classical
exact linearIndependent_iff'.trans
β¨fun H s g hg hv i => if his : i β s then H s g hv i his else hg i his, fun H s g hg i hi => by
convert
H s (fun j => if j β s then g j else 0) (fun j hj => if_neg hj)
(by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i
exact (if_pos hi).symmβ©
#align linear_independent_iff'' linearIndependent_iff''
theorem not_linearIndependent_iff :
Β¬LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β§ β i β s, g i β 0 := by
rw [linearIndependent_iff']
simp only [exists_prop, not_forall]
#align not_linear_independent_iff not_linearIndependent_iff
theorem Fintype.linearIndependent_iff [Fintype ΞΉ] :
LinearIndependent R v β β g : ΞΉ β R, β i, g i β’ v i = 0 β β i, g i = 0 := by
refine
β¨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H =>
linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _β©
rw [β hs]
refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm
rw [hg i hi, zero_smul]
#align fintype.linear_independent_iff Fintype.linearIndependent_iff
| Mathlib/LinearAlgebra/LinearIndependent.lean | 186 | 189 | theorem Fintype.linearIndependent_iff' [Fintype ΞΉ] [DecidableEq ΞΉ] :
LinearIndependent R v β
LinearMap.ker (LinearMap.lsum R (fun _ β¦ R) β fun i β¦ LinearMap.id.smulRight (v i)) = β₯ := by |
simp [Fintype.linearIndependent_iff, LinearMap.ker_eq_bot', funext_iff]
| 1 | 2.718282 | 0 | 1 | 7 | 908 |
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.LinearAlgebra.Finsupp
import Mathlib.LinearAlgebra.Prod
import Mathlib.SetTheory.Cardinal.Basic
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.LinearCombination
import Mathlib.Lean.Expr.ExtraRecognizers
import Mathlib.Data.Set.Subsingleton
#align_import linear_algebra.linear_independent from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb"
noncomputable section
open Function Set Submodule
open Cardinal
universe u' u
variable {ΞΉ : Type u'} {ΞΉ' : Type*} {R : Type*} {K : Type*}
variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*}
section Module
variable {v : ΞΉ β M}
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M'']
variable [Module R M] [Module R M'] [Module R M'']
variable {a b : R} {x y : M}
variable (R) (v)
def LinearIndependent : Prop :=
LinearMap.ker (Finsupp.total ΞΉ M R v) = β₯
#align linear_independent LinearIndependent
open Lean PrettyPrinter.Delaborator SubExpr in
@[delab app.LinearIndependent]
def delabLinearIndependent : Delab :=
whenPPOption getPPNotation <|
whenNotPPOption getPPAnalysisSkip <|
withOptionAtCurrPos `pp.analysis.skip true do
let e β getExpr
guard <| e.isAppOfArity ``LinearIndependent 7
let some _ := (e.getArg! 0).coeTypeSet? | failure
let optionsPerPos β if (e.getArg! 3).isLambda then
withNaryArg 3 do return (β read).optionsPerPos.setBool (β getPos) pp.funBinderTypes.name true
else
withNaryArg 0 do return (β read).optionsPerPos.setBool (β getPos) `pp.analysis.namedArg true
withTheReader Context ({Β· with optionsPerPos}) delab
variable {R} {v}
theorem linearIndependent_iff :
LinearIndependent R v β β l, Finsupp.total ΞΉ M R v l = 0 β l = 0 := by
simp [LinearIndependent, LinearMap.ker_eq_bot']
#align linear_independent_iff linearIndependent_iff
theorem linearIndependent_iff' :
LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β β i β s, g i = 0 :=
linearIndependent_iff.trans
β¨fun hf s g hg i his =>
have h :=
hf (β i β s, Finsupp.single i (g i)) <| by
simpa only [map_sum, Finsupp.total_single] using hg
calc
g i = (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single i (g i)) := by
{ rw [Finsupp.lapply_apply, Finsupp.single_eq_same] }
_ = β j β s, (Finsupp.lapply i : (ΞΉ ββ R) ββ[R] R) (Finsupp.single j (g j)) :=
Eq.symm <|
Finset.sum_eq_single i
(fun j _hjs hji => by rw [Finsupp.lapply_apply, Finsupp.single_eq_of_ne hji])
fun hnis => hnis.elim his
_ = (β j β s, Finsupp.single j (g j)) i := (map_sum ..).symm
_ = 0 := DFunLike.ext_iff.1 h i,
fun hf l hl =>
Finsupp.ext fun i =>
_root_.by_contradiction fun hni => hni <| hf _ _ hl _ <| Finsupp.mem_support_iff.2 hniβ©
#align linear_independent_iff' linearIndependent_iff'
theorem linearIndependent_iff'' :
LinearIndependent R v β
β (s : Finset ΞΉ) (g : ΞΉ β R), (β i β s, g i = 0) β
β i β s, g i β’ v i = 0 β β i, g i = 0 := by
classical
exact linearIndependent_iff'.trans
β¨fun H s g hg hv i => if his : i β s then H s g hv i his else hg i his, fun H s g hg i hi => by
convert
H s (fun j => if j β s then g j else 0) (fun j hj => if_neg hj)
(by simp_rw [ite_smul, zero_smul, Finset.sum_extend_by_zero, hg]) i
exact (if_pos hi).symmβ©
#align linear_independent_iff'' linearIndependent_iff''
theorem not_linearIndependent_iff :
Β¬LinearIndependent R v β
β s : Finset ΞΉ, β g : ΞΉ β R, β i β s, g i β’ v i = 0 β§ β i β s, g i β 0 := by
rw [linearIndependent_iff']
simp only [exists_prop, not_forall]
#align not_linear_independent_iff not_linearIndependent_iff
theorem Fintype.linearIndependent_iff [Fintype ΞΉ] :
LinearIndependent R v β β g : ΞΉ β R, β i, g i β’ v i = 0 β β i, g i = 0 := by
refine
β¨fun H g => by simpa using linearIndependent_iff'.1 H Finset.univ g, fun H =>
linearIndependent_iff''.2 fun s g hg hs i => H _ ?_ _β©
rw [β hs]
refine (Finset.sum_subset (Finset.subset_univ _) fun i _ hi => ?_).symm
rw [hg i hi, zero_smul]
#align fintype.linear_independent_iff Fintype.linearIndependent_iff
theorem Fintype.linearIndependent_iff' [Fintype ΞΉ] [DecidableEq ΞΉ] :
LinearIndependent R v β
LinearMap.ker (LinearMap.lsum R (fun _ β¦ R) β fun i β¦ LinearMap.id.smulRight (v i)) = β₯ := by
simp [Fintype.linearIndependent_iff, LinearMap.ker_eq_bot', funext_iff]
#align fintype.linear_independent_iff' Fintype.linearIndependent_iff'
| Mathlib/LinearAlgebra/LinearIndependent.lean | 192 | 194 | theorem Fintype.not_linearIndependent_iff [Fintype ΞΉ] :
Β¬LinearIndependent R v β β g : ΞΉ β R, β i, g i β’ v i = 0 β§ β i, g i β 0 := by |
simpa using not_iff_not.2 Fintype.linearIndependent_iff
| 1 | 2.718282 | 0 | 1 | 7 | 908 |
import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic
import Mathlib.Algebra.Category.Ring.Colimits
import Mathlib.Algebra.Category.Ring.Limits
import Mathlib.Topology.Sheaves.LocalPredicate
import Mathlib.RingTheory.Localization.AtPrime
import Mathlib.Algebra.Ring.Subring.Basic
#align_import algebraic_geometry.structure_sheaf from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
universe u
noncomputable section
variable (R : Type u) [CommRing R]
open TopCat
open TopologicalSpace
open CategoryTheory
open Opposite
namespace AlgebraicGeometry
def PrimeSpectrum.Top : TopCat :=
TopCat.of (PrimeSpectrum R)
set_option linter.uppercaseLean3 false in
#align algebraic_geometry.prime_spectrum.Top AlgebraicGeometry.PrimeSpectrum.Top
namespace StructureSheaf
def Localizations (P : PrimeSpectrum.Top R) : Type u :=
Localization.AtPrime P.asIdeal
#align algebraic_geometry.structure_sheaf.localizations AlgebraicGeometry.StructureSheaf.Localizations
-- Porting note: can't derive `CommRingCat`
instance commRingLocalizations (P : PrimeSpectrum.Top R) : CommRing <| Localizations R P :=
inferInstanceAs <| CommRing <| Localization.AtPrime P.asIdeal
-- Porting note: can't derive `LocalRing`
instance localRingLocalizations (P : PrimeSpectrum.Top R) : LocalRing <| Localizations R P :=
inferInstanceAs <| LocalRing <| Localization.AtPrime P.asIdeal
instance (P : PrimeSpectrum.Top R) : Inhabited (Localizations R P) :=
β¨1β©
instance (U : Opens (PrimeSpectrum.Top R)) (x : U) : Algebra R (Localizations R x) :=
inferInstanceAs <| Algebra R (Localization.AtPrime x.1.asIdeal)
instance (U : Opens (PrimeSpectrum.Top R)) (x : U) :
IsLocalization.AtPrime (Localizations R x) (x : PrimeSpectrum.Top R).asIdeal :=
Localization.isLocalization
variable {R}
def IsFraction {U : Opens (PrimeSpectrum.Top R)} (f : β x : U, Localizations R x) : Prop :=
β r s : R, β x : U, Β¬s β x.1.asIdeal β§ f x * algebraMap _ _ s = algebraMap _ _ r
#align algebraic_geometry.structure_sheaf.is_fraction AlgebraicGeometry.StructureSheaf.IsFraction
| Mathlib/AlgebraicGeometry/StructureSheaf.lean | 108 | 118 | theorem IsFraction.eq_mk' {U : Opens (PrimeSpectrum.Top R)} {f : β x : U, Localizations R x}
(hf : IsFraction f) :
β r s : R,
β x : U,
β hs : s β x.1.asIdeal,
f x =
IsLocalization.mk' (Localization.AtPrime _) r
(β¨s, hsβ© : (x : PrimeSpectrum.Top R).asIdeal.primeCompl) := by |
rcases hf with β¨r, s, hβ©
refine β¨r, s, fun x => β¨(h x).1, (IsLocalization.mk'_eq_iff_eq_mul.mpr ?_).symmβ©β©
exact (h x).2.symm
| 3 | 20.085537 | 1 | 1 | 1 | 909 |
import Mathlib.NumberTheory.LegendreSymbol.AddCharacter
import Mathlib.NumberTheory.LegendreSymbol.ZModChar
import Mathlib.Algebra.CharP.CharAndCard
#align_import number_theory.legendre_symbol.gauss_sum from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
universe u v
open AddChar MulChar
section GaussSumDef
-- `R` is the domain of the characters
variable {R : Type u} [CommRing R] [Fintype R]
-- `R'` is the target of the characters
variable {R' : Type v} [CommRing R']
def gaussSum (Ο : MulChar R R') (Ο : AddChar R R') : R' :=
β a, Ο a * Ο a
#align gauss_sum gaussSum
| Mathlib/NumberTheory/GaussSum.lean | 74 | 78 | theorem gaussSum_mulShift (Ο : MulChar R R') (Ο : AddChar R R') (a : RΛ£) :
Ο a * gaussSum Ο (mulShift Ο a) = gaussSum Ο Ο := by |
simp only [gaussSum, mulShift_apply, Finset.mul_sum]
simp_rw [β mul_assoc, β map_mul]
exact Fintype.sum_bijective _ a.mulLeft_bijective _ _ fun x => rfl
| 3 | 20.085537 | 1 | 1 | 1 | 910 |
import Mathlib.LinearAlgebra.Basis
import Mathlib.LinearAlgebra.BilinearMap
#align_import linear_algebra.basis.bilinear from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d"
namespace LinearMap
variable {ΞΉβ ΞΉβ : Type*}
variable {R Rβ S Sβ M N P Rβ : Type*}
variable {Mβ Nβ Pβ : Type*}
-- Could weaken [CommSemiring Rβ] to [SMulCommClass Rβ Rβ Pβ], but might impact performance
variable [Semiring R] [Semiring S] [Semiring Rβ] [Semiring Sβ] [CommSemiring Rβ]
section AddCommMonoid
variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P]
variable [AddCommMonoid Mβ] [AddCommMonoid Nβ] [AddCommMonoid Pβ]
variable [Module R M] [Module S N] [Module Rβ P] [Module Sβ P]
variable [Module Rβ Mβ] [Module Rβ Nβ] [Module Rβ Pβ]
variable [SMulCommClass Sβ Rβ P]
variable {Οββ : R β+* Rβ} {Οββ : S β+* Sβ}
variable (bβ : Basis ΞΉβ R M) (bβ : Basis ΞΉβ S N) (bβ' : Basis ΞΉβ Rβ Mβ) (bβ' : Basis ΞΉβ Rβ Nβ)
theorem ext_basis {B B' : M βββ[Οββ] N βββ[Οββ] P} (h : β i j, B (bβ i) (bβ j) = B' (bβ i) (bβ j)) :
B = B' :=
bβ.ext fun i => bβ.ext fun j => h i j
#align linear_map.ext_basis LinearMap.ext_basis
| Mathlib/LinearAlgebra/Basis/Bilinear.lean | 44 | 49 | theorem sum_repr_mul_repr_mulββ {B : M βββ[Οββ] N βββ[Οββ] P} (x y) :
((bβ.repr x).sum fun i xi => (bβ.repr y).sum fun j yj => Οββ xi β’ Οββ yj β’ B (bβ i) (bβ j)) =
B x y := by |
conv_rhs => rw [β bβ.total_repr x, β bβ.total_repr y]
simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ, map_sum, LinearMap.map_smulβββ,
LinearMap.map_smulββ]
| 3 | 20.085537 | 1 | 1 | 2 | 911 |
import Mathlib.LinearAlgebra.Basis
import Mathlib.LinearAlgebra.BilinearMap
#align_import linear_algebra.basis.bilinear from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d"
namespace LinearMap
variable {ΞΉβ ΞΉβ : Type*}
variable {R Rβ S Sβ M N P Rβ : Type*}
variable {Mβ Nβ Pβ : Type*}
-- Could weaken [CommSemiring Rβ] to [SMulCommClass Rβ Rβ Pβ], but might impact performance
variable [Semiring R] [Semiring S] [Semiring Rβ] [Semiring Sβ] [CommSemiring Rβ]
section AddCommMonoid
variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P]
variable [AddCommMonoid Mβ] [AddCommMonoid Nβ] [AddCommMonoid Pβ]
variable [Module R M] [Module S N] [Module Rβ P] [Module Sβ P]
variable [Module Rβ Mβ] [Module Rβ Nβ] [Module Rβ Pβ]
variable [SMulCommClass Sβ Rβ P]
variable {Οββ : R β+* Rβ} {Οββ : S β+* Sβ}
variable (bβ : Basis ΞΉβ R M) (bβ : Basis ΞΉβ S N) (bβ' : Basis ΞΉβ Rβ Mβ) (bβ' : Basis ΞΉβ Rβ Nβ)
theorem ext_basis {B B' : M βββ[Οββ] N βββ[Οββ] P} (h : β i j, B (bβ i) (bβ j) = B' (bβ i) (bβ j)) :
B = B' :=
bβ.ext fun i => bβ.ext fun j => h i j
#align linear_map.ext_basis LinearMap.ext_basis
theorem sum_repr_mul_repr_mulββ {B : M βββ[Οββ] N βββ[Οββ] P} (x y) :
((bβ.repr x).sum fun i xi => (bβ.repr y).sum fun j yj => Οββ xi β’ Οββ yj β’ B (bβ i) (bβ j)) =
B x y := by
conv_rhs => rw [β bβ.total_repr x, β bβ.total_repr y]
simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ, map_sum, LinearMap.map_smulβββ,
LinearMap.map_smulββ]
#align linear_map.sum_repr_mul_repr_mulββ LinearMap.sum_repr_mul_repr_mulββ
| Mathlib/LinearAlgebra/Basis/Bilinear.lean | 55 | 60 | theorem sum_repr_mul_repr_mul {B : Mβ ββ[Rβ] Nβ ββ[Rβ] Pβ} (x y) :
((bβ'.repr x).sum fun i xi => (bβ'.repr y).sum fun j yj => xi β’ yj β’ B (bβ' i) (bβ' j)) =
B x y := by |
conv_rhs => rw [β bβ'.total_repr x, β bβ'.total_repr y]
simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ, map_sum, LinearMap.map_smulβ,
LinearMap.map_smul]
| 3 | 20.085537 | 1 | 1 | 2 | 911 |
import Mathlib.Algebra.Group.Submonoid.Operations
import Mathlib.Algebra.Star.SelfAdjoint
#align_import algebra.star.unitary from "leanprover-community/mathlib"@"247a102b14f3cebfee126293341af5f6bed00237"
def unitary (R : Type*) [Monoid R] [StarMul R] : Submonoid R where
carrier := { U | star U * U = 1 β§ U * star U = 1 }
one_mem' := by simp only [mul_one, and_self_iff, Set.mem_setOf_eq, star_one]
mul_mem' := @fun U B β¨hAβ, hAββ© β¨hBβ, hBββ© => by
refine β¨?_, ?_β©
Β· calc
star (U * B) * (U * B) = star B * star U * U * B := by simp only [mul_assoc, star_mul]
_ = star B * (star U * U) * B := by rw [β mul_assoc]
_ = 1 := by rw [hAβ, mul_one, hBβ]
Β· calc
U * B * star (U * B) = U * B * (star B * star U) := by rw [star_mul]
_ = U * (B * star B) * star U := by simp_rw [β mul_assoc]
_ = 1 := by rw [hBβ, mul_one, hAβ]
#align unitary unitary
variable {R : Type*}
namespace unitary
section Monoid
variable [Monoid R] [StarMul R]
theorem mem_iff {U : R} : U β unitary R β star U * U = 1 β§ U * star U = 1 :=
Iff.rfl
#align unitary.mem_iff unitary.mem_iff
@[simp]
theorem star_mul_self_of_mem {U : R} (hU : U β unitary R) : star U * U = 1 :=
hU.1
#align unitary.star_mul_self_of_mem unitary.star_mul_self_of_mem
@[simp]
theorem mul_star_self_of_mem {U : R} (hU : U β unitary R) : U * star U = 1 :=
hU.2
#align unitary.mul_star_self_of_mem unitary.mul_star_self_of_mem
theorem star_mem {U : R} (hU : U β unitary R) : star U β unitary R :=
β¨by rw [star_star, mul_star_self_of_mem hU], by rw [star_star, star_mul_self_of_mem hU]β©
#align unitary.star_mem unitary.star_mem
@[simp]
theorem star_mem_iff {U : R} : star U β unitary R β U β unitary R :=
β¨fun h => star_star U βΈ star_mem h, star_memβ©
#align unitary.star_mem_iff unitary.star_mem_iff
instance : Star (unitary R) :=
β¨fun U => β¨star U, star_mem U.propβ©β©
@[simp, norm_cast]
theorem coe_star {U : unitary R} : β(star U) = (star U : R) :=
rfl
#align unitary.coe_star unitary.coe_star
theorem coe_star_mul_self (U : unitary R) : (star U : R) * U = 1 :=
star_mul_self_of_mem U.prop
#align unitary.coe_star_mul_self unitary.coe_star_mul_self
theorem coe_mul_star_self (U : unitary R) : (U : R) * star U = 1 :=
mul_star_self_of_mem U.prop
#align unitary.coe_mul_star_self unitary.coe_mul_star_self
@[simp]
theorem star_mul_self (U : unitary R) : star U * U = 1 :=
Subtype.ext <| coe_star_mul_self U
#align unitary.star_mul_self unitary.star_mul_self
@[simp]
theorem mul_star_self (U : unitary R) : U * star U = 1 :=
Subtype.ext <| coe_mul_star_self U
#align unitary.mul_star_self unitary.mul_star_self
instance : Group (unitary R) :=
{ Submonoid.toMonoid _ with
inv := star
mul_left_inv := star_mul_self }
instance : InvolutiveStar (unitary R) :=
β¨by
intro x
ext
rw [coe_star, coe_star, star_star]β©
instance : StarMul (unitary R) :=
β¨by
intro x y
ext
rw [coe_star, Submonoid.coe_mul, Submonoid.coe_mul, coe_star, coe_star, star_mul]β©
instance : Inhabited (unitary R) :=
β¨1β©
theorem star_eq_inv (U : unitary R) : star U = Uβ»ΒΉ :=
rfl
#align unitary.star_eq_inv unitary.star_eq_inv
theorem star_eq_inv' : (star : unitary R β unitary R) = Inv.inv :=
rfl
#align unitary.star_eq_inv' unitary.star_eq_inv'
@[simps]
def toUnits : unitary R β* RΛ£ where
toFun x := β¨x, βxβ»ΒΉ, coe_mul_star_self x, coe_star_mul_self xβ©
map_one' := Units.ext rfl
map_mul' _ _ := Units.ext rfl
#align unitary.to_units unitary.toUnits
theorem toUnits_injective : Function.Injective (toUnits : unitary R β RΛ£) := fun _ _ h =>
Subtype.ext <| Units.ext_iff.mp h
#align unitary.to_units_injective unitary.toUnits_injective
| Mathlib/Algebra/Star/Unitary.lean | 141 | 145 | theorem _root_.IsUnit.mem_unitary_of_star_mul_self {u : R} (hu : IsUnit u)
(h_mul : star u * u = 1) : u β unitary R := by |
refine unitary.mem_iff.mpr β¨h_mul, ?_β©
lift u to RΛ£ using hu
exact left_inv_eq_right_inv h_mul u.mul_inv βΈ u.mul_inv
| 3 | 20.085537 | 1 | 1 | 1 | 912 |
import Mathlib.MeasureTheory.Measure.Restrict
#align_import measure_theory.measure.mutually_singular from "leanprover-community/mathlib"@"70a4f2197832bceab57d7f41379b2592d1110570"
open Set
open MeasureTheory NNReal ENNReal
namespace MeasureTheory
namespace Measure
variable {Ξ± : Type*} {m0 : MeasurableSpace Ξ±} {ΞΌ ΞΌβ ΞΌβ Ξ½ Ξ½β Ξ½β : Measure Ξ±}
def MutuallySingular {_ : MeasurableSpace Ξ±} (ΞΌ Ξ½ : Measure Ξ±) : Prop :=
β s : Set Ξ±, MeasurableSet s β§ ΞΌ s = 0 β§ Ξ½ sαΆ = 0
#align measure_theory.measure.mutually_singular MeasureTheory.Measure.MutuallySingular
@[inherit_doc MeasureTheory.Measure.MutuallySingular]
scoped[MeasureTheory] infixl:60 " ββ " => MeasureTheory.Measure.MutuallySingular
namespace MutuallySingular
| Mathlib/MeasureTheory/Measure/MutuallySingular.lean | 48 | 52 | theorem mk {s t : Set Ξ±} (hs : ΞΌ s = 0) (ht : Ξ½ t = 0) (hst : univ β s βͺ t) :
MutuallySingular ΞΌ Ξ½ := by |
use toMeasurable ΞΌ s, measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans hs
refine measure_mono_null (fun x hx => (hst trivial).resolve_left fun hxs => hx ?_) ht
exact subset_toMeasurable _ _ hxs
| 3 | 20.085537 | 1 | 1 | 3 | 913 |
import Mathlib.MeasureTheory.Measure.Restrict
#align_import measure_theory.measure.mutually_singular from "leanprover-community/mathlib"@"70a4f2197832bceab57d7f41379b2592d1110570"
open Set
open MeasureTheory NNReal ENNReal
namespace MeasureTheory
namespace Measure
variable {Ξ± : Type*} {m0 : MeasurableSpace Ξ±} {ΞΌ ΞΌβ ΞΌβ Ξ½ Ξ½β Ξ½β : Measure Ξ±}
def MutuallySingular {_ : MeasurableSpace Ξ±} (ΞΌ Ξ½ : Measure Ξ±) : Prop :=
β s : Set Ξ±, MeasurableSet s β§ ΞΌ s = 0 β§ Ξ½ sαΆ = 0
#align measure_theory.measure.mutually_singular MeasureTheory.Measure.MutuallySingular
@[inherit_doc MeasureTheory.Measure.MutuallySingular]
scoped[MeasureTheory] infixl:60 " ββ " => MeasureTheory.Measure.MutuallySingular
namespace MutuallySingular
theorem mk {s t : Set Ξ±} (hs : ΞΌ s = 0) (ht : Ξ½ t = 0) (hst : univ β s βͺ t) :
MutuallySingular ΞΌ Ξ½ := by
use toMeasurable ΞΌ s, measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans hs
refine measure_mono_null (fun x hx => (hst trivial).resolve_left fun hxs => hx ?_) ht
exact subset_toMeasurable _ _ hxs
#align measure_theory.measure.mutually_singular.mk MeasureTheory.Measure.MutuallySingular.mk
def nullSet (h : ΞΌ ββ Ξ½) : Set Ξ± := h.choose
lemma measurableSet_nullSet (h : ΞΌ ββ Ξ½) : MeasurableSet h.nullSet := h.choose_spec.1
@[simp]
lemma measure_nullSet (h : ΞΌ ββ Ξ½) : ΞΌ h.nullSet = 0 := h.choose_spec.2.1
@[simp]
lemma measure_compl_nullSet (h : ΞΌ ββ Ξ½) : Ξ½ h.nullSetαΆ = 0 := h.choose_spec.2.2
-- TODO: this is proved by simp, but is not simplified in other contexts without the @[simp]
-- attribute. Also, the linter does not complain about that attribute.
@[simp]
lemma restrict_nullSet (h : ΞΌ ββ Ξ½) : ΞΌ.restrict h.nullSet = 0 := by simp
-- TODO: this is proved by simp, but is not simplified in other contexts without the @[simp]
-- attribute. Also, the linter does not complain about that attribute.
@[simp]
lemma restrict_compl_nullSet (h : ΞΌ ββ Ξ½) : Ξ½.restrict h.nullSetαΆ = 0 := by simp
@[simp]
theorem zero_right : ΞΌ ββ 0 :=
β¨β
, MeasurableSet.empty, measure_empty, rflβ©
#align measure_theory.measure.mutually_singular.zero_right MeasureTheory.Measure.MutuallySingular.zero_right
@[symm]
theorem symm (h : Ξ½ ββ ΞΌ) : ΞΌ ββ Ξ½ :=
let β¨i, hi, his, hitβ© := h
β¨iαΆ, hi.compl, hit, (compl_compl i).symm βΈ hisβ©
#align measure_theory.measure.mutually_singular.symm MeasureTheory.Measure.MutuallySingular.symm
theorem comm : ΞΌ ββ Ξ½ β Ξ½ ββ ΞΌ :=
β¨fun h => h.symm, fun h => h.symmβ©
#align measure_theory.measure.mutually_singular.comm MeasureTheory.Measure.MutuallySingular.comm
@[simp]
theorem zero_left : 0 ββ ΞΌ :=
zero_right.symm
#align measure_theory.measure.mutually_singular.zero_left MeasureTheory.Measure.MutuallySingular.zero_left
theorem mono_ac (h : ΞΌβ ββ Ξ½β) (hΞΌ : ΞΌβ βͺ ΞΌβ) (hΞ½ : Ξ½β βͺ Ξ½β) : ΞΌβ ββ Ξ½β :=
let β¨s, hs, hβ, hββ© := h
β¨s, hs, hΞΌ hβ, hΞ½ hββ©
#align measure_theory.measure.mutually_singular.mono_ac MeasureTheory.Measure.MutuallySingular.mono_ac
theorem mono (h : ΞΌβ ββ Ξ½β) (hΞΌ : ΞΌβ β€ ΞΌβ) (hΞ½ : Ξ½β β€ Ξ½β) : ΞΌβ ββ Ξ½β :=
h.mono_ac hΞΌ.absolutelyContinuous hΞ½.absolutelyContinuous
#align measure_theory.measure.mutually_singular.mono MeasureTheory.Measure.MutuallySingular.mono
@[simp]
lemma self_iff (ΞΌ : Measure Ξ±) : ΞΌ ββ ΞΌ β ΞΌ = 0 := by
refine β¨?_, fun h β¦ by (rw [h]; exact zero_left)β©
rintro β¨s, hs, hΞΌs, hΞΌs_complβ©
suffices ΞΌ Set.univ = 0 by rwa [measure_univ_eq_zero] at this
rw [β Set.union_compl_self s, measure_union disjoint_compl_right hs.compl, hΞΌs, hΞΌs_compl,
add_zero]
@[simp]
| Mathlib/MeasureTheory/Measure/MutuallySingular.lean | 114 | 120 | theorem sum_left {ΞΉ : Type*} [Countable ΞΉ] {ΞΌ : ΞΉ β Measure Ξ±} : sum ΞΌ ββ Ξ½ β β i, ΞΌ i ββ Ξ½ := by |
refine β¨fun h i => h.mono (le_sum _ _) le_rfl, fun H => ?_β©
choose s hsm hsΞΌ hsΞ½ using H
refine β¨β i, s i, MeasurableSet.iInter hsm, ?_, ?_β©
Β· rw [sum_apply _ (MeasurableSet.iInter hsm), ENNReal.tsum_eq_zero]
exact fun i => measure_mono_null (iInter_subset _ _) (hsΞΌ i)
Β· rwa [compl_iInter, measure_iUnion_null_iff]
| 6 | 403.428793 | 2 | 1 | 3 | 913 |
import Mathlib.MeasureTheory.Measure.Restrict
#align_import measure_theory.measure.mutually_singular from "leanprover-community/mathlib"@"70a4f2197832bceab57d7f41379b2592d1110570"
open Set
open MeasureTheory NNReal ENNReal
namespace MeasureTheory
namespace Measure
variable {Ξ± : Type*} {m0 : MeasurableSpace Ξ±} {ΞΌ ΞΌβ ΞΌβ Ξ½ Ξ½β Ξ½β : Measure Ξ±}
def MutuallySingular {_ : MeasurableSpace Ξ±} (ΞΌ Ξ½ : Measure Ξ±) : Prop :=
β s : Set Ξ±, MeasurableSet s β§ ΞΌ s = 0 β§ Ξ½ sαΆ = 0
#align measure_theory.measure.mutually_singular MeasureTheory.Measure.MutuallySingular
@[inherit_doc MeasureTheory.Measure.MutuallySingular]
scoped[MeasureTheory] infixl:60 " ββ " => MeasureTheory.Measure.MutuallySingular
namespace MutuallySingular
theorem mk {s t : Set Ξ±} (hs : ΞΌ s = 0) (ht : Ξ½ t = 0) (hst : univ β s βͺ t) :
MutuallySingular ΞΌ Ξ½ := by
use toMeasurable ΞΌ s, measurableSet_toMeasurable _ _, (measure_toMeasurable _).trans hs
refine measure_mono_null (fun x hx => (hst trivial).resolve_left fun hxs => hx ?_) ht
exact subset_toMeasurable _ _ hxs
#align measure_theory.measure.mutually_singular.mk MeasureTheory.Measure.MutuallySingular.mk
def nullSet (h : ΞΌ ββ Ξ½) : Set Ξ± := h.choose
lemma measurableSet_nullSet (h : ΞΌ ββ Ξ½) : MeasurableSet h.nullSet := h.choose_spec.1
@[simp]
lemma measure_nullSet (h : ΞΌ ββ Ξ½) : ΞΌ h.nullSet = 0 := h.choose_spec.2.1
@[simp]
lemma measure_compl_nullSet (h : ΞΌ ββ Ξ½) : Ξ½ h.nullSetαΆ = 0 := h.choose_spec.2.2
-- TODO: this is proved by simp, but is not simplified in other contexts without the @[simp]
-- attribute. Also, the linter does not complain about that attribute.
@[simp]
lemma restrict_nullSet (h : ΞΌ ββ Ξ½) : ΞΌ.restrict h.nullSet = 0 := by simp
-- TODO: this is proved by simp, but is not simplified in other contexts without the @[simp]
-- attribute. Also, the linter does not complain about that attribute.
@[simp]
lemma restrict_compl_nullSet (h : ΞΌ ββ Ξ½) : Ξ½.restrict h.nullSetαΆ = 0 := by simp
@[simp]
theorem zero_right : ΞΌ ββ 0 :=
β¨β
, MeasurableSet.empty, measure_empty, rflβ©
#align measure_theory.measure.mutually_singular.zero_right MeasureTheory.Measure.MutuallySingular.zero_right
@[symm]
theorem symm (h : Ξ½ ββ ΞΌ) : ΞΌ ββ Ξ½ :=
let β¨i, hi, his, hitβ© := h
β¨iαΆ, hi.compl, hit, (compl_compl i).symm βΈ hisβ©
#align measure_theory.measure.mutually_singular.symm MeasureTheory.Measure.MutuallySingular.symm
theorem comm : ΞΌ ββ Ξ½ β Ξ½ ββ ΞΌ :=
β¨fun h => h.symm, fun h => h.symmβ©
#align measure_theory.measure.mutually_singular.comm MeasureTheory.Measure.MutuallySingular.comm
@[simp]
theorem zero_left : 0 ββ ΞΌ :=
zero_right.symm
#align measure_theory.measure.mutually_singular.zero_left MeasureTheory.Measure.MutuallySingular.zero_left
theorem mono_ac (h : ΞΌβ ββ Ξ½β) (hΞΌ : ΞΌβ βͺ ΞΌβ) (hΞ½ : Ξ½β βͺ Ξ½β) : ΞΌβ ββ Ξ½β :=
let β¨s, hs, hβ, hββ© := h
β¨s, hs, hΞΌ hβ, hΞ½ hββ©
#align measure_theory.measure.mutually_singular.mono_ac MeasureTheory.Measure.MutuallySingular.mono_ac
theorem mono (h : ΞΌβ ββ Ξ½β) (hΞΌ : ΞΌβ β€ ΞΌβ) (hΞ½ : Ξ½β β€ Ξ½β) : ΞΌβ ββ Ξ½β :=
h.mono_ac hΞΌ.absolutelyContinuous hΞ½.absolutelyContinuous
#align measure_theory.measure.mutually_singular.mono MeasureTheory.Measure.MutuallySingular.mono
@[simp]
lemma self_iff (ΞΌ : Measure Ξ±) : ΞΌ ββ ΞΌ β ΞΌ = 0 := by
refine β¨?_, fun h β¦ by (rw [h]; exact zero_left)β©
rintro β¨s, hs, hΞΌs, hΞΌs_complβ©
suffices ΞΌ Set.univ = 0 by rwa [measure_univ_eq_zero] at this
rw [β Set.union_compl_self s, measure_union disjoint_compl_right hs.compl, hΞΌs, hΞΌs_compl,
add_zero]
@[simp]
theorem sum_left {ΞΉ : Type*} [Countable ΞΉ] {ΞΌ : ΞΉ β Measure Ξ±} : sum ΞΌ ββ Ξ½ β β i, ΞΌ i ββ Ξ½ := by
refine β¨fun h i => h.mono (le_sum _ _) le_rfl, fun H => ?_β©
choose s hsm hsΞΌ hsΞ½ using H
refine β¨β i, s i, MeasurableSet.iInter hsm, ?_, ?_β©
Β· rw [sum_apply _ (MeasurableSet.iInter hsm), ENNReal.tsum_eq_zero]
exact fun i => measure_mono_null (iInter_subset _ _) (hsΞΌ i)
Β· rwa [compl_iInter, measure_iUnion_null_iff]
#align measure_theory.measure.mutually_singular.sum_left MeasureTheory.Measure.MutuallySingular.sum_left
@[simp]
theorem sum_right {ΞΉ : Type*} [Countable ΞΉ] {Ξ½ : ΞΉ β Measure Ξ±} : ΞΌ ββ sum Ξ½ β β i, ΞΌ ββ Ξ½ i :=
comm.trans <| sum_left.trans <| forall_congr' fun _ => comm
#align measure_theory.measure.mutually_singular.sum_right MeasureTheory.Measure.MutuallySingular.sum_right
@[simp]
| Mathlib/MeasureTheory/Measure/MutuallySingular.lean | 129 | 130 | theorem add_left_iff : ΞΌβ + ΞΌβ ββ Ξ½ β ΞΌβ ββ Ξ½ β§ ΞΌβ ββ Ξ½ := by |
rw [β sum_cond, sum_left, Bool.forall_bool, cond, cond, and_comm]
| 1 | 2.718282 | 0 | 1 | 3 | 913 |
import Mathlib.Analysis.Normed.Group.SemiNormedGroupCat
import Mathlib.Analysis.Normed.Group.Quotient
import Mathlib.CategoryTheory.Limits.Shapes.Kernels
#align_import analysis.normed.group.SemiNormedGroup.kernels from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3"
open CategoryTheory CategoryTheory.Limits
universe u
namespace SemiNormedGroupCat
section Cokernel
-- PROJECT: can we reuse the work to construct cokernels in `SemiNormedGroupCatβ` here?
-- I don't see a way to do this that is less work than just repeating the relevant parts.
noncomputable
def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X βΆ Y) : Cofork f 0 :=
@Cofork.ofΟ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y β§Έ NormedAddGroupHom.range f)) f.range.normedMk
(by
ext a
simp only [comp_apply, Limits.zero_comp]
-- Porting note: `simp` not firing on the below
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [comp_apply, NormedAddGroupHom.zero_apply]
-- Porting note: Lean 3 didn't need this instance
letI : SeminormedAddCommGroup ((forget SemiNormedGroupCat).obj Y) :=
(inferInstance : SeminormedAddCommGroup Y)
-- Porting note: again simp doesn't seem to be firing in the below line
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [β NormedAddGroupHom.mem_ker, f.range.ker_normedMk, f.mem_range]
-- This used to be `simp only [exists_apply_eq_apply]` before leanprover/lean4#2644
convert exists_apply_eq_apply f a)
set_option linter.uppercaseLean3 false in
#align SemiNormedGroup.cokernel_cocone SemiNormedGroupCat.cokernelCocone
noncomputable
def cokernelLift {X Y : SemiNormedGroupCat.{u}} (f : X βΆ Y) (s : CokernelCofork f) :
(cokernelCocone f).pt βΆ s.pt :=
NormedAddGroupHom.lift _ s.Ο
(by
rintro _ β¨b, rflβ©
change (f β« s.Ο) b = 0
simp
-- This used to be the end of the proof before leanprover/lean4#2644
erw [zero_apply])
set_option linter.uppercaseLean3 false in
#align SemiNormedGroup.cokernel_lift SemiNormedGroupCat.cokernelLift
noncomputable
def isColimitCokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X βΆ Y) :
IsColimit (cokernelCocone f) :=
isColimitAux _ (cokernelLift f)
(fun s => by
ext
apply NormedAddGroupHom.lift_mk f.range
rintro _ β¨b, rflβ©
change (f β« s.Ο) b = 0
simp
-- This used to be the end of the proof before leanprover/lean4#2644
erw [zero_apply])
fun s m w => NormedAddGroupHom.lift_unique f.range _ _ _ w
set_option linter.uppercaseLean3 false in
#align SemiNormedGroup.is_colimit_cokernel_cocone SemiNormedGroupCat.isColimitCokernelCocone
instance : HasCokernels SemiNormedGroupCat.{u} where
has_colimit f :=
HasColimit.mk
{ cocone := cokernelCocone f
isColimit := isColimitCokernelCocone f }
-- Sanity check
example : HasCokernels SemiNormedGroupCat := by infer_instance
section ExplicitCokernel
noncomputable
def explicitCokernel {X Y : SemiNormedGroupCat.{u}} (f : X βΆ Y) : SemiNormedGroupCat.{u} :=
(cokernelCocone f).pt
set_option linter.uppercaseLean3 false in
#align SemiNormedGroup.explicit_cokernel SemiNormedGroupCat.explicitCokernel
noncomputable
def explicitCokernelDesc {X Y Z : SemiNormedGroupCat.{u}} {f : X βΆ Y} {g : Y βΆ Z} (w : f β« g = 0) :
explicitCokernel f βΆ Z :=
(isColimitCokernelCocone f).desc (Cofork.ofΟ g (by simp [w]))
set_option linter.uppercaseLean3 false in
#align SemiNormedGroup.explicit_cokernel_desc SemiNormedGroupCat.explicitCokernelDesc
noncomputable
def explicitCokernelΟ {X Y : SemiNormedGroupCat.{u}} (f : X βΆ Y) : Y βΆ explicitCokernel f :=
(cokernelCocone f).ΞΉ.app WalkingParallelPair.one
set_option linter.uppercaseLean3 false in
#align SemiNormedGroup.explicit_cokernel_Ο SemiNormedGroupCat.explicitCokernelΟ
theorem explicitCokernelΟ_surjective {X Y : SemiNormedGroupCat.{u}} {f : X βΆ Y} :
Function.Surjective (explicitCokernelΟ f) :=
surjective_quot_mk _
set_option linter.uppercaseLean3 false in
#align SemiNormedGroup.explicit_cokernel_Ο_surjective SemiNormedGroupCat.explicitCokernelΟ_surjective
@[simp, reassoc]
| Mathlib/Analysis/Normed/Group/SemiNormedGroupCat/Kernels.lean | 242 | 245 | theorem comp_explicitCokernelΟ {X Y : SemiNormedGroupCat.{u}} (f : X βΆ Y) :
f β« explicitCokernelΟ f = 0 := by |
convert (cokernelCocone f).w WalkingParallelPairHom.left
simp
| 2 | 7.389056 | 1 | 1 | 1 | 914 |
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Set.Finite
import Mathlib.GroupTheory.GroupAction.BigOperators
#align_import data.dfinsupp.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u uβ uβ v vβ vβ vβ w x y l
variable {ΞΉ : Type u} {Ξ³ : Type w} {Ξ² : ΞΉ β Type v} {Ξ²β : ΞΉ β Type vβ} {Ξ²β : ΞΉ β Type vβ}
variable (Ξ²)
structure DFinsupp [β i, Zero (Ξ² i)] : Type max u v where mk' ::
toFun : β i, Ξ² i
support' : Trunc { s : Multiset ΞΉ // β i, i β s β¨ toFun i = 0 }
#align dfinsupp DFinsupp
variable {Ξ²}
notation3 "Ξ β "(...)", "r:(scoped f => DFinsupp f) => r
namespace DFinsupp
section Basic
variable [β i, Zero (Ξ² i)] [β i, Zero (Ξ²β i)] [β i, Zero (Ξ²β i)]
instance instDFunLike : DFunLike (Ξ β i, Ξ² i) ΞΉ Ξ² :=
β¨fun f => f.toFun, fun β¨fβ, sββ© β¨fβ, sββ© β¦ fun (h : fβ = fβ) β¦ by
subst h
congr
apply Subsingleton.elim β©
#align dfinsupp.fun_like DFinsupp.instDFunLike
instance : CoeFun (Ξ β i, Ξ² i) fun _ => β i, Ξ² i :=
inferInstance
@[simp]
theorem toFun_eq_coe (f : Ξ β i, Ξ² i) : f.toFun = f :=
rfl
#align dfinsupp.to_fun_eq_coe DFinsupp.toFun_eq_coe
@[ext]
theorem ext {f g : Ξ β i, Ξ² i} (h : β i, f i = g i) : f = g :=
DFunLike.ext _ _ h
#align dfinsupp.ext DFinsupp.ext
#align dfinsupp.ext_iff DFunLike.ext_iff
#align dfinsupp.coe_fn_injective DFunLike.coe_injective
lemma ne_iff {f g : Ξ β i, Ξ² i} : f β g β β i, f i β g i := DFunLike.ne_iff
instance : Zero (Ξ β i, Ξ² i) :=
β¨β¨0, Trunc.mk <| β¨β
, fun _ => Or.inr rflβ©β©β©
instance : Inhabited (Ξ β i, Ξ² i) :=
β¨0β©
@[simp, norm_cast] lemma coe_mk' (f : β i, Ξ² i) (s) : β(β¨f, sβ© : Ξ β i, Ξ² i) = f := rfl
#align dfinsupp.coe_mk' DFinsupp.coe_mk'
@[simp, norm_cast] lemma coe_zero : β(0 : Ξ β i, Ξ² i) = 0 := rfl
#align dfinsupp.coe_zero DFinsupp.coe_zero
theorem zero_apply (i : ΞΉ) : (0 : Ξ β i, Ξ² i) i = 0 :=
rfl
#align dfinsupp.zero_apply DFinsupp.zero_apply
def mapRange (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (x : Ξ β i, Ξ²β i) : Ξ β i, Ξ²β i :=
β¨fun i => f i (x i),
x.support'.map fun s => β¨s.1, fun i => (s.2 i).imp_right fun h : x i = 0 => by
rw [β hf i, β h]β©β©
#align dfinsupp.map_range DFinsupp.mapRange
@[simp]
theorem mapRange_apply (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (g : Ξ β i, Ξ²β i) (i : ΞΉ) :
mapRange f hf g i = f i (g i) :=
rfl
#align dfinsupp.map_range_apply DFinsupp.mapRange_apply
@[simp]
| Mathlib/Data/DFinsupp/Basic.lean | 144 | 147 | theorem mapRange_id (h : β i, id (0 : Ξ²β i) = 0 := fun i => rfl) (g : Ξ β i : ΞΉ, Ξ²β i) :
mapRange (fun i => (id : Ξ²β i β Ξ²β i)) h g = g := by |
ext
rfl
| 2 | 7.389056 | 1 | 1 | 3 | 915 |
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Set.Finite
import Mathlib.GroupTheory.GroupAction.BigOperators
#align_import data.dfinsupp.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u uβ uβ v vβ vβ vβ w x y l
variable {ΞΉ : Type u} {Ξ³ : Type w} {Ξ² : ΞΉ β Type v} {Ξ²β : ΞΉ β Type vβ} {Ξ²β : ΞΉ β Type vβ}
variable (Ξ²)
structure DFinsupp [β i, Zero (Ξ² i)] : Type max u v where mk' ::
toFun : β i, Ξ² i
support' : Trunc { s : Multiset ΞΉ // β i, i β s β¨ toFun i = 0 }
#align dfinsupp DFinsupp
variable {Ξ²}
notation3 "Ξ β "(...)", "r:(scoped f => DFinsupp f) => r
namespace DFinsupp
section Basic
variable [β i, Zero (Ξ² i)] [β i, Zero (Ξ²β i)] [β i, Zero (Ξ²β i)]
instance instDFunLike : DFunLike (Ξ β i, Ξ² i) ΞΉ Ξ² :=
β¨fun f => f.toFun, fun β¨fβ, sββ© β¨fβ, sββ© β¦ fun (h : fβ = fβ) β¦ by
subst h
congr
apply Subsingleton.elim β©
#align dfinsupp.fun_like DFinsupp.instDFunLike
instance : CoeFun (Ξ β i, Ξ² i) fun _ => β i, Ξ² i :=
inferInstance
@[simp]
theorem toFun_eq_coe (f : Ξ β i, Ξ² i) : f.toFun = f :=
rfl
#align dfinsupp.to_fun_eq_coe DFinsupp.toFun_eq_coe
@[ext]
theorem ext {f g : Ξ β i, Ξ² i} (h : β i, f i = g i) : f = g :=
DFunLike.ext _ _ h
#align dfinsupp.ext DFinsupp.ext
#align dfinsupp.ext_iff DFunLike.ext_iff
#align dfinsupp.coe_fn_injective DFunLike.coe_injective
lemma ne_iff {f g : Ξ β i, Ξ² i} : f β g β β i, f i β g i := DFunLike.ne_iff
instance : Zero (Ξ β i, Ξ² i) :=
β¨β¨0, Trunc.mk <| β¨β
, fun _ => Or.inr rflβ©β©β©
instance : Inhabited (Ξ β i, Ξ² i) :=
β¨0β©
@[simp, norm_cast] lemma coe_mk' (f : β i, Ξ² i) (s) : β(β¨f, sβ© : Ξ β i, Ξ² i) = f := rfl
#align dfinsupp.coe_mk' DFinsupp.coe_mk'
@[simp, norm_cast] lemma coe_zero : β(0 : Ξ β i, Ξ² i) = 0 := rfl
#align dfinsupp.coe_zero DFinsupp.coe_zero
theorem zero_apply (i : ΞΉ) : (0 : Ξ β i, Ξ² i) i = 0 :=
rfl
#align dfinsupp.zero_apply DFinsupp.zero_apply
def mapRange (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (x : Ξ β i, Ξ²β i) : Ξ β i, Ξ²β i :=
β¨fun i => f i (x i),
x.support'.map fun s => β¨s.1, fun i => (s.2 i).imp_right fun h : x i = 0 => by
rw [β hf i, β h]β©β©
#align dfinsupp.map_range DFinsupp.mapRange
@[simp]
theorem mapRange_apply (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (g : Ξ β i, Ξ²β i) (i : ΞΉ) :
mapRange f hf g i = f i (g i) :=
rfl
#align dfinsupp.map_range_apply DFinsupp.mapRange_apply
@[simp]
theorem mapRange_id (h : β i, id (0 : Ξ²β i) = 0 := fun i => rfl) (g : Ξ β i : ΞΉ, Ξ²β i) :
mapRange (fun i => (id : Ξ²β i β Ξ²β i)) h g = g := by
ext
rfl
#align dfinsupp.map_range_id DFinsupp.mapRange_id
| Mathlib/Data/DFinsupp/Basic.lean | 150 | 154 | theorem mapRange_comp (f : β i, Ξ²β i β Ξ²β i) (fβ : β i, Ξ² i β Ξ²β i) (hf : β i, f i 0 = 0)
(hfβ : β i, fβ i 0 = 0) (h : β i, (f i β fβ i) 0 = 0) (g : Ξ β i : ΞΉ, Ξ² i) :
mapRange (fun i => f i β fβ i) h g = mapRange f hf (mapRange fβ hfβ g) := by |
ext
simp only [mapRange_apply]; rfl
| 2 | 7.389056 | 1 | 1 | 3 | 915 |
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Module.LinearMap.Basic
import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Set.Finite
import Mathlib.GroupTheory.GroupAction.BigOperators
#align_import data.dfinsupp.basic from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"
universe u uβ uβ v vβ vβ vβ w x y l
variable {ΞΉ : Type u} {Ξ³ : Type w} {Ξ² : ΞΉ β Type v} {Ξ²β : ΞΉ β Type vβ} {Ξ²β : ΞΉ β Type vβ}
variable (Ξ²)
structure DFinsupp [β i, Zero (Ξ² i)] : Type max u v where mk' ::
toFun : β i, Ξ² i
support' : Trunc { s : Multiset ΞΉ // β i, i β s β¨ toFun i = 0 }
#align dfinsupp DFinsupp
variable {Ξ²}
notation3 "Ξ β "(...)", "r:(scoped f => DFinsupp f) => r
namespace DFinsupp
section Basic
variable [β i, Zero (Ξ² i)] [β i, Zero (Ξ²β i)] [β i, Zero (Ξ²β i)]
instance instDFunLike : DFunLike (Ξ β i, Ξ² i) ΞΉ Ξ² :=
β¨fun f => f.toFun, fun β¨fβ, sββ© β¨fβ, sββ© β¦ fun (h : fβ = fβ) β¦ by
subst h
congr
apply Subsingleton.elim β©
#align dfinsupp.fun_like DFinsupp.instDFunLike
instance : CoeFun (Ξ β i, Ξ² i) fun _ => β i, Ξ² i :=
inferInstance
@[simp]
theorem toFun_eq_coe (f : Ξ β i, Ξ² i) : f.toFun = f :=
rfl
#align dfinsupp.to_fun_eq_coe DFinsupp.toFun_eq_coe
@[ext]
theorem ext {f g : Ξ β i, Ξ² i} (h : β i, f i = g i) : f = g :=
DFunLike.ext _ _ h
#align dfinsupp.ext DFinsupp.ext
#align dfinsupp.ext_iff DFunLike.ext_iff
#align dfinsupp.coe_fn_injective DFunLike.coe_injective
lemma ne_iff {f g : Ξ β i, Ξ² i} : f β g β β i, f i β g i := DFunLike.ne_iff
instance : Zero (Ξ β i, Ξ² i) :=
β¨β¨0, Trunc.mk <| β¨β
, fun _ => Or.inr rflβ©β©β©
instance : Inhabited (Ξ β i, Ξ² i) :=
β¨0β©
@[simp, norm_cast] lemma coe_mk' (f : β i, Ξ² i) (s) : β(β¨f, sβ© : Ξ β i, Ξ² i) = f := rfl
#align dfinsupp.coe_mk' DFinsupp.coe_mk'
@[simp, norm_cast] lemma coe_zero : β(0 : Ξ β i, Ξ² i) = 0 := rfl
#align dfinsupp.coe_zero DFinsupp.coe_zero
theorem zero_apply (i : ΞΉ) : (0 : Ξ β i, Ξ² i) i = 0 :=
rfl
#align dfinsupp.zero_apply DFinsupp.zero_apply
def mapRange (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (x : Ξ β i, Ξ²β i) : Ξ β i, Ξ²β i :=
β¨fun i => f i (x i),
x.support'.map fun s => β¨s.1, fun i => (s.2 i).imp_right fun h : x i = 0 => by
rw [β hf i, β h]β©β©
#align dfinsupp.map_range DFinsupp.mapRange
@[simp]
theorem mapRange_apply (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) (g : Ξ β i, Ξ²β i) (i : ΞΉ) :
mapRange f hf g i = f i (g i) :=
rfl
#align dfinsupp.map_range_apply DFinsupp.mapRange_apply
@[simp]
theorem mapRange_id (h : β i, id (0 : Ξ²β i) = 0 := fun i => rfl) (g : Ξ β i : ΞΉ, Ξ²β i) :
mapRange (fun i => (id : Ξ²β i β Ξ²β i)) h g = g := by
ext
rfl
#align dfinsupp.map_range_id DFinsupp.mapRange_id
theorem mapRange_comp (f : β i, Ξ²β i β Ξ²β i) (fβ : β i, Ξ² i β Ξ²β i) (hf : β i, f i 0 = 0)
(hfβ : β i, fβ i 0 = 0) (h : β i, (f i β fβ i) 0 = 0) (g : Ξ β i : ΞΉ, Ξ² i) :
mapRange (fun i => f i β fβ i) h g = mapRange f hf (mapRange fβ hfβ g) := by
ext
simp only [mapRange_apply]; rfl
#align dfinsupp.map_range_comp DFinsupp.mapRange_comp
@[simp]
| Mathlib/Data/DFinsupp/Basic.lean | 158 | 161 | theorem mapRange_zero (f : β i, Ξ²β i β Ξ²β i) (hf : β i, f i 0 = 0) :
mapRange f hf (0 : Ξ β i, Ξ²β i) = 0 := by |
ext
simp only [mapRange_apply, coe_zero, Pi.zero_apply, hf]
| 2 | 7.389056 | 1 | 1 | 3 | 915 |
import Mathlib.CategoryTheory.CommSq
#align_import category_theory.lifting_properties.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
universe v
namespace CategoryTheory
open Category
variable {C : Type*} [Category C] {A B B' X Y Y' : C} (i : A βΆ B) (i' : B βΆ B') (p : X βΆ Y)
(p' : Y βΆ Y')
class HasLiftingProperty : Prop where
sq_hasLift : β {f : A βΆ X} {g : B βΆ Y} (sq : CommSq f i p g), sq.HasLift
#align category_theory.has_lifting_property CategoryTheory.HasLiftingProperty
#align category_theory.has_lifting_property.sq_has_lift CategoryTheory.HasLiftingProperty.sq_hasLift
instance (priority := 100) sq_hasLift_of_hasLiftingProperty {f : A βΆ X} {g : B βΆ Y}
(sq : CommSq f i p g) [hip : HasLiftingProperty i p] : sq.HasLift := by apply hip.sq_hasLift
#align category_theory.sq_has_lift_of_has_lifting_property CategoryTheory.sq_hasLift_of_hasLiftingProperty
namespace HasLiftingProperty
variable {i p}
theorem op (h : HasLiftingProperty i p) : HasLiftingProperty p.op i.op :=
β¨fun {f} {g} sq => by
simp only [CommSq.HasLift.iff_unop, Quiver.Hom.unop_op]
infer_instanceβ©
#align category_theory.has_lifting_property.op CategoryTheory.HasLiftingProperty.op
theorem unop {A B X Y : Cα΅α΅} {i : A βΆ B} {p : X βΆ Y} (h : HasLiftingProperty i p) :
HasLiftingProperty p.unop i.unop :=
β¨fun {f} {g} sq => by
rw [CommSq.HasLift.iff_op]
simp only [Quiver.Hom.op_unop]
infer_instanceβ©
#align category_theory.has_lifting_property.unop CategoryTheory.HasLiftingProperty.unop
theorem iff_op : HasLiftingProperty i p β HasLiftingProperty p.op i.op :=
β¨op, unopβ©
#align category_theory.has_lifting_property.iff_op CategoryTheory.HasLiftingProperty.iff_op
theorem iff_unop {A B X Y : Cα΅α΅} (i : A βΆ B) (p : X βΆ Y) :
HasLiftingProperty i p β HasLiftingProperty p.unop i.unop :=
β¨unop, opβ©
#align category_theory.has_lifting_property.iff_unop CategoryTheory.HasLiftingProperty.iff_unop
variable (i p)
instance (priority := 100) of_left_iso [IsIso i] : HasLiftingProperty i p :=
β¨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := inv i β« f
fac_left := by simp only [IsIso.hom_inv_id_assoc]
fac_right := by simp only [sq.w, assoc, IsIso.inv_hom_id_assoc] }β©
#align category_theory.has_lifting_property.of_left_iso CategoryTheory.HasLiftingProperty.of_left_iso
instance (priority := 100) of_right_iso [IsIso p] : HasLiftingProperty i p :=
β¨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := g β« inv p
fac_left := by simp only [β sq.w_assoc, IsIso.hom_inv_id, comp_id]
fac_right := by simp only [assoc, IsIso.inv_hom_id, comp_id] }β©
#align category_theory.has_lifting_property.of_right_iso CategoryTheory.HasLiftingProperty.of_right_iso
instance of_comp_left [HasLiftingProperty i p] [HasLiftingProperty i' p] :
HasLiftingProperty (i β« i') p :=
β¨fun {f} {g} sq => by
have fac := sq.w
rw [assoc] at fac
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_right).lift
fac_left := by simp only [assoc, CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right] }β©
#align category_theory.has_lifting_property.of_comp_left CategoryTheory.HasLiftingProperty.of_comp_left
instance of_comp_right [HasLiftingProperty i p] [HasLiftingProperty i p'] :
HasLiftingProperty i (p β« p') :=
β¨fun {f} {g} sq => by
have fac := sq.w
rw [β assoc] at fac
let _ := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
fac_left := by simp only [CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right_assoc, CommSq.fac_right] }β©
#align category_theory.has_lifting_property.of_comp_right CategoryTheory.HasLiftingProperty.of_comp_right
| Mathlib/CategoryTheory/LiftingProperties/Basic.lean | 121 | 125 | theorem of_arrow_iso_left {A B A' B' X Y : C} {i : A βΆ B} {i' : A' βΆ B'}
(e : Arrow.mk i β
Arrow.mk i') (p : X βΆ Y) [hip : HasLiftingProperty i p] :
HasLiftingProperty i' p := by |
rw [Arrow.iso_w' e]
infer_instance
| 2 | 7.389056 | 1 | 1 | 3 | 916 |
import Mathlib.CategoryTheory.CommSq
#align_import category_theory.lifting_properties.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
universe v
namespace CategoryTheory
open Category
variable {C : Type*} [Category C] {A B B' X Y Y' : C} (i : A βΆ B) (i' : B βΆ B') (p : X βΆ Y)
(p' : Y βΆ Y')
class HasLiftingProperty : Prop where
sq_hasLift : β {f : A βΆ X} {g : B βΆ Y} (sq : CommSq f i p g), sq.HasLift
#align category_theory.has_lifting_property CategoryTheory.HasLiftingProperty
#align category_theory.has_lifting_property.sq_has_lift CategoryTheory.HasLiftingProperty.sq_hasLift
instance (priority := 100) sq_hasLift_of_hasLiftingProperty {f : A βΆ X} {g : B βΆ Y}
(sq : CommSq f i p g) [hip : HasLiftingProperty i p] : sq.HasLift := by apply hip.sq_hasLift
#align category_theory.sq_has_lift_of_has_lifting_property CategoryTheory.sq_hasLift_of_hasLiftingProperty
namespace HasLiftingProperty
variable {i p}
theorem op (h : HasLiftingProperty i p) : HasLiftingProperty p.op i.op :=
β¨fun {f} {g} sq => by
simp only [CommSq.HasLift.iff_unop, Quiver.Hom.unop_op]
infer_instanceβ©
#align category_theory.has_lifting_property.op CategoryTheory.HasLiftingProperty.op
theorem unop {A B X Y : Cα΅α΅} {i : A βΆ B} {p : X βΆ Y} (h : HasLiftingProperty i p) :
HasLiftingProperty p.unop i.unop :=
β¨fun {f} {g} sq => by
rw [CommSq.HasLift.iff_op]
simp only [Quiver.Hom.op_unop]
infer_instanceβ©
#align category_theory.has_lifting_property.unop CategoryTheory.HasLiftingProperty.unop
theorem iff_op : HasLiftingProperty i p β HasLiftingProperty p.op i.op :=
β¨op, unopβ©
#align category_theory.has_lifting_property.iff_op CategoryTheory.HasLiftingProperty.iff_op
theorem iff_unop {A B X Y : Cα΅α΅} (i : A βΆ B) (p : X βΆ Y) :
HasLiftingProperty i p β HasLiftingProperty p.unop i.unop :=
β¨unop, opβ©
#align category_theory.has_lifting_property.iff_unop CategoryTheory.HasLiftingProperty.iff_unop
variable (i p)
instance (priority := 100) of_left_iso [IsIso i] : HasLiftingProperty i p :=
β¨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := inv i β« f
fac_left := by simp only [IsIso.hom_inv_id_assoc]
fac_right := by simp only [sq.w, assoc, IsIso.inv_hom_id_assoc] }β©
#align category_theory.has_lifting_property.of_left_iso CategoryTheory.HasLiftingProperty.of_left_iso
instance (priority := 100) of_right_iso [IsIso p] : HasLiftingProperty i p :=
β¨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := g β« inv p
fac_left := by simp only [β sq.w_assoc, IsIso.hom_inv_id, comp_id]
fac_right := by simp only [assoc, IsIso.inv_hom_id, comp_id] }β©
#align category_theory.has_lifting_property.of_right_iso CategoryTheory.HasLiftingProperty.of_right_iso
instance of_comp_left [HasLiftingProperty i p] [HasLiftingProperty i' p] :
HasLiftingProperty (i β« i') p :=
β¨fun {f} {g} sq => by
have fac := sq.w
rw [assoc] at fac
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_right).lift
fac_left := by simp only [assoc, CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right] }β©
#align category_theory.has_lifting_property.of_comp_left CategoryTheory.HasLiftingProperty.of_comp_left
instance of_comp_right [HasLiftingProperty i p] [HasLiftingProperty i p'] :
HasLiftingProperty i (p β« p') :=
β¨fun {f} {g} sq => by
have fac := sq.w
rw [β assoc] at fac
let _ := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
fac_left := by simp only [CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right_assoc, CommSq.fac_right] }β©
#align category_theory.has_lifting_property.of_comp_right CategoryTheory.HasLiftingProperty.of_comp_right
theorem of_arrow_iso_left {A B A' B' X Y : C} {i : A βΆ B} {i' : A' βΆ B'}
(e : Arrow.mk i β
Arrow.mk i') (p : X βΆ Y) [hip : HasLiftingProperty i p] :
HasLiftingProperty i' p := by
rw [Arrow.iso_w' e]
infer_instance
#align category_theory.has_lifting_property.of_arrow_iso_left CategoryTheory.HasLiftingProperty.of_arrow_iso_left
| Mathlib/CategoryTheory/LiftingProperties/Basic.lean | 128 | 131 | theorem of_arrow_iso_right {A B X Y X' Y' : C} (i : A βΆ B) {p : X βΆ Y} {p' : X' βΆ Y'}
(e : Arrow.mk p β
Arrow.mk p') [hip : HasLiftingProperty i p] : HasLiftingProperty i p' := by |
rw [Arrow.iso_w' e]
infer_instance
| 2 | 7.389056 | 1 | 1 | 3 | 916 |
import Mathlib.CategoryTheory.CommSq
#align_import category_theory.lifting_properties.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514"
universe v
namespace CategoryTheory
open Category
variable {C : Type*} [Category C] {A B B' X Y Y' : C} (i : A βΆ B) (i' : B βΆ B') (p : X βΆ Y)
(p' : Y βΆ Y')
class HasLiftingProperty : Prop where
sq_hasLift : β {f : A βΆ X} {g : B βΆ Y} (sq : CommSq f i p g), sq.HasLift
#align category_theory.has_lifting_property CategoryTheory.HasLiftingProperty
#align category_theory.has_lifting_property.sq_has_lift CategoryTheory.HasLiftingProperty.sq_hasLift
instance (priority := 100) sq_hasLift_of_hasLiftingProperty {f : A βΆ X} {g : B βΆ Y}
(sq : CommSq f i p g) [hip : HasLiftingProperty i p] : sq.HasLift := by apply hip.sq_hasLift
#align category_theory.sq_has_lift_of_has_lifting_property CategoryTheory.sq_hasLift_of_hasLiftingProperty
namespace HasLiftingProperty
variable {i p}
theorem op (h : HasLiftingProperty i p) : HasLiftingProperty p.op i.op :=
β¨fun {f} {g} sq => by
simp only [CommSq.HasLift.iff_unop, Quiver.Hom.unop_op]
infer_instanceβ©
#align category_theory.has_lifting_property.op CategoryTheory.HasLiftingProperty.op
theorem unop {A B X Y : Cα΅α΅} {i : A βΆ B} {p : X βΆ Y} (h : HasLiftingProperty i p) :
HasLiftingProperty p.unop i.unop :=
β¨fun {f} {g} sq => by
rw [CommSq.HasLift.iff_op]
simp only [Quiver.Hom.op_unop]
infer_instanceβ©
#align category_theory.has_lifting_property.unop CategoryTheory.HasLiftingProperty.unop
theorem iff_op : HasLiftingProperty i p β HasLiftingProperty p.op i.op :=
β¨op, unopβ©
#align category_theory.has_lifting_property.iff_op CategoryTheory.HasLiftingProperty.iff_op
theorem iff_unop {A B X Y : Cα΅α΅} (i : A βΆ B) (p : X βΆ Y) :
HasLiftingProperty i p β HasLiftingProperty p.unop i.unop :=
β¨unop, opβ©
#align category_theory.has_lifting_property.iff_unop CategoryTheory.HasLiftingProperty.iff_unop
variable (i p)
instance (priority := 100) of_left_iso [IsIso i] : HasLiftingProperty i p :=
β¨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := inv i β« f
fac_left := by simp only [IsIso.hom_inv_id_assoc]
fac_right := by simp only [sq.w, assoc, IsIso.inv_hom_id_assoc] }β©
#align category_theory.has_lifting_property.of_left_iso CategoryTheory.HasLiftingProperty.of_left_iso
instance (priority := 100) of_right_iso [IsIso p] : HasLiftingProperty i p :=
β¨fun {f} {g} sq =>
CommSq.HasLift.mk'
{ l := g β« inv p
fac_left := by simp only [β sq.w_assoc, IsIso.hom_inv_id, comp_id]
fac_right := by simp only [assoc, IsIso.inv_hom_id, comp_id] }β©
#align category_theory.has_lifting_property.of_right_iso CategoryTheory.HasLiftingProperty.of_right_iso
instance of_comp_left [HasLiftingProperty i p] [HasLiftingProperty i' p] :
HasLiftingProperty (i β« i') p :=
β¨fun {f} {g} sq => by
have fac := sq.w
rw [assoc] at fac
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_right).lift
fac_left := by simp only [assoc, CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right] }β©
#align category_theory.has_lifting_property.of_comp_left CategoryTheory.HasLiftingProperty.of_comp_left
instance of_comp_right [HasLiftingProperty i p] [HasLiftingProperty i p'] :
HasLiftingProperty i (p β« p') :=
β¨fun {f} {g} sq => by
have fac := sq.w
rw [β assoc] at fac
let _ := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
exact
CommSq.HasLift.mk'
{ l := (CommSq.mk (CommSq.mk fac).fac_left.symm).lift
fac_left := by simp only [CommSq.fac_left]
fac_right := by simp only [CommSq.fac_right_assoc, CommSq.fac_right] }β©
#align category_theory.has_lifting_property.of_comp_right CategoryTheory.HasLiftingProperty.of_comp_right
theorem of_arrow_iso_left {A B A' B' X Y : C} {i : A βΆ B} {i' : A' βΆ B'}
(e : Arrow.mk i β
Arrow.mk i') (p : X βΆ Y) [hip : HasLiftingProperty i p] :
HasLiftingProperty i' p := by
rw [Arrow.iso_w' e]
infer_instance
#align category_theory.has_lifting_property.of_arrow_iso_left CategoryTheory.HasLiftingProperty.of_arrow_iso_left
theorem of_arrow_iso_right {A B X Y X' Y' : C} (i : A βΆ B) {p : X βΆ Y} {p' : X' βΆ Y'}
(e : Arrow.mk p β
Arrow.mk p') [hip : HasLiftingProperty i p] : HasLiftingProperty i p' := by
rw [Arrow.iso_w' e]
infer_instance
#align category_theory.has_lifting_property.of_arrow_iso_right CategoryTheory.HasLiftingProperty.of_arrow_iso_right
| Mathlib/CategoryTheory/LiftingProperties/Basic.lean | 134 | 138 | theorem iff_of_arrow_iso_left {A B A' B' X Y : C} {i : A βΆ B} {i' : A' βΆ B'}
(e : Arrow.mk i β
Arrow.mk i') (p : X βΆ Y) :
HasLiftingProperty i p β HasLiftingProperty i' p := by |
constructor <;> intro
exacts [of_arrow_iso_left e p, of_arrow_iso_left e.symm p]
| 2 | 7.389056 | 1 | 1 | 3 | 916 |
import Mathlib.Analysis.MeanInequalities
import Mathlib.Data.Fintype.Order
import Mathlib.LinearAlgebra.Matrix.Basis
import Mathlib.Analysis.NormedSpace.WithLp
#align_import analysis.normed_space.pi_Lp from "leanprover-community/mathlib"@"9d013ad8430ddddd350cff5c3db830278ded3c79"
set_option linter.uppercaseLean3 false
open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal
noncomputable section
abbrev PiLp (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) : Type _ :=
WithLp p (β i : ΞΉ, Ξ± i)
#align pi_Lp PiLp
instance (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) : CoeFun (PiLp p Ξ±) (fun _ β¦ (i : ΞΉ) β Ξ± i) where
coe := WithLp.equiv p _
instance (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) [β i, Inhabited (Ξ± i)] : Inhabited (PiLp p Ξ±) :=
β¨fun _ => defaultβ©
@[ext] -- Porting note (#10756): new lemma
protected theorem PiLp.ext {p : ββ₯0β} {ΞΉ : Type*} {Ξ± : ΞΉ β Type*} {x y : PiLp p Ξ±}
(h : β i, x i = y i) : x = y := funext h
namespace PiLp
variable (p : ββ₯0β) (π : Type*) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) (Ξ² : ΞΉ β Type*)
section
variable {π p Ξ±}
variable [SeminormedRing π] [β i, SeminormedAddCommGroup (Ξ² i)]
variable [β i, Module π (Ξ² i)] [β i, BoundedSMul π (Ξ² i)] (c : π)
variable (x y : PiLp p Ξ²) (i : ΞΉ)
@[simp]
theorem zero_apply : (0 : PiLp p Ξ²) i = 0 :=
rfl
#align pi_Lp.zero_apply PiLp.zero_apply
@[simp]
theorem add_apply : (x + y) i = x i + y i :=
rfl
#align pi_Lp.add_apply PiLp.add_apply
@[simp]
theorem sub_apply : (x - y) i = x i - y i :=
rfl
#align pi_Lp.sub_apply PiLp.sub_apply
@[simp]
theorem smul_apply : (c β’ x) i = c β’ x i :=
rfl
#align pi_Lp.smul_apply PiLp.smul_apply
@[simp]
theorem neg_apply : (-x) i = -x i :=
rfl
#align pi_Lp.neg_apply PiLp.neg_apply
end
@[simp]
theorem _root_.WithLp.equiv_pi_apply (x : PiLp p Ξ±) (i : ΞΉ) : WithLp.equiv p _ x i = x i :=
rfl
#align pi_Lp.equiv_apply WithLp.equiv_pi_apply
@[simp]
theorem _root_.WithLp.equiv_symm_pi_apply (x : β i, Ξ± i) (i : ΞΉ) :
(WithLp.equiv p _).symm x i = x i :=
rfl
#align pi_Lp.equiv_symm_apply WithLp.equiv_symm_pi_apply
section DistNorm
variable [Fintype ΞΉ]
section Edist
variable [β i, EDist (Ξ² i)]
instance : EDist (PiLp p Ξ²) where
edist f g :=
if p = 0 then {i | edist (f i) (g i) β 0}.toFinite.toFinset.card
else
if p = β then β¨ i, edist (f i) (g i) else (β i, edist (f i) (g i) ^ p.toReal) ^ (1 / p.toReal)
variable {Ξ²}
theorem edist_eq_card (f g : PiLp 0 Ξ²) :
edist f g = {i | edist (f i) (g i) β 0}.toFinite.toFinset.card :=
if_pos rfl
#align pi_Lp.edist_eq_card PiLp.edist_eq_card
theorem edist_eq_sum {p : ββ₯0β} (hp : 0 < p.toReal) (f g : PiLp p Ξ²) :
edist f g = (β i, edist (f i) (g i) ^ p.toReal) ^ (1 / p.toReal) :=
let hp' := ENNReal.toReal_pos_iff.mp hp
(if_neg hp'.1.ne').trans (if_neg hp'.2.ne)
#align pi_Lp.edist_eq_sum PiLp.edist_eq_sum
| Mathlib/Analysis/NormedSpace/PiLp.lean | 185 | 187 | theorem edist_eq_iSup (f g : PiLp β Ξ²) : edist f g = β¨ i, edist (f i) (g i) := by |
dsimp [edist]
exact if_neg ENNReal.top_ne_zero
| 2 | 7.389056 | 1 | 1 | 3 | 917 |
import Mathlib.Analysis.MeanInequalities
import Mathlib.Data.Fintype.Order
import Mathlib.LinearAlgebra.Matrix.Basis
import Mathlib.Analysis.NormedSpace.WithLp
#align_import analysis.normed_space.pi_Lp from "leanprover-community/mathlib"@"9d013ad8430ddddd350cff5c3db830278ded3c79"
set_option linter.uppercaseLean3 false
open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal
noncomputable section
abbrev PiLp (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) : Type _ :=
WithLp p (β i : ΞΉ, Ξ± i)
#align pi_Lp PiLp
instance (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) : CoeFun (PiLp p Ξ±) (fun _ β¦ (i : ΞΉ) β Ξ± i) where
coe := WithLp.equiv p _
instance (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) [β i, Inhabited (Ξ± i)] : Inhabited (PiLp p Ξ±) :=
β¨fun _ => defaultβ©
@[ext] -- Porting note (#10756): new lemma
protected theorem PiLp.ext {p : ββ₯0β} {ΞΉ : Type*} {Ξ± : ΞΉ β Type*} {x y : PiLp p Ξ±}
(h : β i, x i = y i) : x = y := funext h
namespace PiLp
variable (p : ββ₯0β) (π : Type*) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) (Ξ² : ΞΉ β Type*)
section
variable {π p Ξ±}
variable [SeminormedRing π] [β i, SeminormedAddCommGroup (Ξ² i)]
variable [β i, Module π (Ξ² i)] [β i, BoundedSMul π (Ξ² i)] (c : π)
variable (x y : PiLp p Ξ²) (i : ΞΉ)
@[simp]
theorem zero_apply : (0 : PiLp p Ξ²) i = 0 :=
rfl
#align pi_Lp.zero_apply PiLp.zero_apply
@[simp]
theorem add_apply : (x + y) i = x i + y i :=
rfl
#align pi_Lp.add_apply PiLp.add_apply
@[simp]
theorem sub_apply : (x - y) i = x i - y i :=
rfl
#align pi_Lp.sub_apply PiLp.sub_apply
@[simp]
theorem smul_apply : (c β’ x) i = c β’ x i :=
rfl
#align pi_Lp.smul_apply PiLp.smul_apply
@[simp]
theorem neg_apply : (-x) i = -x i :=
rfl
#align pi_Lp.neg_apply PiLp.neg_apply
end
@[simp]
theorem _root_.WithLp.equiv_pi_apply (x : PiLp p Ξ±) (i : ΞΉ) : WithLp.equiv p _ x i = x i :=
rfl
#align pi_Lp.equiv_apply WithLp.equiv_pi_apply
@[simp]
theorem _root_.WithLp.equiv_symm_pi_apply (x : β i, Ξ± i) (i : ΞΉ) :
(WithLp.equiv p _).symm x i = x i :=
rfl
#align pi_Lp.equiv_symm_apply WithLp.equiv_symm_pi_apply
section DistNorm
variable [Fintype ΞΉ]
section Dist
variable [β i, Dist (Ξ± i)]
instance : Dist (PiLp p Ξ±) where
dist f g :=
if p = 0 then {i | dist (f i) (g i) β 0}.toFinite.toFinset.card
else
if p = β then β¨ i, dist (f i) (g i) else (β i, dist (f i) (g i) ^ p.toReal) ^ (1 / p.toReal)
variable {Ξ±}
theorem dist_eq_card (f g : PiLp 0 Ξ±) :
dist f g = {i | dist (f i) (g i) β 0}.toFinite.toFinset.card :=
if_pos rfl
#align pi_Lp.dist_eq_card PiLp.dist_eq_card
theorem dist_eq_sum {p : ββ₯0β} (hp : 0 < p.toReal) (f g : PiLp p Ξ±) :
dist f g = (β i, dist (f i) (g i) ^ p.toReal) ^ (1 / p.toReal) :=
let hp' := ENNReal.toReal_pos_iff.mp hp
(if_neg hp'.1.ne').trans (if_neg hp'.2.ne)
#align pi_Lp.dist_eq_sum PiLp.dist_eq_sum
| Mathlib/Analysis/NormedSpace/PiLp.lean | 247 | 249 | theorem dist_eq_iSup (f g : PiLp β Ξ±) : dist f g = β¨ i, dist (f i) (g i) := by |
dsimp [dist]
exact if_neg ENNReal.top_ne_zero
| 2 | 7.389056 | 1 | 1 | 3 | 917 |
import Mathlib.Analysis.MeanInequalities
import Mathlib.Data.Fintype.Order
import Mathlib.LinearAlgebra.Matrix.Basis
import Mathlib.Analysis.NormedSpace.WithLp
#align_import analysis.normed_space.pi_Lp from "leanprover-community/mathlib"@"9d013ad8430ddddd350cff5c3db830278ded3c79"
set_option linter.uppercaseLean3 false
open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal
noncomputable section
abbrev PiLp (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) : Type _ :=
WithLp p (β i : ΞΉ, Ξ± i)
#align pi_Lp PiLp
instance (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) : CoeFun (PiLp p Ξ±) (fun _ β¦ (i : ΞΉ) β Ξ± i) where
coe := WithLp.equiv p _
instance (p : ββ₯0β) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) [β i, Inhabited (Ξ± i)] : Inhabited (PiLp p Ξ±) :=
β¨fun _ => defaultβ©
@[ext] -- Porting note (#10756): new lemma
protected theorem PiLp.ext {p : ββ₯0β} {ΞΉ : Type*} {Ξ± : ΞΉ β Type*} {x y : PiLp p Ξ±}
(h : β i, x i = y i) : x = y := funext h
namespace PiLp
variable (p : ββ₯0β) (π : Type*) {ΞΉ : Type*} (Ξ± : ΞΉ β Type*) (Ξ² : ΞΉ β Type*)
section
variable {π p Ξ±}
variable [SeminormedRing π] [β i, SeminormedAddCommGroup (Ξ² i)]
variable [β i, Module π (Ξ² i)] [β i, BoundedSMul π (Ξ² i)] (c : π)
variable (x y : PiLp p Ξ²) (i : ΞΉ)
@[simp]
theorem zero_apply : (0 : PiLp p Ξ²) i = 0 :=
rfl
#align pi_Lp.zero_apply PiLp.zero_apply
@[simp]
theorem add_apply : (x + y) i = x i + y i :=
rfl
#align pi_Lp.add_apply PiLp.add_apply
@[simp]
theorem sub_apply : (x - y) i = x i - y i :=
rfl
#align pi_Lp.sub_apply PiLp.sub_apply
@[simp]
theorem smul_apply : (c β’ x) i = c β’ x i :=
rfl
#align pi_Lp.smul_apply PiLp.smul_apply
@[simp]
theorem neg_apply : (-x) i = -x i :=
rfl
#align pi_Lp.neg_apply PiLp.neg_apply
end
@[simp]
theorem _root_.WithLp.equiv_pi_apply (x : PiLp p Ξ±) (i : ΞΉ) : WithLp.equiv p _ x i = x i :=
rfl
#align pi_Lp.equiv_apply WithLp.equiv_pi_apply
@[simp]
theorem _root_.WithLp.equiv_symm_pi_apply (x : β i, Ξ± i) (i : ΞΉ) :
(WithLp.equiv p _).symm x i = x i :=
rfl
#align pi_Lp.equiv_symm_apply WithLp.equiv_symm_pi_apply
section DistNorm
variable [Fintype ΞΉ]
section Norm
variable [β i, Norm (Ξ² i)]
instance instNorm : Norm (PiLp p Ξ²) where
norm f :=
if p = 0 then {i | βf iβ β 0}.toFinite.toFinset.card
else if p = β then β¨ i, βf iβ else (β i, βf iβ ^ p.toReal) ^ (1 / p.toReal)
#align pi_Lp.has_norm PiLp.instNorm
variable {p Ξ²}
theorem norm_eq_card (f : PiLp 0 Ξ²) : βfβ = {i | βf iβ β 0}.toFinite.toFinset.card :=
if_pos rfl
#align pi_Lp.norm_eq_card PiLp.norm_eq_card
| Mathlib/Analysis/NormedSpace/PiLp.lean | 276 | 278 | theorem norm_eq_ciSup (f : PiLp β Ξ²) : βfβ = β¨ i, βf iβ := by |
dsimp [Norm.norm]
exact if_neg ENNReal.top_ne_zero
| 2 | 7.389056 | 1 | 1 | 3 | 917 |
import Mathlib.Combinatorics.SimpleGraph.Subgraph
import Mathlib.Data.List.Rotate
#align_import combinatorics.simple_graph.connectivity from "leanprover-community/mathlib"@"b99e2d58a5e6861833fa8de11e51a81144258db4"
open Function
universe u v w
namespace SimpleGraph
variable {V : Type u} {V' : Type v} {V'' : Type w}
variable (G : SimpleGraph V) (G' : SimpleGraph V') (G'' : SimpleGraph V'')
inductive Walk : V β V β Type u
| nil {u : V} : Walk u u
| cons {u v w : V} (h : G.Adj u v) (p : Walk v w) : Walk u w
deriving DecidableEq
#align simple_graph.walk SimpleGraph.Walk
attribute [refl] Walk.nil
@[simps]
instance Walk.instInhabited (v : V) : Inhabited (G.Walk v v) := β¨Walk.nilβ©
#align simple_graph.walk.inhabited SimpleGraph.Walk.instInhabited
@[match_pattern, reducible]
def Adj.toWalk {G : SimpleGraph V} {u v : V} (h : G.Adj u v) : G.Walk u v :=
Walk.cons h Walk.nil
#align simple_graph.adj.to_walk SimpleGraph.Adj.toWalk
namespace Walk
variable {G}
@[match_pattern]
abbrev nil' (u : V) : G.Walk u u := Walk.nil
#align simple_graph.walk.nil' SimpleGraph.Walk.nil'
@[match_pattern]
abbrev cons' (u v w : V) (h : G.Adj u v) (p : G.Walk v w) : G.Walk u w := Walk.cons h p
#align simple_graph.walk.cons' SimpleGraph.Walk.cons'
protected def copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') : G.Walk u' v' :=
hu βΈ hv βΈ p
#align simple_graph.walk.copy SimpleGraph.Walk.copy
@[simp]
theorem copy_rfl_rfl {u v} (p : G.Walk u v) : p.copy rfl rfl = p := rfl
#align simple_graph.walk.copy_rfl_rfl SimpleGraph.Walk.copy_rfl_rfl
@[simp]
| Mathlib/Combinatorics/SimpleGraph/Connectivity.lean | 133 | 137 | theorem copy_copy {u v u' v' u'' v''} (p : G.Walk u v)
(hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
(p.copy hu hv).copy hu' hv' = p.copy (hu.trans hu') (hv.trans hv') := by |
subst_vars
rfl
| 2 | 7.389056 | 1 | 1 | 6 | 918 |
import Mathlib.Combinatorics.SimpleGraph.Subgraph
import Mathlib.Data.List.Rotate
#align_import combinatorics.simple_graph.connectivity from "leanprover-community/mathlib"@"b99e2d58a5e6861833fa8de11e51a81144258db4"
open Function
universe u v w
namespace SimpleGraph
variable {V : Type u} {V' : Type v} {V'' : Type w}
variable (G : SimpleGraph V) (G' : SimpleGraph V') (G'' : SimpleGraph V'')
inductive Walk : V β V β Type u
| nil {u : V} : Walk u u
| cons {u v w : V} (h : G.Adj u v) (p : Walk v w) : Walk u w
deriving DecidableEq
#align simple_graph.walk SimpleGraph.Walk
attribute [refl] Walk.nil
@[simps]
instance Walk.instInhabited (v : V) : Inhabited (G.Walk v v) := β¨Walk.nilβ©
#align simple_graph.walk.inhabited SimpleGraph.Walk.instInhabited
@[match_pattern, reducible]
def Adj.toWalk {G : SimpleGraph V} {u v : V} (h : G.Adj u v) : G.Walk u v :=
Walk.cons h Walk.nil
#align simple_graph.adj.to_walk SimpleGraph.Adj.toWalk
namespace Walk
variable {G}
@[match_pattern]
abbrev nil' (u : V) : G.Walk u u := Walk.nil
#align simple_graph.walk.nil' SimpleGraph.Walk.nil'
@[match_pattern]
abbrev cons' (u v w : V) (h : G.Adj u v) (p : G.Walk v w) : G.Walk u w := Walk.cons h p
#align simple_graph.walk.cons' SimpleGraph.Walk.cons'
protected def copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') : G.Walk u' v' :=
hu βΈ hv βΈ p
#align simple_graph.walk.copy SimpleGraph.Walk.copy
@[simp]
theorem copy_rfl_rfl {u v} (p : G.Walk u v) : p.copy rfl rfl = p := rfl
#align simple_graph.walk.copy_rfl_rfl SimpleGraph.Walk.copy_rfl_rfl
@[simp]
theorem copy_copy {u v u' v' u'' v''} (p : G.Walk u v)
(hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
(p.copy hu hv).copy hu' hv' = p.copy (hu.trans hu') (hv.trans hv') := by
subst_vars
rfl
#align simple_graph.walk.copy_copy SimpleGraph.Walk.copy_copy
@[simp]
| Mathlib/Combinatorics/SimpleGraph/Connectivity.lean | 141 | 143 | theorem copy_nil {u u'} (hu : u = u') : (Walk.nil : G.Walk u u).copy hu hu = Walk.nil := by |
subst_vars
rfl
| 2 | 7.389056 | 1 | 1 | 6 | 918 |
import Mathlib.Combinatorics.SimpleGraph.Subgraph
import Mathlib.Data.List.Rotate
#align_import combinatorics.simple_graph.connectivity from "leanprover-community/mathlib"@"b99e2d58a5e6861833fa8de11e51a81144258db4"
open Function
universe u v w
namespace SimpleGraph
variable {V : Type u} {V' : Type v} {V'' : Type w}
variable (G : SimpleGraph V) (G' : SimpleGraph V') (G'' : SimpleGraph V'')
inductive Walk : V β V β Type u
| nil {u : V} : Walk u u
| cons {u v w : V} (h : G.Adj u v) (p : Walk v w) : Walk u w
deriving DecidableEq
#align simple_graph.walk SimpleGraph.Walk
attribute [refl] Walk.nil
@[simps]
instance Walk.instInhabited (v : V) : Inhabited (G.Walk v v) := β¨Walk.nilβ©
#align simple_graph.walk.inhabited SimpleGraph.Walk.instInhabited
@[match_pattern, reducible]
def Adj.toWalk {G : SimpleGraph V} {u v : V} (h : G.Adj u v) : G.Walk u v :=
Walk.cons h Walk.nil
#align simple_graph.adj.to_walk SimpleGraph.Adj.toWalk
namespace Walk
variable {G}
@[match_pattern]
abbrev nil' (u : V) : G.Walk u u := Walk.nil
#align simple_graph.walk.nil' SimpleGraph.Walk.nil'
@[match_pattern]
abbrev cons' (u v w : V) (h : G.Adj u v) (p : G.Walk v w) : G.Walk u w := Walk.cons h p
#align simple_graph.walk.cons' SimpleGraph.Walk.cons'
protected def copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') : G.Walk u' v' :=
hu βΈ hv βΈ p
#align simple_graph.walk.copy SimpleGraph.Walk.copy
@[simp]
theorem copy_rfl_rfl {u v} (p : G.Walk u v) : p.copy rfl rfl = p := rfl
#align simple_graph.walk.copy_rfl_rfl SimpleGraph.Walk.copy_rfl_rfl
@[simp]
theorem copy_copy {u v u' v' u'' v''} (p : G.Walk u v)
(hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
(p.copy hu hv).copy hu' hv' = p.copy (hu.trans hu') (hv.trans hv') := by
subst_vars
rfl
#align simple_graph.walk.copy_copy SimpleGraph.Walk.copy_copy
@[simp]
theorem copy_nil {u u'} (hu : u = u') : (Walk.nil : G.Walk u u).copy hu hu = Walk.nil := by
subst_vars
rfl
#align simple_graph.walk.copy_nil SimpleGraph.Walk.copy_nil
| Mathlib/Combinatorics/SimpleGraph/Connectivity.lean | 146 | 149 | theorem copy_cons {u v w u' w'} (h : G.Adj u v) (p : G.Walk v w) (hu : u = u') (hw : w = w') :
(Walk.cons h p).copy hu hw = Walk.cons (hu βΈ h) (p.copy rfl hw) := by |
subst_vars
rfl
| 2 | 7.389056 | 1 | 1 | 6 | 918 |
import Mathlib.Combinatorics.SimpleGraph.Subgraph
import Mathlib.Data.List.Rotate
#align_import combinatorics.simple_graph.connectivity from "leanprover-community/mathlib"@"b99e2d58a5e6861833fa8de11e51a81144258db4"
open Function
universe u v w
namespace SimpleGraph
variable {V : Type u} {V' : Type v} {V'' : Type w}
variable (G : SimpleGraph V) (G' : SimpleGraph V') (G'' : SimpleGraph V'')
inductive Walk : V β V β Type u
| nil {u : V} : Walk u u
| cons {u v w : V} (h : G.Adj u v) (p : Walk v w) : Walk u w
deriving DecidableEq
#align simple_graph.walk SimpleGraph.Walk
attribute [refl] Walk.nil
@[simps]
instance Walk.instInhabited (v : V) : Inhabited (G.Walk v v) := β¨Walk.nilβ©
#align simple_graph.walk.inhabited SimpleGraph.Walk.instInhabited
@[match_pattern, reducible]
def Adj.toWalk {G : SimpleGraph V} {u v : V} (h : G.Adj u v) : G.Walk u v :=
Walk.cons h Walk.nil
#align simple_graph.adj.to_walk SimpleGraph.Adj.toWalk
namespace Walk
variable {G}
@[match_pattern]
abbrev nil' (u : V) : G.Walk u u := Walk.nil
#align simple_graph.walk.nil' SimpleGraph.Walk.nil'
@[match_pattern]
abbrev cons' (u v w : V) (h : G.Adj u v) (p : G.Walk v w) : G.Walk u w := Walk.cons h p
#align simple_graph.walk.cons' SimpleGraph.Walk.cons'
protected def copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') : G.Walk u' v' :=
hu βΈ hv βΈ p
#align simple_graph.walk.copy SimpleGraph.Walk.copy
@[simp]
theorem copy_rfl_rfl {u v} (p : G.Walk u v) : p.copy rfl rfl = p := rfl
#align simple_graph.walk.copy_rfl_rfl SimpleGraph.Walk.copy_rfl_rfl
@[simp]
theorem copy_copy {u v u' v' u'' v''} (p : G.Walk u v)
(hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
(p.copy hu hv).copy hu' hv' = p.copy (hu.trans hu') (hv.trans hv') := by
subst_vars
rfl
#align simple_graph.walk.copy_copy SimpleGraph.Walk.copy_copy
@[simp]
theorem copy_nil {u u'} (hu : u = u') : (Walk.nil : G.Walk u u).copy hu hu = Walk.nil := by
subst_vars
rfl
#align simple_graph.walk.copy_nil SimpleGraph.Walk.copy_nil
theorem copy_cons {u v w u' w'} (h : G.Adj u v) (p : G.Walk v w) (hu : u = u') (hw : w = w') :
(Walk.cons h p).copy hu hw = Walk.cons (hu βΈ h) (p.copy rfl hw) := by
subst_vars
rfl
#align simple_graph.walk.copy_cons SimpleGraph.Walk.copy_cons
@[simp]
| Mathlib/Combinatorics/SimpleGraph/Connectivity.lean | 153 | 156 | theorem cons_copy {u v w v' w'} (h : G.Adj u v) (p : G.Walk v' w') (hv : v' = v) (hw : w' = w) :
Walk.cons h (p.copy hv hw) = (Walk.cons (hv βΈ h) p).copy rfl hw := by |
subst_vars
rfl
| 2 | 7.389056 | 1 | 1 | 6 | 918 |
import Mathlib.Combinatorics.SimpleGraph.Subgraph
import Mathlib.Data.List.Rotate
#align_import combinatorics.simple_graph.connectivity from "leanprover-community/mathlib"@"b99e2d58a5e6861833fa8de11e51a81144258db4"
open Function
universe u v w
namespace SimpleGraph
variable {V : Type u} {V' : Type v} {V'' : Type w}
variable (G : SimpleGraph V) (G' : SimpleGraph V') (G'' : SimpleGraph V'')
inductive Walk : V β V β Type u
| nil {u : V} : Walk u u
| cons {u v w : V} (h : G.Adj u v) (p : Walk v w) : Walk u w
deriving DecidableEq
#align simple_graph.walk SimpleGraph.Walk
attribute [refl] Walk.nil
@[simps]
instance Walk.instInhabited (v : V) : Inhabited (G.Walk v v) := β¨Walk.nilβ©
#align simple_graph.walk.inhabited SimpleGraph.Walk.instInhabited
@[match_pattern, reducible]
def Adj.toWalk {G : SimpleGraph V} {u v : V} (h : G.Adj u v) : G.Walk u v :=
Walk.cons h Walk.nil
#align simple_graph.adj.to_walk SimpleGraph.Adj.toWalk
namespace Walk
variable {G}
@[match_pattern]
abbrev nil' (u : V) : G.Walk u u := Walk.nil
#align simple_graph.walk.nil' SimpleGraph.Walk.nil'
@[match_pattern]
abbrev cons' (u v w : V) (h : G.Adj u v) (p : G.Walk v w) : G.Walk u w := Walk.cons h p
#align simple_graph.walk.cons' SimpleGraph.Walk.cons'
protected def copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') : G.Walk u' v' :=
hu βΈ hv βΈ p
#align simple_graph.walk.copy SimpleGraph.Walk.copy
@[simp]
theorem copy_rfl_rfl {u v} (p : G.Walk u v) : p.copy rfl rfl = p := rfl
#align simple_graph.walk.copy_rfl_rfl SimpleGraph.Walk.copy_rfl_rfl
@[simp]
theorem copy_copy {u v u' v' u'' v''} (p : G.Walk u v)
(hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
(p.copy hu hv).copy hu' hv' = p.copy (hu.trans hu') (hv.trans hv') := by
subst_vars
rfl
#align simple_graph.walk.copy_copy SimpleGraph.Walk.copy_copy
@[simp]
theorem copy_nil {u u'} (hu : u = u') : (Walk.nil : G.Walk u u).copy hu hu = Walk.nil := by
subst_vars
rfl
#align simple_graph.walk.copy_nil SimpleGraph.Walk.copy_nil
theorem copy_cons {u v w u' w'} (h : G.Adj u v) (p : G.Walk v w) (hu : u = u') (hw : w = w') :
(Walk.cons h p).copy hu hw = Walk.cons (hu βΈ h) (p.copy rfl hw) := by
subst_vars
rfl
#align simple_graph.walk.copy_cons SimpleGraph.Walk.copy_cons
@[simp]
theorem cons_copy {u v w v' w'} (h : G.Adj u v) (p : G.Walk v' w') (hv : v' = v) (hw : w' = w) :
Walk.cons h (p.copy hv hw) = (Walk.cons (hv βΈ h) p).copy rfl hw := by
subst_vars
rfl
#align simple_graph.walk.cons_copy SimpleGraph.Walk.cons_copy
theorem exists_eq_cons_of_ne {u v : V} (hne : u β v) :
β (p : G.Walk u v), β (w : V) (h : G.Adj u w) (p' : G.Walk w v), p = cons h p'
| nil => (hne rfl).elim
| cons h p' => β¨_, h, p', rflβ©
#align simple_graph.walk.exists_eq_cons_of_ne SimpleGraph.Walk.exists_eq_cons_of_ne
def length {u v : V} : G.Walk u v β β
| nil => 0
| cons _ q => q.length.succ
#align simple_graph.walk.length SimpleGraph.Walk.length
@[trans]
def append {u v w : V} : G.Walk u v β G.Walk v w β G.Walk u w
| nil, q => q
| cons h p, q => cons h (p.append q)
#align simple_graph.walk.append SimpleGraph.Walk.append
def concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) : G.Walk u w := p.append (cons h nil)
#align simple_graph.walk.concat SimpleGraph.Walk.concat
theorem concat_eq_append {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
p.concat h = p.append (cons h nil) := rfl
#align simple_graph.walk.concat_eq_append SimpleGraph.Walk.concat_eq_append
protected def reverseAux {u v w : V} : G.Walk u v β G.Walk u w β G.Walk v w
| nil, q => q
| cons h p, q => Walk.reverseAux p (cons (G.symm h) q)
#align simple_graph.walk.reverse_aux SimpleGraph.Walk.reverseAux
@[symm]
def reverse {u v : V} (w : G.Walk u v) : G.Walk v u := w.reverseAux nil
#align simple_graph.walk.reverse SimpleGraph.Walk.reverse
def getVert {u v : V} : G.Walk u v β β β V
| nil, _ => u
| cons _ _, 0 => u
| cons _ q, n + 1 => q.getVert n
#align simple_graph.walk.get_vert SimpleGraph.Walk.getVert
@[simp]
| Mathlib/Combinatorics/SimpleGraph/Connectivity.lean | 208 | 208 | theorem getVert_zero {u v} (w : G.Walk u v) : w.getVert 0 = u := by | cases w <;> rfl
| 1 | 2.718282 | 0 | 1 | 6 | 918 |
import Mathlib.Combinatorics.SimpleGraph.Subgraph
import Mathlib.Data.List.Rotate
#align_import combinatorics.simple_graph.connectivity from "leanprover-community/mathlib"@"b99e2d58a5e6861833fa8de11e51a81144258db4"
open Function
universe u v w
namespace SimpleGraph
variable {V : Type u} {V' : Type v} {V'' : Type w}
variable (G : SimpleGraph V) (G' : SimpleGraph V') (G'' : SimpleGraph V'')
inductive Walk : V β V β Type u
| nil {u : V} : Walk u u
| cons {u v w : V} (h : G.Adj u v) (p : Walk v w) : Walk u w
deriving DecidableEq
#align simple_graph.walk SimpleGraph.Walk
attribute [refl] Walk.nil
@[simps]
instance Walk.instInhabited (v : V) : Inhabited (G.Walk v v) := β¨Walk.nilβ©
#align simple_graph.walk.inhabited SimpleGraph.Walk.instInhabited
@[match_pattern, reducible]
def Adj.toWalk {G : SimpleGraph V} {u v : V} (h : G.Adj u v) : G.Walk u v :=
Walk.cons h Walk.nil
#align simple_graph.adj.to_walk SimpleGraph.Adj.toWalk
namespace Walk
variable {G}
@[match_pattern]
abbrev nil' (u : V) : G.Walk u u := Walk.nil
#align simple_graph.walk.nil' SimpleGraph.Walk.nil'
@[match_pattern]
abbrev cons' (u v w : V) (h : G.Adj u v) (p : G.Walk v w) : G.Walk u w := Walk.cons h p
#align simple_graph.walk.cons' SimpleGraph.Walk.cons'
protected def copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') : G.Walk u' v' :=
hu βΈ hv βΈ p
#align simple_graph.walk.copy SimpleGraph.Walk.copy
@[simp]
theorem copy_rfl_rfl {u v} (p : G.Walk u v) : p.copy rfl rfl = p := rfl
#align simple_graph.walk.copy_rfl_rfl SimpleGraph.Walk.copy_rfl_rfl
@[simp]
theorem copy_copy {u v u' v' u'' v''} (p : G.Walk u v)
(hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') :
(p.copy hu hv).copy hu' hv' = p.copy (hu.trans hu') (hv.trans hv') := by
subst_vars
rfl
#align simple_graph.walk.copy_copy SimpleGraph.Walk.copy_copy
@[simp]
theorem copy_nil {u u'} (hu : u = u') : (Walk.nil : G.Walk u u).copy hu hu = Walk.nil := by
subst_vars
rfl
#align simple_graph.walk.copy_nil SimpleGraph.Walk.copy_nil
theorem copy_cons {u v w u' w'} (h : G.Adj u v) (p : G.Walk v w) (hu : u = u') (hw : w = w') :
(Walk.cons h p).copy hu hw = Walk.cons (hu βΈ h) (p.copy rfl hw) := by
subst_vars
rfl
#align simple_graph.walk.copy_cons SimpleGraph.Walk.copy_cons
@[simp]
theorem cons_copy {u v w v' w'} (h : G.Adj u v) (p : G.Walk v' w') (hv : v' = v) (hw : w' = w) :
Walk.cons h (p.copy hv hw) = (Walk.cons (hv βΈ h) p).copy rfl hw := by
subst_vars
rfl
#align simple_graph.walk.cons_copy SimpleGraph.Walk.cons_copy
theorem exists_eq_cons_of_ne {u v : V} (hne : u β v) :
β (p : G.Walk u v), β (w : V) (h : G.Adj u w) (p' : G.Walk w v), p = cons h p'
| nil => (hne rfl).elim
| cons h p' => β¨_, h, p', rflβ©
#align simple_graph.walk.exists_eq_cons_of_ne SimpleGraph.Walk.exists_eq_cons_of_ne
def length {u v : V} : G.Walk u v β β
| nil => 0
| cons _ q => q.length.succ
#align simple_graph.walk.length SimpleGraph.Walk.length
@[trans]
def append {u v w : V} : G.Walk u v β G.Walk v w β G.Walk u w
| nil, q => q
| cons h p, q => cons h (p.append q)
#align simple_graph.walk.append SimpleGraph.Walk.append
def concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) : G.Walk u w := p.append (cons h nil)
#align simple_graph.walk.concat SimpleGraph.Walk.concat
theorem concat_eq_append {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
p.concat h = p.append (cons h nil) := rfl
#align simple_graph.walk.concat_eq_append SimpleGraph.Walk.concat_eq_append
protected def reverseAux {u v w : V} : G.Walk u v β G.Walk u w β G.Walk v w
| nil, q => q
| cons h p, q => Walk.reverseAux p (cons (G.symm h) q)
#align simple_graph.walk.reverse_aux SimpleGraph.Walk.reverseAux
@[symm]
def reverse {u v : V} (w : G.Walk u v) : G.Walk v u := w.reverseAux nil
#align simple_graph.walk.reverse SimpleGraph.Walk.reverse
def getVert {u v : V} : G.Walk u v β β β V
| nil, _ => u
| cons _ _, 0 => u
| cons _ q, n + 1 => q.getVert n
#align simple_graph.walk.get_vert SimpleGraph.Walk.getVert
@[simp]
theorem getVert_zero {u v} (w : G.Walk u v) : w.getVert 0 = u := by cases w <;> rfl
#align simple_graph.walk.get_vert_zero SimpleGraph.Walk.getVert_zero
| Mathlib/Combinatorics/SimpleGraph/Connectivity.lean | 211 | 218 | theorem getVert_of_length_le {u v} (w : G.Walk u v) {i : β} (hi : w.length β€ i) :
w.getVert i = v := by |
induction w generalizing i with
| nil => rfl
| cons _ _ ih =>
cases i
Β· cases hi
Β· exact ih (Nat.succ_le_succ_iff.1 hi)
| 6 | 403.428793 | 2 | 1 | 6 | 918 |
import Mathlib.Algebra.Field.Defs
import Mathlib.Algebra.Ring.Int
#align_import algebra.field.power from "leanprover-community/mathlib"@"1e05171a5e8cf18d98d9cf7b207540acb044acae"
variable {Ξ± : Type*}
section DivisionRing
variable [DivisionRing Ξ±] {n : β€}
| Mathlib/Algebra/Field/Power.lean | 26 | 30 | theorem Odd.neg_zpow (h : Odd n) (a : Ξ±) : (-a) ^ n = -a ^ n := by |
have hn : n β 0 := by rintro rfl; exact Int.odd_iff_not_even.1 h even_zero
obtain β¨k, rflβ© := h
simp_rw [zpow_add' (.inr (.inl hn)), zpow_one, zpow_mul, zpow_two, neg_mul_neg,
neg_mul_eq_mul_neg]
| 4 | 54.59815 | 2 | 1 | 2 | 919 |
import Mathlib.Algebra.Field.Defs
import Mathlib.Algebra.Ring.Int
#align_import algebra.field.power from "leanprover-community/mathlib"@"1e05171a5e8cf18d98d9cf7b207540acb044acae"
variable {Ξ± : Type*}
section DivisionRing
variable [DivisionRing Ξ±] {n : β€}
theorem Odd.neg_zpow (h : Odd n) (a : Ξ±) : (-a) ^ n = -a ^ n := by
have hn : n β 0 := by rintro rfl; exact Int.odd_iff_not_even.1 h even_zero
obtain β¨k, rflβ© := h
simp_rw [zpow_add' (.inr (.inl hn)), zpow_one, zpow_mul, zpow_two, neg_mul_neg,
neg_mul_eq_mul_neg]
#align odd.neg_zpow Odd.neg_zpow
| Mathlib/Algebra/Field/Power.lean | 33 | 33 | theorem Odd.neg_one_zpow (h : Odd n) : (-1 : Ξ±) ^ n = -1 := by | rw [h.neg_zpow, one_zpow]
| 1 | 2.718282 | 0 | 1 | 2 | 919 |
import Mathlib.RingTheory.MvPowerSeries.Basic
import Mathlib.RingTheory.Ideal.LocalRing
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
section Ring
variable [Ring R]
protected noncomputable def inv.aux (a : R) (Ο : MvPowerSeries Ο R) : MvPowerSeries Ο R
| n =>
letI := Classical.decEq Ο
if n = 0 then a
else
-a *
β x β antidiagonal n, if _ : x.2 < n then coeff R x.1 Ο * inv.aux a Ο x.2 else 0
termination_by n => n
#align mv_power_series.inv.aux MvPowerSeries.inv.aux
theorem coeff_inv_aux [DecidableEq Ο] (n : Ο ββ β) (a : R) (Ο : MvPowerSeries Ο R) :
coeff R n (inv.aux a Ο) =
if n = 0 then a
else
-a *
β x β antidiagonal n, if x.2 < n then coeff R x.1 Ο * coeff R x.2 (inv.aux a Ο) else 0 :=
show inv.aux a Ο n = _ by
cases Subsingleton.elim βΉDecidableEq ΟβΊ (Classical.decEq Ο)
rw [inv.aux]
rfl
#align mv_power_series.coeff_inv_aux MvPowerSeries.coeff_inv_aux
def invOfUnit (Ο : MvPowerSeries Ο R) (u : RΛ£) : MvPowerSeries Ο R :=
inv.aux (βuβ»ΒΉ) Ο
#align mv_power_series.inv_of_unit MvPowerSeries.invOfUnit
| Mathlib/RingTheory/MvPowerSeries/Inverse.lean | 90 | 97 | theorem coeff_invOfUnit [DecidableEq Ο] (n : Ο ββ β) (Ο : MvPowerSeries Ο R) (u : RΛ£) :
coeff R n (invOfUnit Ο u) =
if n = 0 then βuβ»ΒΉ
else
-βuβ»ΒΉ *
β x β antidiagonal n,
if x.2 < n then coeff R x.1 Ο * coeff R x.2 (invOfUnit Ο u) else 0 := by |
convert coeff_inv_aux n (βuβ»ΒΉ) Ο
| 1 | 2.718282 | 0 | 1 | 3 | 920 |
import Mathlib.RingTheory.MvPowerSeries.Basic
import Mathlib.RingTheory.Ideal.LocalRing
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
section Ring
variable [Ring R]
protected noncomputable def inv.aux (a : R) (Ο : MvPowerSeries Ο R) : MvPowerSeries Ο R
| n =>
letI := Classical.decEq Ο
if n = 0 then a
else
-a *
β x β antidiagonal n, if _ : x.2 < n then coeff R x.1 Ο * inv.aux a Ο x.2 else 0
termination_by n => n
#align mv_power_series.inv.aux MvPowerSeries.inv.aux
theorem coeff_inv_aux [DecidableEq Ο] (n : Ο ββ β) (a : R) (Ο : MvPowerSeries Ο R) :
coeff R n (inv.aux a Ο) =
if n = 0 then a
else
-a *
β x β antidiagonal n, if x.2 < n then coeff R x.1 Ο * coeff R x.2 (inv.aux a Ο) else 0 :=
show inv.aux a Ο n = _ by
cases Subsingleton.elim βΉDecidableEq ΟβΊ (Classical.decEq Ο)
rw [inv.aux]
rfl
#align mv_power_series.coeff_inv_aux MvPowerSeries.coeff_inv_aux
def invOfUnit (Ο : MvPowerSeries Ο R) (u : RΛ£) : MvPowerSeries Ο R :=
inv.aux (βuβ»ΒΉ) Ο
#align mv_power_series.inv_of_unit MvPowerSeries.invOfUnit
theorem coeff_invOfUnit [DecidableEq Ο] (n : Ο ββ β) (Ο : MvPowerSeries Ο R) (u : RΛ£) :
coeff R n (invOfUnit Ο u) =
if n = 0 then βuβ»ΒΉ
else
-βuβ»ΒΉ *
β x β antidiagonal n,
if x.2 < n then coeff R x.1 Ο * coeff R x.2 (invOfUnit Ο u) else 0 := by
convert coeff_inv_aux n (βuβ»ΒΉ) Ο
#align mv_power_series.coeff_inv_of_unit MvPowerSeries.coeff_invOfUnit
@[simp]
| Mathlib/RingTheory/MvPowerSeries/Inverse.lean | 101 | 104 | theorem constantCoeff_invOfUnit (Ο : MvPowerSeries Ο R) (u : RΛ£) :
constantCoeff Ο R (invOfUnit Ο u) = βuβ»ΒΉ := by |
classical
rw [β coeff_zero_eq_constantCoeff_apply, coeff_invOfUnit, if_pos rfl]
| 2 | 7.389056 | 1 | 1 | 3 | 920 |
import Mathlib.RingTheory.MvPowerSeries.Basic
import Mathlib.RingTheory.Ideal.LocalRing
#align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60"
noncomputable section
open Finset (antidiagonal mem_antidiagonal)
namespace MvPowerSeries
open Finsupp
variable {Ο R : Type*}
section Ring
variable [Ring R]
protected noncomputable def inv.aux (a : R) (Ο : MvPowerSeries Ο R) : MvPowerSeries Ο R
| n =>
letI := Classical.decEq Ο
if n = 0 then a
else
-a *
β x β antidiagonal n, if _ : x.2 < n then coeff R x.1 Ο * inv.aux a Ο x.2 else 0
termination_by n => n
#align mv_power_series.inv.aux MvPowerSeries.inv.aux
theorem coeff_inv_aux [DecidableEq Ο] (n : Ο ββ β) (a : R) (Ο : MvPowerSeries Ο R) :
coeff R n (inv.aux a Ο) =
if n = 0 then a
else
-a *
β x β antidiagonal n, if x.2 < n then coeff R x.1 Ο * coeff R x.2 (inv.aux a Ο) else 0 :=
show inv.aux a Ο n = _ by
cases Subsingleton.elim βΉDecidableEq ΟβΊ (Classical.decEq Ο)
rw [inv.aux]
rfl
#align mv_power_series.coeff_inv_aux MvPowerSeries.coeff_inv_aux
def invOfUnit (Ο : MvPowerSeries Ο R) (u : RΛ£) : MvPowerSeries Ο R :=
inv.aux (βuβ»ΒΉ) Ο
#align mv_power_series.inv_of_unit MvPowerSeries.invOfUnit
theorem coeff_invOfUnit [DecidableEq Ο] (n : Ο ββ β) (Ο : MvPowerSeries Ο R) (u : RΛ£) :
coeff R n (invOfUnit Ο u) =
if n = 0 then βuβ»ΒΉ
else
-βuβ»ΒΉ *
β x β antidiagonal n,
if x.2 < n then coeff R x.1 Ο * coeff R x.2 (invOfUnit Ο u) else 0 := by
convert coeff_inv_aux n (βuβ»ΒΉ) Ο
#align mv_power_series.coeff_inv_of_unit MvPowerSeries.coeff_invOfUnit
@[simp]
theorem constantCoeff_invOfUnit (Ο : MvPowerSeries Ο R) (u : RΛ£) :
constantCoeff Ο R (invOfUnit Ο u) = βuβ»ΒΉ := by
classical
rw [β coeff_zero_eq_constantCoeff_apply, coeff_invOfUnit, if_pos rfl]
#align mv_power_series.constant_coeff_inv_of_unit MvPowerSeries.constantCoeff_invOfUnit
| Mathlib/RingTheory/MvPowerSeries/Inverse.lean | 107 | 137 | theorem mul_invOfUnit (Ο : MvPowerSeries Ο R) (u : RΛ£) (h : constantCoeff Ο R Ο = u) :
Ο * invOfUnit Ο u = 1 :=
ext fun n =>
letI := Classical.decEq (Ο ββ β)
if H : n = 0 then by
rw [H]
simp [coeff_mul, support_single_ne_zero, h]
else by
classical
have : ((0 : Ο ββ β), n) β antidiagonal n := by | rw [mem_antidiagonal, zero_add]
rw [coeff_one, if_neg H, coeff_mul, β Finset.insert_erase this,
Finset.sum_insert (Finset.not_mem_erase _ _), coeff_zero_eq_constantCoeff_apply, h,
coeff_invOfUnit, if_neg H, neg_mul, mul_neg, Units.mul_inv_cancel_left, β
Finset.insert_erase this, Finset.sum_insert (Finset.not_mem_erase _ _),
Finset.insert_erase this, if_neg (not_lt_of_ge <| le_rfl), zero_add, add_comm, β
sub_eq_add_neg, sub_eq_zero, Finset.sum_congr rfl]
rintro β¨i, jβ© hij
rw [Finset.mem_erase, mem_antidiagonal] at hij
cases' hij with hβ hβ
subst n
rw [if_pos]
suffices (0 : _) + j < i + j by simpa
apply add_lt_add_right
constructor
Β· intro s
exact Nat.zero_le _
Β· intro H
apply hβ
suffices i = 0 by simp [this]
ext1 s
exact Nat.eq_zero_of_le_zero (H s)
| 22 | 3,584,912,846.131591 | 2 | 1 | 3 | 920 |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w wβ wβ
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type wβ}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' βββ
Rβ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : β) : LieIdeal R L β LieIdeal R L :=
(fun I => β
I, Iβ)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : β) :
derivedSeriesOfIdeal R L (k + 1) I =
β
derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k Iβ :=
Function.iterate_succ_apply' (fun I => β
I, Iβ) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : β) : LieIdeal R L :=
derivedSeriesOfIdeal R L k β€
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : β) : derivedSeries R L k = derivedSeriesOfIdeal R L k β€ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
| Mathlib/Algebra/Lie/Solvable.lean | 82 | 85 | theorem derivedSeriesOfIdeal_add (k l : β) : D (k + l) I = D k (D l I) := by |
induction' k with k ih
Β· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
Β· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
| 3 | 20.085537 | 1 | 1 | 6 | 921 |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w wβ wβ
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type wβ}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' βββ
Rβ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : β) : LieIdeal R L β LieIdeal R L :=
(fun I => β
I, Iβ)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : β) :
derivedSeriesOfIdeal R L (k + 1) I =
β
derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k Iβ :=
Function.iterate_succ_apply' (fun I => β
I, Iβ) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : β) : LieIdeal R L :=
derivedSeriesOfIdeal R L k β€
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : β) : derivedSeries R L k = derivedSeriesOfIdeal R L k β€ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : β) : D (k + l) I = D k (D l I) := by
induction' k with k ih
Β· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
Β· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
| Mathlib/Algebra/Lie/Solvable.lean | 89 | 97 | theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : β} (hβ : I β€ J) (hβ : l β€ k) :
D k I β€ D l J := by |
revert l; induction' k with k ih <;> intro l hβ
Β· rw [le_zero_iff] at hβ; rw [hβ, derivedSeriesOfIdeal_zero]; exact hβ
Β· have h : l = k.succ β¨ l β€ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at hβ
cases' h with h h
Β· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
Β· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
| 7 | 1,096.633158 | 2 | 1 | 6 | 921 |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w wβ wβ
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type wβ}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' βββ
Rβ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : β) : LieIdeal R L β LieIdeal R L :=
(fun I => β
I, Iβ)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : β) :
derivedSeriesOfIdeal R L (k + 1) I =
β
derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k Iβ :=
Function.iterate_succ_apply' (fun I => β
I, Iβ) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : β) : LieIdeal R L :=
derivedSeriesOfIdeal R L k β€
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : β) : derivedSeries R L k = derivedSeriesOfIdeal R L k β€ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : β) : D (k + l) I = D k (D l I) := by
induction' k with k ih
Β· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
Β· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : β} (hβ : I β€ J) (hβ : l β€ k) :
D k I β€ D l J := by
revert l; induction' k with k ih <;> intro l hβ
Β· rw [le_zero_iff] at hβ; rw [hβ, derivedSeriesOfIdeal_zero]; exact hβ
Β· have h : l = k.succ β¨ l β€ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at hβ
cases' h with h h
Β· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
Β· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
#align lie_algebra.derived_series_of_ideal_le LieAlgebra.derivedSeriesOfIdeal_le
theorem derivedSeriesOfIdeal_succ_le (k : β) : D (k + 1) I β€ D k I :=
derivedSeriesOfIdeal_le (le_refl I) k.le_succ
#align lie_algebra.derived_series_of_ideal_succ_le LieAlgebra.derivedSeriesOfIdeal_succ_le
theorem derivedSeriesOfIdeal_le_self (k : β) : D k I β€ I :=
derivedSeriesOfIdeal_le (le_refl I) (zero_le k)
#align lie_algebra.derived_series_of_ideal_le_self LieAlgebra.derivedSeriesOfIdeal_le_self
theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I β€ J) (k : β) : D k I β€ D k J :=
derivedSeriesOfIdeal_le h (le_refl k)
#align lie_algebra.derived_series_of_ideal_mono LieAlgebra.derivedSeriesOfIdeal_mono
theorem derivedSeriesOfIdeal_antitone {k l : β} (h : l β€ k) : D k I β€ D l I :=
derivedSeriesOfIdeal_le (le_refl I) h
#align lie_algebra.derived_series_of_ideal_antitone LieAlgebra.derivedSeriesOfIdeal_antitone
| Mathlib/Algebra/Lie/Solvable.lean | 116 | 124 | theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : β) :
D (k + l) (I + J) β€ D k I + D l J := by |
let Dβ : LieIdeal R L βo LieIdeal R L :=
{ toFun := fun I => β
I, Iβ
monotone' := fun I J h => LieSubmodule.mono_lie I J I J h h }
have hβ : β I J : LieIdeal R L, Dβ (I β J) β€ Dβ I β J := by
simp [Dβ, LieSubmodule.lie_le_right, LieSubmodule.lie_le_left, le_sup_of_le_right]
rw [β Dβ.iterate_sup_le_sup_iff] at hβ
exact hβ k l I J
| 7 | 1,096.633158 | 2 | 1 | 6 | 921 |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w wβ wβ
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type wβ}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' βββ
Rβ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : β) : LieIdeal R L β LieIdeal R L :=
(fun I => β
I, Iβ)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : β) :
derivedSeriesOfIdeal R L (k + 1) I =
β
derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k Iβ :=
Function.iterate_succ_apply' (fun I => β
I, Iβ) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : β) : LieIdeal R L :=
derivedSeriesOfIdeal R L k β€
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : β) : derivedSeries R L k = derivedSeriesOfIdeal R L k β€ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : β) : D (k + l) I = D k (D l I) := by
induction' k with k ih
Β· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
Β· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : β} (hβ : I β€ J) (hβ : l β€ k) :
D k I β€ D l J := by
revert l; induction' k with k ih <;> intro l hβ
Β· rw [le_zero_iff] at hβ; rw [hβ, derivedSeriesOfIdeal_zero]; exact hβ
Β· have h : l = k.succ β¨ l β€ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at hβ
cases' h with h h
Β· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
Β· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
#align lie_algebra.derived_series_of_ideal_le LieAlgebra.derivedSeriesOfIdeal_le
theorem derivedSeriesOfIdeal_succ_le (k : β) : D (k + 1) I β€ D k I :=
derivedSeriesOfIdeal_le (le_refl I) k.le_succ
#align lie_algebra.derived_series_of_ideal_succ_le LieAlgebra.derivedSeriesOfIdeal_succ_le
theorem derivedSeriesOfIdeal_le_self (k : β) : D k I β€ I :=
derivedSeriesOfIdeal_le (le_refl I) (zero_le k)
#align lie_algebra.derived_series_of_ideal_le_self LieAlgebra.derivedSeriesOfIdeal_le_self
theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I β€ J) (k : β) : D k I β€ D k J :=
derivedSeriesOfIdeal_le h (le_refl k)
#align lie_algebra.derived_series_of_ideal_mono LieAlgebra.derivedSeriesOfIdeal_mono
theorem derivedSeriesOfIdeal_antitone {k l : β} (h : l β€ k) : D k I β€ D l I :=
derivedSeriesOfIdeal_le (le_refl I) h
#align lie_algebra.derived_series_of_ideal_antitone LieAlgebra.derivedSeriesOfIdeal_antitone
theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : β) :
D (k + l) (I + J) β€ D k I + D l J := by
let Dβ : LieIdeal R L βo LieIdeal R L :=
{ toFun := fun I => β
I, Iβ
monotone' := fun I J h => LieSubmodule.mono_lie I J I J h h }
have hβ : β I J : LieIdeal R L, Dβ (I β J) β€ Dβ I β J := by
simp [Dβ, LieSubmodule.lie_le_right, LieSubmodule.lie_le_left, le_sup_of_le_right]
rw [β Dβ.iterate_sup_le_sup_iff] at hβ
exact hβ k l I J
#align lie_algebra.derived_series_of_ideal_add_le_add LieAlgebra.derivedSeriesOfIdeal_add_le_add
| Mathlib/Algebra/Lie/Solvable.lean | 127 | 128 | theorem derivedSeries_of_bot_eq_bot (k : β) : derivedSeriesOfIdeal R L k β₯ = β₯ := by |
rw [eq_bot_iff]; exact derivedSeriesOfIdeal_le_self β₯ k
| 1 | 2.718282 | 0 | 1 | 6 | 921 |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w wβ wβ
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type wβ}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' βββ
Rβ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : β) : LieIdeal R L β LieIdeal R L :=
(fun I => β
I, Iβ)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : β) :
derivedSeriesOfIdeal R L (k + 1) I =
β
derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k Iβ :=
Function.iterate_succ_apply' (fun I => β
I, Iβ) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : β) : LieIdeal R L :=
derivedSeriesOfIdeal R L k β€
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : β) : derivedSeries R L k = derivedSeriesOfIdeal R L k β€ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : β) : D (k + l) I = D k (D l I) := by
induction' k with k ih
Β· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
Β· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : β} (hβ : I β€ J) (hβ : l β€ k) :
D k I β€ D l J := by
revert l; induction' k with k ih <;> intro l hβ
Β· rw [le_zero_iff] at hβ; rw [hβ, derivedSeriesOfIdeal_zero]; exact hβ
Β· have h : l = k.succ β¨ l β€ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at hβ
cases' h with h h
Β· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
Β· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
#align lie_algebra.derived_series_of_ideal_le LieAlgebra.derivedSeriesOfIdeal_le
theorem derivedSeriesOfIdeal_succ_le (k : β) : D (k + 1) I β€ D k I :=
derivedSeriesOfIdeal_le (le_refl I) k.le_succ
#align lie_algebra.derived_series_of_ideal_succ_le LieAlgebra.derivedSeriesOfIdeal_succ_le
theorem derivedSeriesOfIdeal_le_self (k : β) : D k I β€ I :=
derivedSeriesOfIdeal_le (le_refl I) (zero_le k)
#align lie_algebra.derived_series_of_ideal_le_self LieAlgebra.derivedSeriesOfIdeal_le_self
theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I β€ J) (k : β) : D k I β€ D k J :=
derivedSeriesOfIdeal_le h (le_refl k)
#align lie_algebra.derived_series_of_ideal_mono LieAlgebra.derivedSeriesOfIdeal_mono
theorem derivedSeriesOfIdeal_antitone {k l : β} (h : l β€ k) : D k I β€ D l I :=
derivedSeriesOfIdeal_le (le_refl I) h
#align lie_algebra.derived_series_of_ideal_antitone LieAlgebra.derivedSeriesOfIdeal_antitone
theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : β) :
D (k + l) (I + J) β€ D k I + D l J := by
let Dβ : LieIdeal R L βo LieIdeal R L :=
{ toFun := fun I => β
I, Iβ
monotone' := fun I J h => LieSubmodule.mono_lie I J I J h h }
have hβ : β I J : LieIdeal R L, Dβ (I β J) β€ Dβ I β J := by
simp [Dβ, LieSubmodule.lie_le_right, LieSubmodule.lie_le_left, le_sup_of_le_right]
rw [β Dβ.iterate_sup_le_sup_iff] at hβ
exact hβ k l I J
#align lie_algebra.derived_series_of_ideal_add_le_add LieAlgebra.derivedSeriesOfIdeal_add_le_add
theorem derivedSeries_of_bot_eq_bot (k : β) : derivedSeriesOfIdeal R L k β₯ = β₯ := by
rw [eq_bot_iff]; exact derivedSeriesOfIdeal_le_self β₯ k
#align lie_algebra.derived_series_of_bot_eq_bot LieAlgebra.derivedSeries_of_bot_eq_bot
| Mathlib/Algebra/Lie/Solvable.lean | 131 | 133 | theorem abelian_iff_derived_one_eq_bot : IsLieAbelian I β derivedSeriesOfIdeal R L 1 I = β₯ := by |
rw [derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_zero,
LieSubmodule.lie_abelian_iff_lie_self_eq_bot]
| 2 | 7.389056 | 1 | 1 | 6 | 921 |
import Mathlib.Algebra.Lie.Abelian
import Mathlib.Algebra.Lie.IdealOperations
import Mathlib.Order.Hom.Basic
#align_import algebra.lie.solvable from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476"
universe u v w wβ wβ
variable (R : Type u) (L : Type v) (M : Type w) {L' : Type wβ}
variable [CommRing R] [LieRing L] [LieAlgebra R L] [LieRing L'] [LieAlgebra R L']
variable (I J : LieIdeal R L) {f : L' βββ
Rβ L}
namespace LieAlgebra
def derivedSeriesOfIdeal (k : β) : LieIdeal R L β LieIdeal R L :=
(fun I => β
I, Iβ)^[k]
#align lie_algebra.derived_series_of_ideal LieAlgebra.derivedSeriesOfIdeal
@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I :=
rfl
#align lie_algebra.derived_series_of_ideal_zero LieAlgebra.derivedSeriesOfIdeal_zero
@[simp]
theorem derivedSeriesOfIdeal_succ (k : β) :
derivedSeriesOfIdeal R L (k + 1) I =
β
derivedSeriesOfIdeal R L k I, derivedSeriesOfIdeal R L k Iβ :=
Function.iterate_succ_apply' (fun I => β
I, Iβ) k I
#align lie_algebra.derived_series_of_ideal_succ LieAlgebra.derivedSeriesOfIdeal_succ
abbrev derivedSeries (k : β) : LieIdeal R L :=
derivedSeriesOfIdeal R L k β€
#align lie_algebra.derived_series LieAlgebra.derivedSeries
theorem derivedSeries_def (k : β) : derivedSeries R L k = derivedSeriesOfIdeal R L k β€ :=
rfl
#align lie_algebra.derived_series_def LieAlgebra.derivedSeries_def
variable {R L}
local notation "D" => derivedSeriesOfIdeal R L
theorem derivedSeriesOfIdeal_add (k l : β) : D (k + l) I = D k (D l I) := by
induction' k with k ih
Β· rw [Nat.zero_add, derivedSeriesOfIdeal_zero]
Β· rw [Nat.succ_add k l, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ, ih]
#align lie_algebra.derived_series_of_ideal_add LieAlgebra.derivedSeriesOfIdeal_add
@[mono]
theorem derivedSeriesOfIdeal_le {I J : LieIdeal R L} {k l : β} (hβ : I β€ J) (hβ : l β€ k) :
D k I β€ D l J := by
revert l; induction' k with k ih <;> intro l hβ
Β· rw [le_zero_iff] at hβ; rw [hβ, derivedSeriesOfIdeal_zero]; exact hβ
Β· have h : l = k.succ β¨ l β€ k := by rwa [le_iff_eq_or_lt, Nat.lt_succ_iff] at hβ
cases' h with h h
Β· rw [h, derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_succ]
exact LieSubmodule.mono_lie _ _ _ _ (ih (le_refl k)) (ih (le_refl k))
Β· rw [derivedSeriesOfIdeal_succ]; exact le_trans (LieSubmodule.lie_le_left _ _) (ih h)
#align lie_algebra.derived_series_of_ideal_le LieAlgebra.derivedSeriesOfIdeal_le
theorem derivedSeriesOfIdeal_succ_le (k : β) : D (k + 1) I β€ D k I :=
derivedSeriesOfIdeal_le (le_refl I) k.le_succ
#align lie_algebra.derived_series_of_ideal_succ_le LieAlgebra.derivedSeriesOfIdeal_succ_le
theorem derivedSeriesOfIdeal_le_self (k : β) : D k I β€ I :=
derivedSeriesOfIdeal_le (le_refl I) (zero_le k)
#align lie_algebra.derived_series_of_ideal_le_self LieAlgebra.derivedSeriesOfIdeal_le_self
theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I β€ J) (k : β) : D k I β€ D k J :=
derivedSeriesOfIdeal_le h (le_refl k)
#align lie_algebra.derived_series_of_ideal_mono LieAlgebra.derivedSeriesOfIdeal_mono
theorem derivedSeriesOfIdeal_antitone {k l : β} (h : l β€ k) : D k I β€ D l I :=
derivedSeriesOfIdeal_le (le_refl I) h
#align lie_algebra.derived_series_of_ideal_antitone LieAlgebra.derivedSeriesOfIdeal_antitone
theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : β) :
D (k + l) (I + J) β€ D k I + D l J := by
let Dβ : LieIdeal R L βo LieIdeal R L :=
{ toFun := fun I => β
I, Iβ
monotone' := fun I J h => LieSubmodule.mono_lie I J I J h h }
have hβ : β I J : LieIdeal R L, Dβ (I β J) β€ Dβ I β J := by
simp [Dβ, LieSubmodule.lie_le_right, LieSubmodule.lie_le_left, le_sup_of_le_right]
rw [β Dβ.iterate_sup_le_sup_iff] at hβ
exact hβ k l I J
#align lie_algebra.derived_series_of_ideal_add_le_add LieAlgebra.derivedSeriesOfIdeal_add_le_add
theorem derivedSeries_of_bot_eq_bot (k : β) : derivedSeriesOfIdeal R L k β₯ = β₯ := by
rw [eq_bot_iff]; exact derivedSeriesOfIdeal_le_self β₯ k
#align lie_algebra.derived_series_of_bot_eq_bot LieAlgebra.derivedSeries_of_bot_eq_bot
theorem abelian_iff_derived_one_eq_bot : IsLieAbelian I β derivedSeriesOfIdeal R L 1 I = β₯ := by
rw [derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_zero,
LieSubmodule.lie_abelian_iff_lie_self_eq_bot]
#align lie_algebra.abelian_iff_derived_one_eq_bot LieAlgebra.abelian_iff_derived_one_eq_bot
| Mathlib/Algebra/Lie/Solvable.lean | 136 | 138 | theorem abelian_iff_derived_succ_eq_bot (I : LieIdeal R L) (k : β) :
IsLieAbelian (derivedSeriesOfIdeal R L k I) β derivedSeriesOfIdeal R L (k + 1) I = β₯ := by |
rw [add_comm, derivedSeriesOfIdeal_add I 1 k, abelian_iff_derived_one_eq_bot]
| 1 | 2.718282 | 0 | 1 | 6 | 921 |
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Combinatorics.SimpleGraph.Density
import Mathlib.Data.Nat.Cast.Field
import Mathlib.Order.Partition.Equipartition
import Mathlib.SetTheory.Ordinal.Basic
#align_import combinatorics.simple_graph.regularity.uniform from "leanprover-community/mathlib"@"bf7ef0e83e5b7e6c1169e97f055e58a2e4e9d52d"
open Finset
variable {Ξ± π : Type*} [LinearOrderedField π]
namespace SimpleGraph
variable (G : SimpleGraph Ξ±) [DecidableRel G.Adj] (Ξ΅ : π) {s t : Finset Ξ±} {a b : Ξ±}
def IsUniform (s t : Finset Ξ±) : Prop :=
β β¦s'β¦, s' β s β β β¦t'β¦, t' β t β (s.card : π) * Ξ΅ β€ s'.card β
(t.card : π) * Ξ΅ β€ t'.card β |(G.edgeDensity s' t' : π) - (G.edgeDensity s t : π)| < Ξ΅
#align simple_graph.is_uniform SimpleGraph.IsUniform
variable {G Ξ΅}
instance IsUniform.instDecidableRel : DecidableRel (G.IsUniform Ξ΅) := by
unfold IsUniform; infer_instance
theorem IsUniform.mono {Ξ΅' : π} (h : Ξ΅ β€ Ξ΅') (hΞ΅ : IsUniform G Ξ΅ s t) : IsUniform G Ξ΅' s t :=
fun s' hs' t' ht' hs ht => by
refine (hΞ΅ hs' ht' (le_trans ?_ hs) (le_trans ?_ ht)).trans_le h <;> gcongr
#align simple_graph.is_uniform.mono SimpleGraph.IsUniform.mono
theorem IsUniform.symm : Symmetric (IsUniform G Ξ΅) := fun s t h t' ht' s' hs' ht hs => by
rw [edgeDensity_comm _ t', edgeDensity_comm _ t]
exact h hs' ht' hs ht
#align simple_graph.is_uniform.symm SimpleGraph.IsUniform.symm
variable (G)
theorem isUniform_comm : IsUniform G Ξ΅ s t β IsUniform G Ξ΅ t s :=
β¨fun h => h.symm, fun h => h.symmβ©
#align simple_graph.is_uniform_comm SimpleGraph.isUniform_comm
lemma isUniform_one : G.IsUniform (1 : π) s t := by
intro s' hs' t' ht' hs ht
rw [mul_one] at hs ht
rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
exact zero_lt_one
#align simple_graph.is_uniform_one SimpleGraph.isUniform_one
variable {G}
lemma IsUniform.pos (hG : G.IsUniform Ξ΅ s t) : 0 < Ξ΅ :=
not_le.1 fun hΞ΅ β¦ (hΞ΅.trans $ abs_nonneg _).not_lt $ hG (empty_subset _) (empty_subset _)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
@[simp] lemma isUniform_singleton : G.IsUniform Ξ΅ {a} {b} β 0 < Ξ΅ := by
refine β¨IsUniform.pos, fun hΞ΅ s' hs' t' ht' hs ht β¦ ?_β©
rw [card_singleton, Nat.cast_one, one_mul] at hs ht
obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
Β· replace hs : Ξ΅ β€ 0 := by simpa using hs
exact (hΞ΅.not_le hs).elim
obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
Β· replace ht : Ξ΅ β€ 0 := by simpa using ht
exact (hΞ΅.not_le ht).elim
Β· rwa [sub_self, abs_zero]
#align simple_graph.is_uniform_singleton SimpleGraph.isUniform_singleton
theorem not_isUniform_zero : Β¬G.IsUniform (0 : π) s t := fun h =>
(abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by simp)
#align simple_graph.not_is_uniform_zero SimpleGraph.not_isUniform_zero
| Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean | 116 | 120 | theorem not_isUniform_iff :
Β¬G.IsUniform Ξ΅ s t β β s', s' β s β§ β t', t' β t β§ βs.card * Ξ΅ β€ s'.card β§
βt.card * Ξ΅ β€ t'.card β§ Ξ΅ β€ |G.edgeDensity s' t' - G.edgeDensity s t| := by |
unfold IsUniform
simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub]
| 2 | 7.389056 | 1 | 1 | 5 | 922 |
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Combinatorics.SimpleGraph.Density
import Mathlib.Data.Nat.Cast.Field
import Mathlib.Order.Partition.Equipartition
import Mathlib.SetTheory.Ordinal.Basic
#align_import combinatorics.simple_graph.regularity.uniform from "leanprover-community/mathlib"@"bf7ef0e83e5b7e6c1169e97f055e58a2e4e9d52d"
open Finset
variable {Ξ± π : Type*} [LinearOrderedField π]
namespace SimpleGraph
variable (G : SimpleGraph Ξ±) [DecidableRel G.Adj] (Ξ΅ : π) {s t : Finset Ξ±} {a b : Ξ±}
def IsUniform (s t : Finset Ξ±) : Prop :=
β β¦s'β¦, s' β s β β β¦t'β¦, t' β t β (s.card : π) * Ξ΅ β€ s'.card β
(t.card : π) * Ξ΅ β€ t'.card β |(G.edgeDensity s' t' : π) - (G.edgeDensity s t : π)| < Ξ΅
#align simple_graph.is_uniform SimpleGraph.IsUniform
variable {G Ξ΅}
instance IsUniform.instDecidableRel : DecidableRel (G.IsUniform Ξ΅) := by
unfold IsUniform; infer_instance
theorem IsUniform.mono {Ξ΅' : π} (h : Ξ΅ β€ Ξ΅') (hΞ΅ : IsUniform G Ξ΅ s t) : IsUniform G Ξ΅' s t :=
fun s' hs' t' ht' hs ht => by
refine (hΞ΅ hs' ht' (le_trans ?_ hs) (le_trans ?_ ht)).trans_le h <;> gcongr
#align simple_graph.is_uniform.mono SimpleGraph.IsUniform.mono
theorem IsUniform.symm : Symmetric (IsUniform G Ξ΅) := fun s t h t' ht' s' hs' ht hs => by
rw [edgeDensity_comm _ t', edgeDensity_comm _ t]
exact h hs' ht' hs ht
#align simple_graph.is_uniform.symm SimpleGraph.IsUniform.symm
variable (G)
theorem isUniform_comm : IsUniform G Ξ΅ s t β IsUniform G Ξ΅ t s :=
β¨fun h => h.symm, fun h => h.symmβ©
#align simple_graph.is_uniform_comm SimpleGraph.isUniform_comm
lemma isUniform_one : G.IsUniform (1 : π) s t := by
intro s' hs' t' ht' hs ht
rw [mul_one] at hs ht
rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
exact zero_lt_one
#align simple_graph.is_uniform_one SimpleGraph.isUniform_one
variable {G}
lemma IsUniform.pos (hG : G.IsUniform Ξ΅ s t) : 0 < Ξ΅ :=
not_le.1 fun hΞ΅ β¦ (hΞ΅.trans $ abs_nonneg _).not_lt $ hG (empty_subset _) (empty_subset _)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
@[simp] lemma isUniform_singleton : G.IsUniform Ξ΅ {a} {b} β 0 < Ξ΅ := by
refine β¨IsUniform.pos, fun hΞ΅ s' hs' t' ht' hs ht β¦ ?_β©
rw [card_singleton, Nat.cast_one, one_mul] at hs ht
obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
Β· replace hs : Ξ΅ β€ 0 := by simpa using hs
exact (hΞ΅.not_le hs).elim
obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
Β· replace ht : Ξ΅ β€ 0 := by simpa using ht
exact (hΞ΅.not_le ht).elim
Β· rwa [sub_self, abs_zero]
#align simple_graph.is_uniform_singleton SimpleGraph.isUniform_singleton
theorem not_isUniform_zero : Β¬G.IsUniform (0 : π) s t := fun h =>
(abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by simp)
#align simple_graph.not_is_uniform_zero SimpleGraph.not_isUniform_zero
theorem not_isUniform_iff :
Β¬G.IsUniform Ξ΅ s t β β s', s' β s β§ β t', t' β t β§ βs.card * Ξ΅ β€ s'.card β§
βt.card * Ξ΅ β€ t'.card β§ Ξ΅ β€ |G.edgeDensity s' t' - G.edgeDensity s t| := by
unfold IsUniform
simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub]
#align simple_graph.not_is_uniform_iff SimpleGraph.not_isUniform_iff
open scoped Classical
variable (G)
noncomputable def nonuniformWitnesses (Ξ΅ : π) (s t : Finset Ξ±) : Finset Ξ± Γ Finset Ξ± :=
if h : Β¬G.IsUniform Ξ΅ s t then
((not_isUniform_iff.1 h).choose, (not_isUniform_iff.1 h).choose_spec.2.choose)
else (s, t)
#align simple_graph.nonuniform_witnesses SimpleGraph.nonuniformWitnesses
| Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean | 136 | 139 | theorem left_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).1 β s := by |
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.1
| 2 | 7.389056 | 1 | 1 | 5 | 922 |
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Combinatorics.SimpleGraph.Density
import Mathlib.Data.Nat.Cast.Field
import Mathlib.Order.Partition.Equipartition
import Mathlib.SetTheory.Ordinal.Basic
#align_import combinatorics.simple_graph.regularity.uniform from "leanprover-community/mathlib"@"bf7ef0e83e5b7e6c1169e97f055e58a2e4e9d52d"
open Finset
variable {Ξ± π : Type*} [LinearOrderedField π]
namespace SimpleGraph
variable (G : SimpleGraph Ξ±) [DecidableRel G.Adj] (Ξ΅ : π) {s t : Finset Ξ±} {a b : Ξ±}
def IsUniform (s t : Finset Ξ±) : Prop :=
β β¦s'β¦, s' β s β β β¦t'β¦, t' β t β (s.card : π) * Ξ΅ β€ s'.card β
(t.card : π) * Ξ΅ β€ t'.card β |(G.edgeDensity s' t' : π) - (G.edgeDensity s t : π)| < Ξ΅
#align simple_graph.is_uniform SimpleGraph.IsUniform
variable {G Ξ΅}
instance IsUniform.instDecidableRel : DecidableRel (G.IsUniform Ξ΅) := by
unfold IsUniform; infer_instance
theorem IsUniform.mono {Ξ΅' : π} (h : Ξ΅ β€ Ξ΅') (hΞ΅ : IsUniform G Ξ΅ s t) : IsUniform G Ξ΅' s t :=
fun s' hs' t' ht' hs ht => by
refine (hΞ΅ hs' ht' (le_trans ?_ hs) (le_trans ?_ ht)).trans_le h <;> gcongr
#align simple_graph.is_uniform.mono SimpleGraph.IsUniform.mono
theorem IsUniform.symm : Symmetric (IsUniform G Ξ΅) := fun s t h t' ht' s' hs' ht hs => by
rw [edgeDensity_comm _ t', edgeDensity_comm _ t]
exact h hs' ht' hs ht
#align simple_graph.is_uniform.symm SimpleGraph.IsUniform.symm
variable (G)
theorem isUniform_comm : IsUniform G Ξ΅ s t β IsUniform G Ξ΅ t s :=
β¨fun h => h.symm, fun h => h.symmβ©
#align simple_graph.is_uniform_comm SimpleGraph.isUniform_comm
lemma isUniform_one : G.IsUniform (1 : π) s t := by
intro s' hs' t' ht' hs ht
rw [mul_one] at hs ht
rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
exact zero_lt_one
#align simple_graph.is_uniform_one SimpleGraph.isUniform_one
variable {G}
lemma IsUniform.pos (hG : G.IsUniform Ξ΅ s t) : 0 < Ξ΅ :=
not_le.1 fun hΞ΅ β¦ (hΞ΅.trans $ abs_nonneg _).not_lt $ hG (empty_subset _) (empty_subset _)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
@[simp] lemma isUniform_singleton : G.IsUniform Ξ΅ {a} {b} β 0 < Ξ΅ := by
refine β¨IsUniform.pos, fun hΞ΅ s' hs' t' ht' hs ht β¦ ?_β©
rw [card_singleton, Nat.cast_one, one_mul] at hs ht
obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
Β· replace hs : Ξ΅ β€ 0 := by simpa using hs
exact (hΞ΅.not_le hs).elim
obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
Β· replace ht : Ξ΅ β€ 0 := by simpa using ht
exact (hΞ΅.not_le ht).elim
Β· rwa [sub_self, abs_zero]
#align simple_graph.is_uniform_singleton SimpleGraph.isUniform_singleton
theorem not_isUniform_zero : Β¬G.IsUniform (0 : π) s t := fun h =>
(abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by simp)
#align simple_graph.not_is_uniform_zero SimpleGraph.not_isUniform_zero
theorem not_isUniform_iff :
Β¬G.IsUniform Ξ΅ s t β β s', s' β s β§ β t', t' β t β§ βs.card * Ξ΅ β€ s'.card β§
βt.card * Ξ΅ β€ t'.card β§ Ξ΅ β€ |G.edgeDensity s' t' - G.edgeDensity s t| := by
unfold IsUniform
simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub]
#align simple_graph.not_is_uniform_iff SimpleGraph.not_isUniform_iff
open scoped Classical
variable (G)
noncomputable def nonuniformWitnesses (Ξ΅ : π) (s t : Finset Ξ±) : Finset Ξ± Γ Finset Ξ± :=
if h : Β¬G.IsUniform Ξ΅ s t then
((not_isUniform_iff.1 h).choose, (not_isUniform_iff.1 h).choose_spec.2.choose)
else (s, t)
#align simple_graph.nonuniform_witnesses SimpleGraph.nonuniformWitnesses
theorem left_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).1 β s := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.1
#align simple_graph.left_nonuniform_witnesses_subset SimpleGraph.left_nonuniformWitnesses_subset
| Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean | 142 | 145 | theorem left_nonuniformWitnesses_card (h : Β¬G.IsUniform Ξ΅ s t) :
(s.card : π) * Ξ΅ β€ (G.nonuniformWitnesses Ξ΅ s t).1.card := by |
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.1
| 2 | 7.389056 | 1 | 1 | 5 | 922 |
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Combinatorics.SimpleGraph.Density
import Mathlib.Data.Nat.Cast.Field
import Mathlib.Order.Partition.Equipartition
import Mathlib.SetTheory.Ordinal.Basic
#align_import combinatorics.simple_graph.regularity.uniform from "leanprover-community/mathlib"@"bf7ef0e83e5b7e6c1169e97f055e58a2e4e9d52d"
open Finset
variable {Ξ± π : Type*} [LinearOrderedField π]
namespace SimpleGraph
variable (G : SimpleGraph Ξ±) [DecidableRel G.Adj] (Ξ΅ : π) {s t : Finset Ξ±} {a b : Ξ±}
def IsUniform (s t : Finset Ξ±) : Prop :=
β β¦s'β¦, s' β s β β β¦t'β¦, t' β t β (s.card : π) * Ξ΅ β€ s'.card β
(t.card : π) * Ξ΅ β€ t'.card β |(G.edgeDensity s' t' : π) - (G.edgeDensity s t : π)| < Ξ΅
#align simple_graph.is_uniform SimpleGraph.IsUniform
variable {G Ξ΅}
instance IsUniform.instDecidableRel : DecidableRel (G.IsUniform Ξ΅) := by
unfold IsUniform; infer_instance
theorem IsUniform.mono {Ξ΅' : π} (h : Ξ΅ β€ Ξ΅') (hΞ΅ : IsUniform G Ξ΅ s t) : IsUniform G Ξ΅' s t :=
fun s' hs' t' ht' hs ht => by
refine (hΞ΅ hs' ht' (le_trans ?_ hs) (le_trans ?_ ht)).trans_le h <;> gcongr
#align simple_graph.is_uniform.mono SimpleGraph.IsUniform.mono
theorem IsUniform.symm : Symmetric (IsUniform G Ξ΅) := fun s t h t' ht' s' hs' ht hs => by
rw [edgeDensity_comm _ t', edgeDensity_comm _ t]
exact h hs' ht' hs ht
#align simple_graph.is_uniform.symm SimpleGraph.IsUniform.symm
variable (G)
theorem isUniform_comm : IsUniform G Ξ΅ s t β IsUniform G Ξ΅ t s :=
β¨fun h => h.symm, fun h => h.symmβ©
#align simple_graph.is_uniform_comm SimpleGraph.isUniform_comm
lemma isUniform_one : G.IsUniform (1 : π) s t := by
intro s' hs' t' ht' hs ht
rw [mul_one] at hs ht
rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
exact zero_lt_one
#align simple_graph.is_uniform_one SimpleGraph.isUniform_one
variable {G}
lemma IsUniform.pos (hG : G.IsUniform Ξ΅ s t) : 0 < Ξ΅ :=
not_le.1 fun hΞ΅ β¦ (hΞ΅.trans $ abs_nonneg _).not_lt $ hG (empty_subset _) (empty_subset _)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
@[simp] lemma isUniform_singleton : G.IsUniform Ξ΅ {a} {b} β 0 < Ξ΅ := by
refine β¨IsUniform.pos, fun hΞ΅ s' hs' t' ht' hs ht β¦ ?_β©
rw [card_singleton, Nat.cast_one, one_mul] at hs ht
obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
Β· replace hs : Ξ΅ β€ 0 := by simpa using hs
exact (hΞ΅.not_le hs).elim
obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
Β· replace ht : Ξ΅ β€ 0 := by simpa using ht
exact (hΞ΅.not_le ht).elim
Β· rwa [sub_self, abs_zero]
#align simple_graph.is_uniform_singleton SimpleGraph.isUniform_singleton
theorem not_isUniform_zero : Β¬G.IsUniform (0 : π) s t := fun h =>
(abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by simp)
#align simple_graph.not_is_uniform_zero SimpleGraph.not_isUniform_zero
theorem not_isUniform_iff :
Β¬G.IsUniform Ξ΅ s t β β s', s' β s β§ β t', t' β t β§ βs.card * Ξ΅ β€ s'.card β§
βt.card * Ξ΅ β€ t'.card β§ Ξ΅ β€ |G.edgeDensity s' t' - G.edgeDensity s t| := by
unfold IsUniform
simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub]
#align simple_graph.not_is_uniform_iff SimpleGraph.not_isUniform_iff
open scoped Classical
variable (G)
noncomputable def nonuniformWitnesses (Ξ΅ : π) (s t : Finset Ξ±) : Finset Ξ± Γ Finset Ξ± :=
if h : Β¬G.IsUniform Ξ΅ s t then
((not_isUniform_iff.1 h).choose, (not_isUniform_iff.1 h).choose_spec.2.choose)
else (s, t)
#align simple_graph.nonuniform_witnesses SimpleGraph.nonuniformWitnesses
theorem left_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).1 β s := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.1
#align simple_graph.left_nonuniform_witnesses_subset SimpleGraph.left_nonuniformWitnesses_subset
theorem left_nonuniformWitnesses_card (h : Β¬G.IsUniform Ξ΅ s t) :
(s.card : π) * Ξ΅ β€ (G.nonuniformWitnesses Ξ΅ s t).1.card := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.1
#align simple_graph.left_nonuniform_witnesses_card SimpleGraph.left_nonuniformWitnesses_card
| Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean | 148 | 151 | theorem right_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).2 β t := by |
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.1
| 2 | 7.389056 | 1 | 1 | 5 | 922 |
import Mathlib.Algebra.BigOperators.Ring
import Mathlib.Combinatorics.SimpleGraph.Density
import Mathlib.Data.Nat.Cast.Field
import Mathlib.Order.Partition.Equipartition
import Mathlib.SetTheory.Ordinal.Basic
#align_import combinatorics.simple_graph.regularity.uniform from "leanprover-community/mathlib"@"bf7ef0e83e5b7e6c1169e97f055e58a2e4e9d52d"
open Finset
variable {Ξ± π : Type*} [LinearOrderedField π]
namespace SimpleGraph
variable (G : SimpleGraph Ξ±) [DecidableRel G.Adj] (Ξ΅ : π) {s t : Finset Ξ±} {a b : Ξ±}
def IsUniform (s t : Finset Ξ±) : Prop :=
β β¦s'β¦, s' β s β β β¦t'β¦, t' β t β (s.card : π) * Ξ΅ β€ s'.card β
(t.card : π) * Ξ΅ β€ t'.card β |(G.edgeDensity s' t' : π) - (G.edgeDensity s t : π)| < Ξ΅
#align simple_graph.is_uniform SimpleGraph.IsUniform
variable {G Ξ΅}
instance IsUniform.instDecidableRel : DecidableRel (G.IsUniform Ξ΅) := by
unfold IsUniform; infer_instance
theorem IsUniform.mono {Ξ΅' : π} (h : Ξ΅ β€ Ξ΅') (hΞ΅ : IsUniform G Ξ΅ s t) : IsUniform G Ξ΅' s t :=
fun s' hs' t' ht' hs ht => by
refine (hΞ΅ hs' ht' (le_trans ?_ hs) (le_trans ?_ ht)).trans_le h <;> gcongr
#align simple_graph.is_uniform.mono SimpleGraph.IsUniform.mono
theorem IsUniform.symm : Symmetric (IsUniform G Ξ΅) := fun s t h t' ht' s' hs' ht hs => by
rw [edgeDensity_comm _ t', edgeDensity_comm _ t]
exact h hs' ht' hs ht
#align simple_graph.is_uniform.symm SimpleGraph.IsUniform.symm
variable (G)
theorem isUniform_comm : IsUniform G Ξ΅ s t β IsUniform G Ξ΅ t s :=
β¨fun h => h.symm, fun h => h.symmβ©
#align simple_graph.is_uniform_comm SimpleGraph.isUniform_comm
lemma isUniform_one : G.IsUniform (1 : π) s t := by
intro s' hs' t' ht' hs ht
rw [mul_one] at hs ht
rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
exact zero_lt_one
#align simple_graph.is_uniform_one SimpleGraph.isUniform_one
variable {G}
lemma IsUniform.pos (hG : G.IsUniform Ξ΅ s t) : 0 < Ξ΅ :=
not_le.1 fun hΞ΅ β¦ (hΞ΅.trans $ abs_nonneg _).not_lt $ hG (empty_subset _) (empty_subset _)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
(by simpa using mul_nonpos_of_nonneg_of_nonpos (Nat.cast_nonneg _) hΞ΅)
@[simp] lemma isUniform_singleton : G.IsUniform Ξ΅ {a} {b} β 0 < Ξ΅ := by
refine β¨IsUniform.pos, fun hΞ΅ s' hs' t' ht' hs ht β¦ ?_β©
rw [card_singleton, Nat.cast_one, one_mul] at hs ht
obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
Β· replace hs : Ξ΅ β€ 0 := by simpa using hs
exact (hΞ΅.not_le hs).elim
obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
Β· replace ht : Ξ΅ β€ 0 := by simpa using ht
exact (hΞ΅.not_le ht).elim
Β· rwa [sub_self, abs_zero]
#align simple_graph.is_uniform_singleton SimpleGraph.isUniform_singleton
theorem not_isUniform_zero : Β¬G.IsUniform (0 : π) s t := fun h =>
(abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by simp)
#align simple_graph.not_is_uniform_zero SimpleGraph.not_isUniform_zero
theorem not_isUniform_iff :
Β¬G.IsUniform Ξ΅ s t β β s', s' β s β§ β t', t' β t β§ βs.card * Ξ΅ β€ s'.card β§
βt.card * Ξ΅ β€ t'.card β§ Ξ΅ β€ |G.edgeDensity s' t' - G.edgeDensity s t| := by
unfold IsUniform
simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub]
#align simple_graph.not_is_uniform_iff SimpleGraph.not_isUniform_iff
open scoped Classical
variable (G)
noncomputable def nonuniformWitnesses (Ξ΅ : π) (s t : Finset Ξ±) : Finset Ξ± Γ Finset Ξ± :=
if h : Β¬G.IsUniform Ξ΅ s t then
((not_isUniform_iff.1 h).choose, (not_isUniform_iff.1 h).choose_spec.2.choose)
else (s, t)
#align simple_graph.nonuniform_witnesses SimpleGraph.nonuniformWitnesses
theorem left_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).1 β s := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.1
#align simple_graph.left_nonuniform_witnesses_subset SimpleGraph.left_nonuniformWitnesses_subset
theorem left_nonuniformWitnesses_card (h : Β¬G.IsUniform Ξ΅ s t) :
(s.card : π) * Ξ΅ β€ (G.nonuniformWitnesses Ξ΅ s t).1.card := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.1
#align simple_graph.left_nonuniform_witnesses_card SimpleGraph.left_nonuniformWitnesses_card
theorem right_nonuniformWitnesses_subset (h : Β¬G.IsUniform Ξ΅ s t) :
(G.nonuniformWitnesses Ξ΅ s t).2 β t := by
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.1
#align simple_graph.right_nonuniform_witnesses_subset SimpleGraph.right_nonuniformWitnesses_subset
| Mathlib/Combinatorics/SimpleGraph/Regularity/Uniform.lean | 154 | 157 | theorem right_nonuniformWitnesses_card (h : Β¬G.IsUniform Ξ΅ s t) :
(t.card : π) * Ξ΅ β€ (G.nonuniformWitnesses Ξ΅ s t).2.card := by |
rw [nonuniformWitnesses, dif_pos h]
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.2.1
| 2 | 7.389056 | 1 | 1 | 5 | 922 |
import Mathlib.Combinatorics.Enumerative.Composition
import Mathlib.Tactic.ApplyFun
#align_import combinatorics.partition from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
open Multiset
namespace Nat
@[ext]
structure Partition (n : β) where
parts : Multiset β
parts_pos : β {i}, i β parts β 0 < i
parts_sum : parts.sum = n
-- Porting note: chokes on `parts_pos`
--deriving DecidableEq
#align nat.partition Nat.Partition
namespace Partition
-- TODO: This should be automatically derived, see lean4#2914
instance decidableEqPartition {n : β} : DecidableEq (Partition n) :=
fun _ _ => decidable_of_iff' _ <| Partition.ext_iff _ _
@[simps]
def ofComposition (n : β) (c : Composition n) : Partition n where
parts := c.blocks
parts_pos hi := c.blocks_pos hi
parts_sum := by rw [Multiset.sum_coe, c.blocks_sum]
#align nat.partition.of_composition Nat.Partition.ofComposition
| Mathlib/Combinatorics/Enumerative/Partition.lean | 77 | 80 | theorem ofComposition_surj {n : β} : Function.Surjective (ofComposition n) := by |
rintro β¨b, hbβ, hbββ©
induction b using Quotient.inductionOn with | _ b => ?_
exact β¨β¨b, hbβ, by simpa using hbββ©, Partition.ext _ _ rflβ©
| 3 | 20.085537 | 1 | 1 | 1 | 923 |
import Mathlib.Tactic.Ring
import Mathlib.Data.PNat.Prime
#align_import data.pnat.xgcd from "leanprover-community/mathlib"@"6afc9b06856ad973f6a2619e3e8a0a8d537a58f2"
open Nat
namespace PNat
structure XgcdType where
wp : β
x : β
y : β
zp : β
ap : β
bp : β
deriving Inhabited
#align pnat.xgcd_type PNat.XgcdType
namespace XgcdType
variable (u : XgcdType)
instance : SizeOf XgcdType :=
β¨fun u => u.bpβ©
instance : Repr XgcdType where
reprPrec
| g, _ => s!"[[[{repr (g.wp + 1)}, {repr g.x}], \
[{repr g.y}, {repr (g.zp + 1)}]], \
[{repr (g.ap + 1)}, {repr (g.bp + 1)}]]"
def mk' (w : β+) (x : β) (y : β) (z : β+) (a : β+) (b : β+) : XgcdType :=
mk w.val.pred x y z.val.pred a.val.pred b.val.pred
#align pnat.xgcd_type.mk' PNat.XgcdType.mk'
def w : β+ :=
succPNat u.wp
#align pnat.xgcd_type.w PNat.XgcdType.w
def z : β+ :=
succPNat u.zp
#align pnat.xgcd_type.z PNat.XgcdType.z
def a : β+ :=
succPNat u.ap
#align pnat.xgcd_type.a PNat.XgcdType.a
def b : β+ :=
succPNat u.bp
#align pnat.xgcd_type.b PNat.XgcdType.b
def r : β :=
(u.ap + 1) % (u.bp + 1)
#align pnat.xgcd_type.r PNat.XgcdType.r
def q : β :=
(u.ap + 1) / (u.bp + 1)
#align pnat.xgcd_type.q PNat.XgcdType.q
def qp : β :=
u.q - 1
#align pnat.xgcd_type.qp PNat.XgcdType.qp
def vp : β Γ β :=
β¨u.wp + u.x + u.ap + u.wp * u.ap + u.x * u.bp, u.y + u.zp + u.bp + u.y * u.ap + u.zp * u.bpβ©
#align pnat.xgcd_type.vp PNat.XgcdType.vp
def v : β Γ β :=
β¨u.w * u.a + u.x * u.b, u.y * u.a + u.z * u.bβ©
#align pnat.xgcd_type.v PNat.XgcdType.v
def succβ (t : β Γ β) : β Γ β :=
β¨t.1.succ, t.2.succβ©
#align pnat.xgcd_type.succβ PNat.XgcdType.succβ
| Mathlib/Data/PNat/Xgcd.lean | 136 | 137 | theorem v_eq_succ_vp : u.v = succβ u.vp := by |
ext <;> dsimp [v, vp, w, z, a, b, succβ] <;> ring_nf
| 1 | 2.718282 | 0 | 1 | 4 | 924 |
import Mathlib.Tactic.Ring
import Mathlib.Data.PNat.Prime
#align_import data.pnat.xgcd from "leanprover-community/mathlib"@"6afc9b06856ad973f6a2619e3e8a0a8d537a58f2"
open Nat
namespace PNat
structure XgcdType where
wp : β
x : β
y : β
zp : β
ap : β
bp : β
deriving Inhabited
#align pnat.xgcd_type PNat.XgcdType
namespace XgcdType
variable (u : XgcdType)
instance : SizeOf XgcdType :=
β¨fun u => u.bpβ©
instance : Repr XgcdType where
reprPrec
| g, _ => s!"[[[{repr (g.wp + 1)}, {repr g.x}], \
[{repr g.y}, {repr (g.zp + 1)}]], \
[{repr (g.ap + 1)}, {repr (g.bp + 1)}]]"
def mk' (w : β+) (x : β) (y : β) (z : β+) (a : β+) (b : β+) : XgcdType :=
mk w.val.pred x y z.val.pred a.val.pred b.val.pred
#align pnat.xgcd_type.mk' PNat.XgcdType.mk'
def w : β+ :=
succPNat u.wp
#align pnat.xgcd_type.w PNat.XgcdType.w
def z : β+ :=
succPNat u.zp
#align pnat.xgcd_type.z PNat.XgcdType.z
def a : β+ :=
succPNat u.ap
#align pnat.xgcd_type.a PNat.XgcdType.a
def b : β+ :=
succPNat u.bp
#align pnat.xgcd_type.b PNat.XgcdType.b
def r : β :=
(u.ap + 1) % (u.bp + 1)
#align pnat.xgcd_type.r PNat.XgcdType.r
def q : β :=
(u.ap + 1) / (u.bp + 1)
#align pnat.xgcd_type.q PNat.XgcdType.q
def qp : β :=
u.q - 1
#align pnat.xgcd_type.qp PNat.XgcdType.qp
def vp : β Γ β :=
β¨u.wp + u.x + u.ap + u.wp * u.ap + u.x * u.bp, u.y + u.zp + u.bp + u.y * u.ap + u.zp * u.bpβ©
#align pnat.xgcd_type.vp PNat.XgcdType.vp
def v : β Γ β :=
β¨u.w * u.a + u.x * u.b, u.y * u.a + u.z * u.bβ©
#align pnat.xgcd_type.v PNat.XgcdType.v
def succβ (t : β Γ β) : β Γ β :=
β¨t.1.succ, t.2.succβ©
#align pnat.xgcd_type.succβ PNat.XgcdType.succβ
theorem v_eq_succ_vp : u.v = succβ u.vp := by
ext <;> dsimp [v, vp, w, z, a, b, succβ] <;> ring_nf
#align pnat.xgcd_type.v_eq_succ_vp PNat.XgcdType.v_eq_succ_vp
def IsSpecial : Prop :=
u.wp + u.zp + u.wp * u.zp = u.x * u.y
#align pnat.xgcd_type.is_special PNat.XgcdType.IsSpecial
def IsSpecial' : Prop :=
u.w * u.z = succPNat (u.x * u.y)
#align pnat.xgcd_type.is_special' PNat.XgcdType.IsSpecial'
| Mathlib/Data/PNat/Xgcd.lean | 150 | 156 | theorem isSpecial_iff : u.IsSpecial β u.IsSpecial' := by |
dsimp [IsSpecial, IsSpecial']
let β¨wp, x, y, zp, ap, bpβ© := u
constructor <;> intro h <;> simp [w, z, succPNat] at * <;>
simp only [β coe_inj, mul_coe, mk_coe] at *
Β· simp_all [β h, Nat.mul, Nat.succ_eq_add_one]; ring
Β· simp [Nat.succ_eq_add_one, Nat.mul_add, Nat.add_mul, β Nat.add_assoc] at h; rw [β h]; ring
| 6 | 403.428793 | 2 | 1 | 4 | 924 |
import Mathlib.Tactic.Ring
import Mathlib.Data.PNat.Prime
#align_import data.pnat.xgcd from "leanprover-community/mathlib"@"6afc9b06856ad973f6a2619e3e8a0a8d537a58f2"
open Nat
namespace PNat
structure XgcdType where
wp : β
x : β
y : β
zp : β
ap : β
bp : β
deriving Inhabited
#align pnat.xgcd_type PNat.XgcdType
namespace XgcdType
variable (u : XgcdType)
instance : SizeOf XgcdType :=
β¨fun u => u.bpβ©
instance : Repr XgcdType where
reprPrec
| g, _ => s!"[[[{repr (g.wp + 1)}, {repr g.x}], \
[{repr g.y}, {repr (g.zp + 1)}]], \
[{repr (g.ap + 1)}, {repr (g.bp + 1)}]]"
def mk' (w : β+) (x : β) (y : β) (z : β+) (a : β+) (b : β+) : XgcdType :=
mk w.val.pred x y z.val.pred a.val.pred b.val.pred
#align pnat.xgcd_type.mk' PNat.XgcdType.mk'
def w : β+ :=
succPNat u.wp
#align pnat.xgcd_type.w PNat.XgcdType.w
def z : β+ :=
succPNat u.zp
#align pnat.xgcd_type.z PNat.XgcdType.z
def a : β+ :=
succPNat u.ap
#align pnat.xgcd_type.a PNat.XgcdType.a
def b : β+ :=
succPNat u.bp
#align pnat.xgcd_type.b PNat.XgcdType.b
def r : β :=
(u.ap + 1) % (u.bp + 1)
#align pnat.xgcd_type.r PNat.XgcdType.r
def q : β :=
(u.ap + 1) / (u.bp + 1)
#align pnat.xgcd_type.q PNat.XgcdType.q
def qp : β :=
u.q - 1
#align pnat.xgcd_type.qp PNat.XgcdType.qp
def vp : β Γ β :=
β¨u.wp + u.x + u.ap + u.wp * u.ap + u.x * u.bp, u.y + u.zp + u.bp + u.y * u.ap + u.zp * u.bpβ©
#align pnat.xgcd_type.vp PNat.XgcdType.vp
def v : β Γ β :=
β¨u.w * u.a + u.x * u.b, u.y * u.a + u.z * u.bβ©
#align pnat.xgcd_type.v PNat.XgcdType.v
def succβ (t : β Γ β) : β Γ β :=
β¨t.1.succ, t.2.succβ©
#align pnat.xgcd_type.succβ PNat.XgcdType.succβ
theorem v_eq_succ_vp : u.v = succβ u.vp := by
ext <;> dsimp [v, vp, w, z, a, b, succβ] <;> ring_nf
#align pnat.xgcd_type.v_eq_succ_vp PNat.XgcdType.v_eq_succ_vp
def IsSpecial : Prop :=
u.wp + u.zp + u.wp * u.zp = u.x * u.y
#align pnat.xgcd_type.is_special PNat.XgcdType.IsSpecial
def IsSpecial' : Prop :=
u.w * u.z = succPNat (u.x * u.y)
#align pnat.xgcd_type.is_special' PNat.XgcdType.IsSpecial'
theorem isSpecial_iff : u.IsSpecial β u.IsSpecial' := by
dsimp [IsSpecial, IsSpecial']
let β¨wp, x, y, zp, ap, bpβ© := u
constructor <;> intro h <;> simp [w, z, succPNat] at * <;>
simp only [β coe_inj, mul_coe, mk_coe] at *
Β· simp_all [β h, Nat.mul, Nat.succ_eq_add_one]; ring
Β· simp [Nat.succ_eq_add_one, Nat.mul_add, Nat.add_mul, β Nat.add_assoc] at h; rw [β h]; ring
-- Porting note: Old code has been removed as it was much more longer.
#align pnat.xgcd_type.is_special_iff PNat.XgcdType.isSpecial_iff
def IsReduced : Prop :=
u.ap = u.bp
#align pnat.xgcd_type.is_reduced PNat.XgcdType.IsReduced
def IsReduced' : Prop :=
u.a = u.b
#align pnat.xgcd_type.is_reduced' PNat.XgcdType.IsReduced'
theorem isReduced_iff : u.IsReduced β u.IsReduced' :=
succPNat_inj.symm
#align pnat.xgcd_type.is_reduced_iff PNat.XgcdType.isReduced_iff
def flip : XgcdType where
wp := u.zp
x := u.y
y := u.x
zp := u.wp
ap := u.bp
bp := u.ap
#align pnat.xgcd_type.flip PNat.XgcdType.flip
@[simp]
theorem flip_w : (flip u).w = u.z :=
rfl
#align pnat.xgcd_type.flip_w PNat.XgcdType.flip_w
@[simp]
theorem flip_x : (flip u).x = u.y :=
rfl
#align pnat.xgcd_type.flip_x PNat.XgcdType.flip_x
@[simp]
theorem flip_y : (flip u).y = u.x :=
rfl
#align pnat.xgcd_type.flip_y PNat.XgcdType.flip_y
@[simp]
theorem flip_z : (flip u).z = u.w :=
rfl
#align pnat.xgcd_type.flip_z PNat.XgcdType.flip_z
@[simp]
theorem flip_a : (flip u).a = u.b :=
rfl
#align pnat.xgcd_type.flip_a PNat.XgcdType.flip_a
@[simp]
theorem flip_b : (flip u).b = u.a :=
rfl
#align pnat.xgcd_type.flip_b PNat.XgcdType.flip_b
| Mathlib/Data/PNat/Xgcd.lean | 217 | 219 | theorem flip_isReduced : (flip u).IsReduced β u.IsReduced := by |
dsimp [IsReduced, flip]
constructor <;> intro h <;> exact h.symm
| 2 | 7.389056 | 1 | 1 | 4 | 924 |
import Mathlib.Tactic.Ring
import Mathlib.Data.PNat.Prime
#align_import data.pnat.xgcd from "leanprover-community/mathlib"@"6afc9b06856ad973f6a2619e3e8a0a8d537a58f2"
open Nat
namespace PNat
structure XgcdType where
wp : β
x : β
y : β
zp : β
ap : β
bp : β
deriving Inhabited
#align pnat.xgcd_type PNat.XgcdType
namespace XgcdType
variable (u : XgcdType)
instance : SizeOf XgcdType :=
β¨fun u => u.bpβ©
instance : Repr XgcdType where
reprPrec
| g, _ => s!"[[[{repr (g.wp + 1)}, {repr g.x}], \
[{repr g.y}, {repr (g.zp + 1)}]], \
[{repr (g.ap + 1)}, {repr (g.bp + 1)}]]"
def mk' (w : β+) (x : β) (y : β) (z : β+) (a : β+) (b : β+) : XgcdType :=
mk w.val.pred x y z.val.pred a.val.pred b.val.pred
#align pnat.xgcd_type.mk' PNat.XgcdType.mk'
def w : β+ :=
succPNat u.wp
#align pnat.xgcd_type.w PNat.XgcdType.w
def z : β+ :=
succPNat u.zp
#align pnat.xgcd_type.z PNat.XgcdType.z
def a : β+ :=
succPNat u.ap
#align pnat.xgcd_type.a PNat.XgcdType.a
def b : β+ :=
succPNat u.bp
#align pnat.xgcd_type.b PNat.XgcdType.b
def r : β :=
(u.ap + 1) % (u.bp + 1)
#align pnat.xgcd_type.r PNat.XgcdType.r
def q : β :=
(u.ap + 1) / (u.bp + 1)
#align pnat.xgcd_type.q PNat.XgcdType.q
def qp : β :=
u.q - 1
#align pnat.xgcd_type.qp PNat.XgcdType.qp
def vp : β Γ β :=
β¨u.wp + u.x + u.ap + u.wp * u.ap + u.x * u.bp, u.y + u.zp + u.bp + u.y * u.ap + u.zp * u.bpβ©
#align pnat.xgcd_type.vp PNat.XgcdType.vp
def v : β Γ β :=
β¨u.w * u.a + u.x * u.b, u.y * u.a + u.z * u.bβ©
#align pnat.xgcd_type.v PNat.XgcdType.v
def succβ (t : β Γ β) : β Γ β :=
β¨t.1.succ, t.2.succβ©
#align pnat.xgcd_type.succβ PNat.XgcdType.succβ
theorem v_eq_succ_vp : u.v = succβ u.vp := by
ext <;> dsimp [v, vp, w, z, a, b, succβ] <;> ring_nf
#align pnat.xgcd_type.v_eq_succ_vp PNat.XgcdType.v_eq_succ_vp
def IsSpecial : Prop :=
u.wp + u.zp + u.wp * u.zp = u.x * u.y
#align pnat.xgcd_type.is_special PNat.XgcdType.IsSpecial
def IsSpecial' : Prop :=
u.w * u.z = succPNat (u.x * u.y)
#align pnat.xgcd_type.is_special' PNat.XgcdType.IsSpecial'
theorem isSpecial_iff : u.IsSpecial β u.IsSpecial' := by
dsimp [IsSpecial, IsSpecial']
let β¨wp, x, y, zp, ap, bpβ© := u
constructor <;> intro h <;> simp [w, z, succPNat] at * <;>
simp only [β coe_inj, mul_coe, mk_coe] at *
Β· simp_all [β h, Nat.mul, Nat.succ_eq_add_one]; ring
Β· simp [Nat.succ_eq_add_one, Nat.mul_add, Nat.add_mul, β Nat.add_assoc] at h; rw [β h]; ring
-- Porting note: Old code has been removed as it was much more longer.
#align pnat.xgcd_type.is_special_iff PNat.XgcdType.isSpecial_iff
def IsReduced : Prop :=
u.ap = u.bp
#align pnat.xgcd_type.is_reduced PNat.XgcdType.IsReduced
def IsReduced' : Prop :=
u.a = u.b
#align pnat.xgcd_type.is_reduced' PNat.XgcdType.IsReduced'
theorem isReduced_iff : u.IsReduced β u.IsReduced' :=
succPNat_inj.symm
#align pnat.xgcd_type.is_reduced_iff PNat.XgcdType.isReduced_iff
def flip : XgcdType where
wp := u.zp
x := u.y
y := u.x
zp := u.wp
ap := u.bp
bp := u.ap
#align pnat.xgcd_type.flip PNat.XgcdType.flip
@[simp]
theorem flip_w : (flip u).w = u.z :=
rfl
#align pnat.xgcd_type.flip_w PNat.XgcdType.flip_w
@[simp]
theorem flip_x : (flip u).x = u.y :=
rfl
#align pnat.xgcd_type.flip_x PNat.XgcdType.flip_x
@[simp]
theorem flip_y : (flip u).y = u.x :=
rfl
#align pnat.xgcd_type.flip_y PNat.XgcdType.flip_y
@[simp]
theorem flip_z : (flip u).z = u.w :=
rfl
#align pnat.xgcd_type.flip_z PNat.XgcdType.flip_z
@[simp]
theorem flip_a : (flip u).a = u.b :=
rfl
#align pnat.xgcd_type.flip_a PNat.XgcdType.flip_a
@[simp]
theorem flip_b : (flip u).b = u.a :=
rfl
#align pnat.xgcd_type.flip_b PNat.XgcdType.flip_b
theorem flip_isReduced : (flip u).IsReduced β u.IsReduced := by
dsimp [IsReduced, flip]
constructor <;> intro h <;> exact h.symm
#align pnat.xgcd_type.flip_is_reduced PNat.XgcdType.flip_isReduced
| Mathlib/Data/PNat/Xgcd.lean | 222 | 224 | theorem flip_isSpecial : (flip u).IsSpecial β u.IsSpecial := by |
dsimp [IsSpecial, flip]
rw [mul_comm u.x, mul_comm u.zp, add_comm u.zp]
| 2 | 7.389056 | 1 | 1 | 4 | 924 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section lcm
def lcm (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (β
: Finset Ξ²).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
| Mathlib/Algebra/GCDMonoid/Finset.lean | 62 | 65 | theorem lcm_dvd_iff {a : Ξ±} : s.lcm f β£ a β β b β s, f b β£ a := by |
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
| 3 | 20.085537 | 1 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section lcm
def lcm (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (β
: Finset Ξ²).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
theorem lcm_dvd_iff {a : Ξ±} : s.lcm f β£ a β β b β s, f b β£ a := by
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.lcm_dvd_iff Finset.lcm_dvd_iff
theorem lcm_dvd {a : Ξ±} : (β b β s, f b β£ a) β s.lcm f β£ a :=
lcm_dvd_iff.2
#align finset.lcm_dvd Finset.lcm_dvd
theorem dvd_lcm {b : Ξ²} (hb : b β s) : f b β£ s.lcm f :=
lcm_dvd_iff.1 dvd_rfl _ hb
#align finset.dvd_lcm Finset.dvd_lcm
@[simp]
| Mathlib/Algebra/GCDMonoid/Finset.lean | 77 | 82 | theorem lcm_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).lcm f = GCDMonoid.lcm (f b) (s.lcm f) := by |
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(lcm_eq_right_iff (f b) (s.lcm f) (Multiset.normalize_lcm (s.1.map f))).2 (dvd_lcm h)]
apply fold_insert h
| 4 | 54.59815 | 2 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section lcm
def lcm (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (β
: Finset Ξ²).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
theorem lcm_dvd_iff {a : Ξ±} : s.lcm f β£ a β β b β s, f b β£ a := by
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.lcm_dvd_iff Finset.lcm_dvd_iff
theorem lcm_dvd {a : Ξ±} : (β b β s, f b β£ a) β s.lcm f β£ a :=
lcm_dvd_iff.2
#align finset.lcm_dvd Finset.lcm_dvd
theorem dvd_lcm {b : Ξ²} (hb : b β s) : f b β£ s.lcm f :=
lcm_dvd_iff.1 dvd_rfl _ hb
#align finset.dvd_lcm Finset.dvd_lcm
@[simp]
theorem lcm_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).lcm f = GCDMonoid.lcm (f b) (s.lcm f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(lcm_eq_right_iff (f b) (s.lcm f) (Multiset.normalize_lcm (s.1.map f))).2 (dvd_lcm h)]
apply fold_insert h
#align finset.lcm_insert Finset.lcm_insert
@[simp]
theorem lcm_singleton {b : Ξ²} : ({b} : Finset Ξ²).lcm f = normalize (f b) :=
Multiset.lcm_singleton
#align finset.lcm_singleton Finset.lcm_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
| Mathlib/Algebra/GCDMonoid/Finset.lean | 92 | 92 | theorem normalize_lcm : normalize (s.lcm f) = s.lcm f := by | simp [lcm_def]
| 1 | 2.718282 | 0 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section lcm
def lcm (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (β
: Finset Ξ²).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
theorem lcm_dvd_iff {a : Ξ±} : s.lcm f β£ a β β b β s, f b β£ a := by
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.lcm_dvd_iff Finset.lcm_dvd_iff
theorem lcm_dvd {a : Ξ±} : (β b β s, f b β£ a) β s.lcm f β£ a :=
lcm_dvd_iff.2
#align finset.lcm_dvd Finset.lcm_dvd
theorem dvd_lcm {b : Ξ²} (hb : b β s) : f b β£ s.lcm f :=
lcm_dvd_iff.1 dvd_rfl _ hb
#align finset.dvd_lcm Finset.dvd_lcm
@[simp]
theorem lcm_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).lcm f = GCDMonoid.lcm (f b) (s.lcm f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(lcm_eq_right_iff (f b) (s.lcm f) (Multiset.normalize_lcm (s.1.map f))).2 (dvd_lcm h)]
apply fold_insert h
#align finset.lcm_insert Finset.lcm_insert
@[simp]
theorem lcm_singleton {b : Ξ²} : ({b} : Finset Ξ²).lcm f = normalize (f b) :=
Multiset.lcm_singleton
#align finset.lcm_singleton Finset.lcm_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_lcm : normalize (s.lcm f) = s.lcm f := by simp [lcm_def]
#align finset.normalize_lcm Finset.normalize_lcm
theorem lcm_union [DecidableEq Ξ²] : (sβ βͺ sβ).lcm f = GCDMonoid.lcm (sβ.lcm f) (sβ.lcm f) :=
Finset.induction_on sβ (by rw [empty_union, lcm_empty, lcm_one_left, normalize_lcm])
fun a s _ ih β¦ by rw [insert_union, lcm_insert, lcm_insert, ih, lcm_assoc]
#align finset.lcm_union Finset.lcm_union
| Mathlib/Algebra/GCDMonoid/Finset.lean | 100 | 103 | theorem lcm_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.lcm f = sβ.lcm g := by |
subst hs
exact Finset.fold_congr hfg
| 2 | 7.389056 | 1 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section lcm
def lcm (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (β
: Finset Ξ²).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
theorem lcm_dvd_iff {a : Ξ±} : s.lcm f β£ a β β b β s, f b β£ a := by
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.lcm_dvd_iff Finset.lcm_dvd_iff
theorem lcm_dvd {a : Ξ±} : (β b β s, f b β£ a) β s.lcm f β£ a :=
lcm_dvd_iff.2
#align finset.lcm_dvd Finset.lcm_dvd
theorem dvd_lcm {b : Ξ²} (hb : b β s) : f b β£ s.lcm f :=
lcm_dvd_iff.1 dvd_rfl _ hb
#align finset.dvd_lcm Finset.dvd_lcm
@[simp]
theorem lcm_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).lcm f = GCDMonoid.lcm (f b) (s.lcm f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(lcm_eq_right_iff (f b) (s.lcm f) (Multiset.normalize_lcm (s.1.map f))).2 (dvd_lcm h)]
apply fold_insert h
#align finset.lcm_insert Finset.lcm_insert
@[simp]
theorem lcm_singleton {b : Ξ²} : ({b} : Finset Ξ²).lcm f = normalize (f b) :=
Multiset.lcm_singleton
#align finset.lcm_singleton Finset.lcm_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_lcm : normalize (s.lcm f) = s.lcm f := by simp [lcm_def]
#align finset.normalize_lcm Finset.normalize_lcm
theorem lcm_union [DecidableEq Ξ²] : (sβ βͺ sβ).lcm f = GCDMonoid.lcm (sβ.lcm f) (sβ.lcm f) :=
Finset.induction_on sβ (by rw [empty_union, lcm_empty, lcm_one_left, normalize_lcm])
fun a s _ ih β¦ by rw [insert_union, lcm_insert, lcm_insert, ih, lcm_assoc]
#align finset.lcm_union Finset.lcm_union
theorem lcm_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.lcm f = sβ.lcm g := by
subst hs
exact Finset.fold_congr hfg
#align finset.lcm_congr Finset.lcm_congr
theorem lcm_mono_fun {g : Ξ² β Ξ±} (h : β b β s, f b β£ g b) : s.lcm f β£ s.lcm g :=
lcm_dvd fun b hb β¦ (h b hb).trans (dvd_lcm hb)
#align finset.lcm_mono_fun Finset.lcm_mono_fun
theorem lcm_mono (h : sβ β sβ) : sβ.lcm f β£ sβ.lcm f :=
lcm_dvd fun _ hb β¦ dvd_lcm (h hb)
#align finset.lcm_mono Finset.lcm_mono
| Mathlib/Algebra/GCDMonoid/Finset.lean | 114 | 116 | theorem lcm_image [DecidableEq Ξ²] {g : Ξ³ β Ξ²} (s : Finset Ξ³) :
(s.image g).lcm f = s.lcm (f β g) := by |
classical induction' s using Finset.induction with c s _ ih <;> simp [*]
| 1 | 2.718282 | 0 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section lcm
def lcm (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.lcm 1 f
#align finset.lcm Finset.lcm
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem lcm_def : s.lcm f = (s.1.map f).lcm :=
rfl
#align finset.lcm_def Finset.lcm_def
@[simp]
theorem lcm_empty : (β
: Finset Ξ²).lcm f = 1 :=
fold_empty
#align finset.lcm_empty Finset.lcm_empty
@[simp]
theorem lcm_dvd_iff {a : Ξ±} : s.lcm f β£ a β β b β s, f b β£ a := by
apply Iff.trans Multiset.lcm_dvd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.lcm_dvd_iff Finset.lcm_dvd_iff
theorem lcm_dvd {a : Ξ±} : (β b β s, f b β£ a) β s.lcm f β£ a :=
lcm_dvd_iff.2
#align finset.lcm_dvd Finset.lcm_dvd
theorem dvd_lcm {b : Ξ²} (hb : b β s) : f b β£ s.lcm f :=
lcm_dvd_iff.1 dvd_rfl _ hb
#align finset.dvd_lcm Finset.dvd_lcm
@[simp]
theorem lcm_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).lcm f = GCDMonoid.lcm (f b) (s.lcm f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(lcm_eq_right_iff (f b) (s.lcm f) (Multiset.normalize_lcm (s.1.map f))).2 (dvd_lcm h)]
apply fold_insert h
#align finset.lcm_insert Finset.lcm_insert
@[simp]
theorem lcm_singleton {b : Ξ²} : ({b} : Finset Ξ²).lcm f = normalize (f b) :=
Multiset.lcm_singleton
#align finset.lcm_singleton Finset.lcm_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_lcm : normalize (s.lcm f) = s.lcm f := by simp [lcm_def]
#align finset.normalize_lcm Finset.normalize_lcm
theorem lcm_union [DecidableEq Ξ²] : (sβ βͺ sβ).lcm f = GCDMonoid.lcm (sβ.lcm f) (sβ.lcm f) :=
Finset.induction_on sβ (by rw [empty_union, lcm_empty, lcm_one_left, normalize_lcm])
fun a s _ ih β¦ by rw [insert_union, lcm_insert, lcm_insert, ih, lcm_assoc]
#align finset.lcm_union Finset.lcm_union
theorem lcm_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.lcm f = sβ.lcm g := by
subst hs
exact Finset.fold_congr hfg
#align finset.lcm_congr Finset.lcm_congr
theorem lcm_mono_fun {g : Ξ² β Ξ±} (h : β b β s, f b β£ g b) : s.lcm f β£ s.lcm g :=
lcm_dvd fun b hb β¦ (h b hb).trans (dvd_lcm hb)
#align finset.lcm_mono_fun Finset.lcm_mono_fun
theorem lcm_mono (h : sβ β sβ) : sβ.lcm f β£ sβ.lcm f :=
lcm_dvd fun _ hb β¦ dvd_lcm (h hb)
#align finset.lcm_mono Finset.lcm_mono
theorem lcm_image [DecidableEq Ξ²] {g : Ξ³ β Ξ²} (s : Finset Ξ³) :
(s.image g).lcm f = s.lcm (f β g) := by
classical induction' s using Finset.induction with c s _ ih <;> simp [*]
#align finset.lcm_image Finset.lcm_image
theorem lcm_eq_lcm_image [DecidableEq Ξ±] : s.lcm f = (s.image f).lcm id :=
Eq.symm <| lcm_image _
#align finset.lcm_eq_lcm_image Finset.lcm_eq_lcm_image
| Mathlib/Algebra/GCDMonoid/Finset.lean | 123 | 125 | theorem lcm_eq_zero_iff [Nontrivial Ξ±] : s.lcm f = 0 β 0 β f '' s := by |
simp only [Multiset.mem_map, lcm_def, Multiset.lcm_eq_zero_iff, Set.mem_image, mem_coe, β
Finset.mem_def]
| 2 | 7.389056 | 1 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
| Mathlib/Algebra/GCDMonoid/Finset.lean | 151 | 154 | theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by |
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
| 3 | 20.085537 | 1 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
| Mathlib/Algebra/GCDMonoid/Finset.lean | 166 | 171 | theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by |
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
| 4 | 54.59815 | 2 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
#align finset.gcd_insert Finset.gcd_insert
@[simp]
theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) :=
Multiset.gcd_singleton
#align finset.gcd_singleton Finset.gcd_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
| Mathlib/Algebra/GCDMonoid/Finset.lean | 181 | 181 | theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by | simp [gcd_def]
| 1 | 2.718282 | 0 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
#align finset.gcd_insert Finset.gcd_insert
@[simp]
theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) :=
Multiset.gcd_singleton
#align finset.gcd_singleton Finset.gcd_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by simp [gcd_def]
#align finset.normalize_gcd Finset.normalize_gcd
theorem gcd_union [DecidableEq Ξ²] : (sβ βͺ sβ).gcd f = GCDMonoid.gcd (sβ.gcd f) (sβ.gcd f) :=
Finset.induction_on sβ (by rw [empty_union, gcd_empty, gcd_zero_left, normalize_gcd])
fun a s _ ih β¦ by rw [insert_union, gcd_insert, gcd_insert, ih, gcd_assoc]
#align finset.gcd_union Finset.gcd_union
| Mathlib/Algebra/GCDMonoid/Finset.lean | 189 | 192 | theorem gcd_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.gcd f = sβ.gcd g := by |
subst hs
exact Finset.fold_congr hfg
| 2 | 7.389056 | 1 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
#align finset.gcd_insert Finset.gcd_insert
@[simp]
theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) :=
Multiset.gcd_singleton
#align finset.gcd_singleton Finset.gcd_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by simp [gcd_def]
#align finset.normalize_gcd Finset.normalize_gcd
theorem gcd_union [DecidableEq Ξ²] : (sβ βͺ sβ).gcd f = GCDMonoid.gcd (sβ.gcd f) (sβ.gcd f) :=
Finset.induction_on sβ (by rw [empty_union, gcd_empty, gcd_zero_left, normalize_gcd])
fun a s _ ih β¦ by rw [insert_union, gcd_insert, gcd_insert, ih, gcd_assoc]
#align finset.gcd_union Finset.gcd_union
theorem gcd_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.gcd f = sβ.gcd g := by
subst hs
exact Finset.fold_congr hfg
#align finset.gcd_congr Finset.gcd_congr
theorem gcd_mono_fun {g : Ξ² β Ξ±} (h : β b β s, f b β£ g b) : s.gcd f β£ s.gcd g :=
dvd_gcd fun b hb β¦ (gcd_dvd hb).trans (h b hb)
#align finset.gcd_mono_fun Finset.gcd_mono_fun
theorem gcd_mono (h : sβ β sβ) : sβ.gcd f β£ sβ.gcd f :=
dvd_gcd fun _ hb β¦ gcd_dvd (h hb)
#align finset.gcd_mono Finset.gcd_mono
| Mathlib/Algebra/GCDMonoid/Finset.lean | 203 | 205 | theorem gcd_image [DecidableEq Ξ²] {g : Ξ³ β Ξ²} (s : Finset Ξ³) :
(s.image g).gcd f = s.gcd (f β g) := by |
classical induction' s using Finset.induction with c s _ ih <;> simp [*]
| 1 | 2.718282 | 0 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
#align finset.gcd_insert Finset.gcd_insert
@[simp]
theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) :=
Multiset.gcd_singleton
#align finset.gcd_singleton Finset.gcd_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by simp [gcd_def]
#align finset.normalize_gcd Finset.normalize_gcd
theorem gcd_union [DecidableEq Ξ²] : (sβ βͺ sβ).gcd f = GCDMonoid.gcd (sβ.gcd f) (sβ.gcd f) :=
Finset.induction_on sβ (by rw [empty_union, gcd_empty, gcd_zero_left, normalize_gcd])
fun a s _ ih β¦ by rw [insert_union, gcd_insert, gcd_insert, ih, gcd_assoc]
#align finset.gcd_union Finset.gcd_union
theorem gcd_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.gcd f = sβ.gcd g := by
subst hs
exact Finset.fold_congr hfg
#align finset.gcd_congr Finset.gcd_congr
theorem gcd_mono_fun {g : Ξ² β Ξ±} (h : β b β s, f b β£ g b) : s.gcd f β£ s.gcd g :=
dvd_gcd fun b hb β¦ (gcd_dvd hb).trans (h b hb)
#align finset.gcd_mono_fun Finset.gcd_mono_fun
theorem gcd_mono (h : sβ β sβ) : sβ.gcd f β£ sβ.gcd f :=
dvd_gcd fun _ hb β¦ gcd_dvd (h hb)
#align finset.gcd_mono Finset.gcd_mono
theorem gcd_image [DecidableEq Ξ²] {g : Ξ³ β Ξ²} (s : Finset Ξ³) :
(s.image g).gcd f = s.gcd (f β g) := by
classical induction' s using Finset.induction with c s _ ih <;> simp [*]
#align finset.gcd_image Finset.gcd_image
theorem gcd_eq_gcd_image [DecidableEq Ξ±] : s.gcd f = (s.image f).gcd id :=
Eq.symm <| gcd_image _
#align finset.gcd_eq_gcd_image Finset.gcd_eq_gcd_image
| Mathlib/Algebra/GCDMonoid/Finset.lean | 212 | 223 | theorem gcd_eq_zero_iff : s.gcd f = 0 β β x : Ξ², x β s β f x = 0 := by |
rw [gcd_def, Multiset.gcd_eq_zero_iff]
constructor <;> intro h
Β· intro b bs
apply h (f b)
simp only [Multiset.mem_map, mem_def.1 bs]
use b
simp only [mem_def.1 bs, eq_self_iff_true, and_self]
Β· intro a as
rw [Multiset.mem_map] at as
rcases as with β¨b, β¨bs, rflβ©β©
apply h b (mem_def.1 bs)
| 11 | 59,874.141715 | 2 | 1 | 13 | 925 |
import Mathlib.Data.Finset.Fold
import Mathlib.Algebra.GCDMonoid.Multiset
#align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
#align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d"
variable {ΞΉ Ξ± Ξ² Ξ³ : Type*}
namespace Finset
open Multiset
variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±]
section gcd
def gcd (s : Finset Ξ²) (f : Ξ² β Ξ±) : Ξ± :=
s.fold GCDMonoid.gcd 0 f
#align finset.gcd Finset.gcd
variable {s sβ sβ : Finset Ξ²} {f : Ξ² β Ξ±}
theorem gcd_def : s.gcd f = (s.1.map f).gcd :=
rfl
#align finset.gcd_def Finset.gcd_def
@[simp]
theorem gcd_empty : (β
: Finset Ξ²).gcd f = 0 :=
fold_empty
#align finset.gcd_empty Finset.gcd_empty
theorem dvd_gcd_iff {a : Ξ±} : a β£ s.gcd f β β b β s, a β£ f b := by
apply Iff.trans Multiset.dvd_gcd
simp only [Multiset.mem_map, and_imp, exists_imp]
exact β¨fun k b hb β¦ k _ _ hb rfl, fun k a' b hb h β¦ h βΈ k _ hbβ©
#align finset.dvd_gcd_iff Finset.dvd_gcd_iff
theorem gcd_dvd {b : Ξ²} (hb : b β s) : s.gcd f β£ f b :=
dvd_gcd_iff.1 dvd_rfl _ hb
#align finset.gcd_dvd Finset.gcd_dvd
theorem dvd_gcd {a : Ξ±} : (β b β s, a β£ f b) β a β£ s.gcd f :=
dvd_gcd_iff.2
#align finset.dvd_gcd Finset.dvd_gcd
@[simp]
theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} :
(insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by
by_cases h : b β s
Β· rw [insert_eq_of_mem h,
(gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)]
apply fold_insert h
#align finset.gcd_insert Finset.gcd_insert
@[simp]
theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) :=
Multiset.gcd_singleton
#align finset.gcd_singleton Finset.gcd_singleton
-- Porting note: Priority changed for `simpNF`
@[simp 1100]
theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by simp [gcd_def]
#align finset.normalize_gcd Finset.normalize_gcd
theorem gcd_union [DecidableEq Ξ²] : (sβ βͺ sβ).gcd f = GCDMonoid.gcd (sβ.gcd f) (sβ.gcd f) :=
Finset.induction_on sβ (by rw [empty_union, gcd_empty, gcd_zero_left, normalize_gcd])
fun a s _ ih β¦ by rw [insert_union, gcd_insert, gcd_insert, ih, gcd_assoc]
#align finset.gcd_union Finset.gcd_union
theorem gcd_congr {f g : Ξ² β Ξ±} (hs : sβ = sβ) (hfg : β a β sβ, f a = g a) :
sβ.gcd f = sβ.gcd g := by
subst hs
exact Finset.fold_congr hfg
#align finset.gcd_congr Finset.gcd_congr
theorem gcd_mono_fun {g : Ξ² β Ξ±} (h : β b β s, f b β£ g b) : s.gcd f β£ s.gcd g :=
dvd_gcd fun b hb β¦ (gcd_dvd hb).trans (h b hb)
#align finset.gcd_mono_fun Finset.gcd_mono_fun
theorem gcd_mono (h : sβ β sβ) : sβ.gcd f β£ sβ.gcd f :=
dvd_gcd fun _ hb β¦ gcd_dvd (h hb)
#align finset.gcd_mono Finset.gcd_mono
theorem gcd_image [DecidableEq Ξ²] {g : Ξ³ β Ξ²} (s : Finset Ξ³) :
(s.image g).gcd f = s.gcd (f β g) := by
classical induction' s using Finset.induction with c s _ ih <;> simp [*]
#align finset.gcd_image Finset.gcd_image
theorem gcd_eq_gcd_image [DecidableEq Ξ±] : s.gcd f = (s.image f).gcd id :=
Eq.symm <| gcd_image _
#align finset.gcd_eq_gcd_image Finset.gcd_eq_gcd_image
theorem gcd_eq_zero_iff : s.gcd f = 0 β β x : Ξ², x β s β f x = 0 := by
rw [gcd_def, Multiset.gcd_eq_zero_iff]
constructor <;> intro h
Β· intro b bs
apply h (f b)
simp only [Multiset.mem_map, mem_def.1 bs]
use b
simp only [mem_def.1 bs, eq_self_iff_true, and_self]
Β· intro a as
rw [Multiset.mem_map] at as
rcases as with β¨b, β¨bs, rflβ©β©
apply h b (mem_def.1 bs)
#align finset.gcd_eq_zero_iff Finset.gcd_eq_zero_iff
| Mathlib/Algebra/GCDMonoid/Finset.lean | 228 | 241 | theorem gcd_eq_gcd_filter_ne_zero [DecidablePred fun x : Ξ² β¦ f x = 0] :
s.gcd f = (s.filter fun x β¦ f x β 0).gcd f := by |
classical
trans ((s.filter fun x β¦ f x = 0) βͺ s.filter fun x β¦ (f x β 0)).gcd f
Β· rw [filter_union_filter_neg_eq]
rw [gcd_union]
refine Eq.trans (?_ : _ = GCDMonoid.gcd (0 : Ξ±) ?_) (?_ : GCDMonoid.gcd (0 : Ξ±) _ = _)
Β· exact (gcd (filter (fun x => (f x β 0)) s) f)
Β· refine congr (congr rfl <| s.induction_on ?_ ?_) (by simp)
Β· simp
Β· intro a s _ h
rw [filter_insert]
split_ifs with h1 <;> simp [h, h1]
simp only [gcd_zero_left, normalize_gcd]
| 12 | 162,754.791419 | 2 | 1 | 13 | 925 |
import Mathlib.Topology.Algebra.UniformGroup
import Mathlib.Topology.UniformSpace.Pi
import Mathlib.Data.Matrix.Basic
#align_import topology.uniform_space.matrix from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Uniformity Topology
variable (m n π : Type*) [UniformSpace π]
namespace Matrix
instance instUniformSpace : UniformSpace (Matrix m n π) :=
(by infer_instance : UniformSpace (m β n β π))
instance instUniformAddGroup [AddGroup π] [UniformAddGroup π] :
UniformAddGroup (Matrix m n π) :=
inferInstanceAs <| UniformAddGroup (m β n β π)
| Mathlib/Topology/UniformSpace/Matrix.lean | 30 | 34 | theorem uniformity :
π€ (Matrix m n π) = β¨
(i : m) (j : n), (π€ π).comap fun a => (a.1 i j, a.2 i j) := by |
erw [Pi.uniformity]
simp_rw [Pi.uniformity, Filter.comap_iInf, Filter.comap_comap]
rfl
| 3 | 20.085537 | 1 | 1 | 2 | 926 |
import Mathlib.Topology.Algebra.UniformGroup
import Mathlib.Topology.UniformSpace.Pi
import Mathlib.Data.Matrix.Basic
#align_import topology.uniform_space.matrix from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open Uniformity Topology
variable (m n π : Type*) [UniformSpace π]
namespace Matrix
instance instUniformSpace : UniformSpace (Matrix m n π) :=
(by infer_instance : UniformSpace (m β n β π))
instance instUniformAddGroup [AddGroup π] [UniformAddGroup π] :
UniformAddGroup (Matrix m n π) :=
inferInstanceAs <| UniformAddGroup (m β n β π)
theorem uniformity :
π€ (Matrix m n π) = β¨
(i : m) (j : n), (π€ π).comap fun a => (a.1 i j, a.2 i j) := by
erw [Pi.uniformity]
simp_rw [Pi.uniformity, Filter.comap_iInf, Filter.comap_comap]
rfl
#align matrix.uniformity Matrix.uniformity
| Mathlib/Topology/UniformSpace/Matrix.lean | 37 | 40 | theorem uniformContinuous {Ξ² : Type*} [UniformSpace Ξ²] {f : Ξ² β Matrix m n π} :
UniformContinuous f β β i j, UniformContinuous fun x => f x i j := by |
simp only [UniformContinuous, Matrix.uniformity, Filter.tendsto_iInf, Filter.tendsto_comap_iff]
apply Iff.intro <;> intro a <;> apply a
| 2 | 7.389056 | 1 | 1 | 2 | 926 |
import Mathlib.Algebra.MonoidAlgebra.Basic
import Mathlib.LinearAlgebra.Basis.VectorSpace
import Mathlib.RingTheory.SimpleModule
#align_import representation_theory.maschke from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u v w
noncomputable section
open Module MonoidAlgebra
namespace LinearMap
-- At first we work with any `[CommRing k]`, and add the assumption that
-- `[Invertible (Fintype.card G : k)]` when it is required.
variable {k : Type u} [CommRing k] {G : Type u} [Group G]
variable {V : Type v} [AddCommGroup V] [Module k V] [Module (MonoidAlgebra k G) V]
variable [IsScalarTower k (MonoidAlgebra k G) V]
variable {W : Type w} [AddCommGroup W] [Module k W] [Module (MonoidAlgebra k G) W]
variable [IsScalarTower k (MonoidAlgebra k G) W]
variable (Ο : W ββ[k] V)
def conjugate (g : G) : W ββ[k] V :=
.comp (.comp (GroupSMul.linearMap k V gβ»ΒΉ) Ο) (GroupSMul.linearMap k W g)
#align linear_map.conjugate LinearMap.conjugate
theorem conjugate_apply (g : G) (v : W) :
Ο.conjugate g v = MonoidAlgebra.single gβ»ΒΉ (1 : k) β’ Ο (MonoidAlgebra.single g (1 : k) β’ v) :=
rfl
variable (i : V ββ[MonoidAlgebra k G] W) (h : β v : V, (Ο : W β V) (i v) = v)
section
| Mathlib/RepresentationTheory/Maschke.lean | 81 | 83 | theorem conjugate_i (g : G) (v : V) : (conjugate Ο g : W β V) (i v) = v := by |
rw [conjugate_apply, β i.map_smul, h, β mul_smul, single_mul_single, mul_one, mul_left_inv,
β one_def, one_smul]
| 2 | 7.389056 | 1 | 1 | 3 | 927 |
import Mathlib.Algebra.MonoidAlgebra.Basic
import Mathlib.LinearAlgebra.Basis.VectorSpace
import Mathlib.RingTheory.SimpleModule
#align_import representation_theory.maschke from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u v w
noncomputable section
open Module MonoidAlgebra
namespace LinearMap
-- At first we work with any `[CommRing k]`, and add the assumption that
-- `[Invertible (Fintype.card G : k)]` when it is required.
variable {k : Type u} [CommRing k] {G : Type u} [Group G]
variable {V : Type v} [AddCommGroup V] [Module k V] [Module (MonoidAlgebra k G) V]
variable [IsScalarTower k (MonoidAlgebra k G) V]
variable {W : Type w} [AddCommGroup W] [Module k W] [Module (MonoidAlgebra k G) W]
variable [IsScalarTower k (MonoidAlgebra k G) W]
variable (Ο : W ββ[k] V)
def conjugate (g : G) : W ββ[k] V :=
.comp (.comp (GroupSMul.linearMap k V gβ»ΒΉ) Ο) (GroupSMul.linearMap k W g)
#align linear_map.conjugate LinearMap.conjugate
theorem conjugate_apply (g : G) (v : W) :
Ο.conjugate g v = MonoidAlgebra.single gβ»ΒΉ (1 : k) β’ Ο (MonoidAlgebra.single g (1 : k) β’ v) :=
rfl
variable (i : V ββ[MonoidAlgebra k G] W) (h : β v : V, (Ο : W β V) (i v) = v)
section
theorem conjugate_i (g : G) (v : V) : (conjugate Ο g : W β V) (i v) = v := by
rw [conjugate_apply, β i.map_smul, h, β mul_smul, single_mul_single, mul_one, mul_left_inv,
β one_def, one_smul]
#align linear_map.conjugate_i LinearMap.conjugate_i
end
variable (G) [Fintype G]
def sumOfConjugates : W ββ[k] V :=
β g : G, Ο.conjugate g
#align linear_map.sum_of_conjugates LinearMap.sumOfConjugates
lemma sumOfConjugates_apply (v : W) : Ο.sumOfConjugates G v = β g : G, Ο.conjugate g v :=
LinearMap.sum_apply _ _ _
def sumOfConjugatesEquivariant : W ββ[MonoidAlgebra k G] V :=
MonoidAlgebra.equivariantOfLinearOfComm (Ο.sumOfConjugates G) fun g v => by
simp only [sumOfConjugates_apply, Finset.smul_sum, conjugate_apply]
refine Fintype.sum_bijective (Β· * g) (Group.mulRight_bijective g) _ _ fun i β¦ ?_
simp only [smul_smul, single_mul_single, mul_inv_rev, mul_inv_cancel_left, one_mul]
#align linear_map.sum_of_conjugates_equivariant LinearMap.sumOfConjugatesEquivariant
theorem sumOfConjugatesEquivariant_apply (v : W) :
Ο.sumOfConjugatesEquivariant G v = β g : G, Ο.conjugate g v :=
Ο.sumOfConjugates_apply G v
section
variable [Invertible (Fintype.card G : k)]
def equivariantProjection : W ββ[MonoidAlgebra k G] V :=
β
(Fintype.card G : k) β’ Ο.sumOfConjugatesEquivariant G
#align linear_map.equivariant_projection LinearMap.equivariantProjection
| Mathlib/RepresentationTheory/Maschke.lean | 125 | 127 | theorem equivariantProjection_apply (v : W) :
Ο.equivariantProjection G v = β
(Fintype.card G : k) β’ β g : G, Ο.conjugate g v := by |
simp only [equivariantProjection, smul_apply, sumOfConjugatesEquivariant_apply]
| 1 | 2.718282 | 0 | 1 | 3 | 927 |
import Mathlib.Algebra.MonoidAlgebra.Basic
import Mathlib.LinearAlgebra.Basis.VectorSpace
import Mathlib.RingTheory.SimpleModule
#align_import representation_theory.maschke from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
universe u v w
noncomputable section
open Module MonoidAlgebra
namespace LinearMap
-- At first we work with any `[CommRing k]`, and add the assumption that
-- `[Invertible (Fintype.card G : k)]` when it is required.
variable {k : Type u} [CommRing k] {G : Type u} [Group G]
variable {V : Type v} [AddCommGroup V] [Module k V] [Module (MonoidAlgebra k G) V]
variable [IsScalarTower k (MonoidAlgebra k G) V]
variable {W : Type w} [AddCommGroup W] [Module k W] [Module (MonoidAlgebra k G) W]
variable [IsScalarTower k (MonoidAlgebra k G) W]
variable (Ο : W ββ[k] V)
def conjugate (g : G) : W ββ[k] V :=
.comp (.comp (GroupSMul.linearMap k V gβ»ΒΉ) Ο) (GroupSMul.linearMap k W g)
#align linear_map.conjugate LinearMap.conjugate
theorem conjugate_apply (g : G) (v : W) :
Ο.conjugate g v = MonoidAlgebra.single gβ»ΒΉ (1 : k) β’ Ο (MonoidAlgebra.single g (1 : k) β’ v) :=
rfl
variable (i : V ββ[MonoidAlgebra k G] W) (h : β v : V, (Ο : W β V) (i v) = v)
section
theorem conjugate_i (g : G) (v : V) : (conjugate Ο g : W β V) (i v) = v := by
rw [conjugate_apply, β i.map_smul, h, β mul_smul, single_mul_single, mul_one, mul_left_inv,
β one_def, one_smul]
#align linear_map.conjugate_i LinearMap.conjugate_i
end
variable (G) [Fintype G]
def sumOfConjugates : W ββ[k] V :=
β g : G, Ο.conjugate g
#align linear_map.sum_of_conjugates LinearMap.sumOfConjugates
lemma sumOfConjugates_apply (v : W) : Ο.sumOfConjugates G v = β g : G, Ο.conjugate g v :=
LinearMap.sum_apply _ _ _
def sumOfConjugatesEquivariant : W ββ[MonoidAlgebra k G] V :=
MonoidAlgebra.equivariantOfLinearOfComm (Ο.sumOfConjugates G) fun g v => by
simp only [sumOfConjugates_apply, Finset.smul_sum, conjugate_apply]
refine Fintype.sum_bijective (Β· * g) (Group.mulRight_bijective g) _ _ fun i β¦ ?_
simp only [smul_smul, single_mul_single, mul_inv_rev, mul_inv_cancel_left, one_mul]
#align linear_map.sum_of_conjugates_equivariant LinearMap.sumOfConjugatesEquivariant
theorem sumOfConjugatesEquivariant_apply (v : W) :
Ο.sumOfConjugatesEquivariant G v = β g : G, Ο.conjugate g v :=
Ο.sumOfConjugates_apply G v
section
variable [Invertible (Fintype.card G : k)]
def equivariantProjection : W ββ[MonoidAlgebra k G] V :=
β
(Fintype.card G : k) β’ Ο.sumOfConjugatesEquivariant G
#align linear_map.equivariant_projection LinearMap.equivariantProjection
theorem equivariantProjection_apply (v : W) :
Ο.equivariantProjection G v = β
(Fintype.card G : k) β’ β g : G, Ο.conjugate g v := by
simp only [equivariantProjection, smul_apply, sumOfConjugatesEquivariant_apply]
| Mathlib/RepresentationTheory/Maschke.lean | 129 | 133 | theorem equivariantProjection_condition (v : V) : (Ο.equivariantProjection G) (i v) = v := by |
rw [equivariantProjection_apply]
simp only [conjugate_i Ο i h]
rw [Finset.sum_const, Finset.card_univ, nsmul_eq_smul_cast k, smul_smul,
Invertible.invOf_mul_self, one_smul]
| 4 | 54.59815 | 2 | 1 | 3 | 927 |
import Mathlib.Topology.UniformSpace.UniformEmbedding
#align_import topology.uniform_space.pi from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9"
noncomputable section
open scoped Uniformity Topology
open Filter UniformSpace Function Set
universe u
variable {ΞΉ ΞΉ' Ξ² : Type*} (Ξ± : ΞΉ β Type u) [U : β i, UniformSpace (Ξ± i)] [UniformSpace Ξ²]
instance Pi.uniformSpace : UniformSpace (β i, Ξ± i) :=
UniformSpace.ofCoreEq (β¨
i, UniformSpace.comap (eval i) (U i)).toCore
Pi.topologicalSpace <|
Eq.symm toTopologicalSpace_iInf
#align Pi.uniform_space Pi.uniformSpace
lemma Pi.uniformSpace_eq :
Pi.uniformSpace Ξ± = β¨
i, UniformSpace.comap (eval i) (U i) := by
ext : 1; rfl
theorem Pi.uniformity :
π€ (β i, Ξ± i) = β¨
i : ΞΉ, (Filter.comap fun a => (a.1 i, a.2 i)) (π€ (Ξ± i)) :=
iInf_uniformity
#align Pi.uniformity Pi.uniformity
variable {Ξ±}
instance [Countable ΞΉ] [β i, IsCountablyGenerated (π€ (Ξ± i))] :
IsCountablyGenerated (π€ (β i, Ξ± i)) := by
rw [Pi.uniformity]
infer_instance
| Mathlib/Topology/UniformSpace/Pi.lean | 46 | 49 | theorem uniformContinuous_pi {Ξ² : Type*} [UniformSpace Ξ²] {f : Ξ² β β i, Ξ± i} :
UniformContinuous f β β i, UniformContinuous fun x => f x i := by |
-- Porting note: required `Function.comp` to close
simp only [UniformContinuous, Pi.uniformity, tendsto_iInf, tendsto_comap_iff, Function.comp]
| 2 | 7.389056 | 1 | 1 | 1 | 928 |
import Mathlib.CategoryTheory.Closed.Monoidal
import Mathlib.CategoryTheory.Linear.Yoneda
import Mathlib.Algebra.Category.ModuleCat.Monoidal.Symmetric
#align_import algebra.category.Module.monoidal.closed from "leanprover-community/mathlib"@"74403a3b2551b0970855e14ef5e8fd0d6af1bfc2"
suppress_compilation
universe v w x u
open CategoryTheory Opposite
namespace ModuleCat
variable {R : Type u} [CommRing R]
-- Porting note: removed @[simps] as the simpNF linter complains
def monoidalClosedHomEquiv (M N P : ModuleCat.{u} R) :
((MonoidalCategory.tensorLeft M).obj N βΆ P) β
(N βΆ ((linearCoyoneda R (ModuleCat R)).obj (op M)).obj P) where
toFun f := LinearMap.comprβ (TensorProduct.mk R N M) ((Ξ²_ N M).hom β« f)
invFun f := (Ξ²_ M N).hom β« TensorProduct.lift f
left_inv f := by
apply TensorProduct.ext'
intro m n
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [coe_comp]
rw [Function.comp_apply]
-- This used to be `rw` and was longer (?), but we need `erw` after leanprover/lean4#2644
erw [MonoidalCategory.braiding_hom_apply, TensorProduct.lift.tmul]
right_inv f := rfl
set_option linter.uppercaseLean3 false in
#align Module.monoidal_closed_hom_equiv ModuleCat.monoidalClosedHomEquiv
instance : MonoidalClosed (ModuleCat.{u} R) where
closed M :=
{ rightAdj := (linearCoyoneda R (ModuleCat.{u} R)).obj (op M)
adj := Adjunction.mkOfHomEquiv
{ homEquiv := fun N P => monoidalClosedHomEquiv M N P
-- Porting note: this proof was automatic in mathlib3
homEquiv_naturality_left_symm := by
intros
apply TensorProduct.ext'
intro m n
rfl } }
theorem ihom_map_apply {M N P : ModuleCat.{u} R} (f : N βΆ P) (g : ModuleCat.of R (M βΆ N)) :
(ihom M).map f g = g β« f :=
rfl
set_option linter.uppercaseLean3 false in
#align Module.ihom_map_apply ModuleCat.ihom_map_apply
open MonoidalCategory
-- Porting note: `CoeFun` was replaced by `DFunLike`
-- I can't seem to express the function coercion here without writing `@DFunLike.coe`.
theorem monoidalClosed_curry {M N P : ModuleCat.{u} R} (f : M β N βΆ P) (x : M) (y : N) :
@DFunLike.coe _ _ _ LinearMap.instFunLike
((MonoidalClosed.curry f : N ββ[R] M ββ[R] P) y) x = f (x ββ[R] y) :=
rfl
set_option linter.uppercaseLean3 false in
#align Module.monoidal_closed_curry ModuleCat.monoidalClosed_curry
@[simp]
theorem monoidalClosed_uncurry
{M N P : ModuleCat.{u} R} (f : N βΆ M βΆ[ModuleCat.{u} R] P) (x : M) (y : N) :
MonoidalClosed.uncurry f (x ββ[R] y) =
@DFunLike.coe _ _ _ LinearMap.instFunLike (f y) x :=
rfl
set_option linter.uppercaseLean3 false in
#align Module.monoidal_closed_uncurry ModuleCat.monoidalClosed_uncurry
| Mathlib/Algebra/Category/ModuleCat/Monoidal/Closed.lean | 88 | 91 | theorem ihom_ev_app (M N : ModuleCat.{u} R) :
(ihom.ev M).app N = TensorProduct.uncurry _ _ _ _ LinearMap.id.flip := by |
apply TensorProduct.ext'
apply ModuleCat.monoidalClosed_uncurry
| 2 | 7.389056 | 1 | 1 | 1 | 929 |
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.Images
import Mathlib.CategoryTheory.IsomorphismClasses
import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
#align_import category_theory.limits.shapes.zero_morphisms from "leanprover-community/mathlib"@"f7707875544ef1f81b32cb68c79e0e24e45a0e76"
noncomputable section
universe v u
universe v' u'
open CategoryTheory
open CategoryTheory.Category
open scoped Classical
namespace CategoryTheory.Limits
variable (C : Type u) [Category.{v} C]
variable (D : Type u') [Category.{v'} D]
class HasZeroMorphisms where
[zero : β X Y : C, Zero (X βΆ Y)]
comp_zero : β {X Y : C} (f : X βΆ Y) (Z : C), f β« (0 : Y βΆ Z) = (0 : X βΆ Z) := by aesop_cat
zero_comp : β (X : C) {Y Z : C} (f : Y βΆ Z), (0 : X βΆ Y) β« f = (0 : X βΆ Z) := by aesop_cat
#align category_theory.limits.has_zero_morphisms CategoryTheory.Limits.HasZeroMorphisms
#align category_theory.limits.has_zero_morphisms.comp_zero' CategoryTheory.Limits.HasZeroMorphisms.comp_zero
#align category_theory.limits.has_zero_morphisms.zero_comp' CategoryTheory.Limits.HasZeroMorphisms.zero_comp
attribute [instance] HasZeroMorphisms.zero
variable {C}
@[simp]
theorem comp_zero [HasZeroMorphisms C] {X Y : C} {f : X βΆ Y} {Z : C} :
f β« (0 : Y βΆ Z) = (0 : X βΆ Z) :=
HasZeroMorphisms.comp_zero f Z
#align category_theory.limits.comp_zero CategoryTheory.Limits.comp_zero
@[simp]
theorem zero_comp [HasZeroMorphisms C] {X : C} {Y Z : C} {f : Y βΆ Z} :
(0 : X βΆ Y) β« f = (0 : X βΆ Z) :=
HasZeroMorphisms.zero_comp X f
#align category_theory.limits.zero_comp CategoryTheory.Limits.zero_comp
instance hasZeroMorphismsPEmpty : HasZeroMorphisms (Discrete PEmpty) where
zero := by aesop_cat
#align category_theory.limits.has_zero_morphisms_pempty CategoryTheory.Limits.hasZeroMorphismsPEmpty
instance hasZeroMorphismsPUnit : HasZeroMorphisms (Discrete PUnit) where
zero X Y := by repeat (constructor)
#align category_theory.limits.has_zero_morphisms_punit CategoryTheory.Limits.hasZeroMorphismsPUnit
namespace HasZeroMorphisms
private theorem ext_aux (I J : HasZeroMorphisms C)
(w : β X Y : C, (I.zero X Y).zero = (J.zero X Y).zero) : I = J := by
have : I.zero = J.zero := by
funext X Y
specialize w X Y
apply congrArg Zero.mk w
cases I; cases J
congr
Β· apply proof_irrel_heq
Β· apply proof_irrel_heq
-- Porting note: private def; no align
| Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean | 106 | 113 | theorem ext (I J : HasZeroMorphisms C) : I = J := by |
apply ext_aux
intro X Y
have : (I.zero X Y).zero β« (J.zero Y Y).zero = (I.zero X Y).zero := by
apply I.zero_comp X (J.zero Y Y).zero
have that : (I.zero X Y).zero β« (J.zero Y Y).zero = (J.zero X Y).zero := by
apply J.comp_zero (I.zero X Y).zero Y
rw [β this, β that]
| 7 | 1,096.633158 | 2 | 1 | 4 | 930 |
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.Images
import Mathlib.CategoryTheory.IsomorphismClasses
import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
#align_import category_theory.limits.shapes.zero_morphisms from "leanprover-community/mathlib"@"f7707875544ef1f81b32cb68c79e0e24e45a0e76"
noncomputable section
universe v u
universe v' u'
open CategoryTheory
open CategoryTheory.Category
open scoped Classical
namespace CategoryTheory.Limits
variable (C : Type u) [Category.{v} C]
variable (D : Type u') [Category.{v'} D]
class HasZeroMorphisms where
[zero : β X Y : C, Zero (X βΆ Y)]
comp_zero : β {X Y : C} (f : X βΆ Y) (Z : C), f β« (0 : Y βΆ Z) = (0 : X βΆ Z) := by aesop_cat
zero_comp : β (X : C) {Y Z : C} (f : Y βΆ Z), (0 : X βΆ Y) β« f = (0 : X βΆ Z) := by aesop_cat
#align category_theory.limits.has_zero_morphisms CategoryTheory.Limits.HasZeroMorphisms
#align category_theory.limits.has_zero_morphisms.comp_zero' CategoryTheory.Limits.HasZeroMorphisms.comp_zero
#align category_theory.limits.has_zero_morphisms.zero_comp' CategoryTheory.Limits.HasZeroMorphisms.zero_comp
attribute [instance] HasZeroMorphisms.zero
variable {C}
@[simp]
theorem comp_zero [HasZeroMorphisms C] {X Y : C} {f : X βΆ Y} {Z : C} :
f β« (0 : Y βΆ Z) = (0 : X βΆ Z) :=
HasZeroMorphisms.comp_zero f Z
#align category_theory.limits.comp_zero CategoryTheory.Limits.comp_zero
@[simp]
theorem zero_comp [HasZeroMorphisms C] {X : C} {Y Z : C} {f : Y βΆ Z} :
(0 : X βΆ Y) β« f = (0 : X βΆ Z) :=
HasZeroMorphisms.zero_comp X f
#align category_theory.limits.zero_comp CategoryTheory.Limits.zero_comp
instance hasZeroMorphismsPEmpty : HasZeroMorphisms (Discrete PEmpty) where
zero := by aesop_cat
#align category_theory.limits.has_zero_morphisms_pempty CategoryTheory.Limits.hasZeroMorphismsPEmpty
instance hasZeroMorphismsPUnit : HasZeroMorphisms (Discrete PUnit) where
zero X Y := by repeat (constructor)
#align category_theory.limits.has_zero_morphisms_punit CategoryTheory.Limits.hasZeroMorphismsPUnit
open Opposite HasZeroMorphisms
instance hasZeroMorphismsOpposite [HasZeroMorphisms C] : HasZeroMorphisms Cα΅α΅ where
zero X Y := β¨(0 : unop Y βΆ unop X).opβ©
comp_zero f Z := congr_arg Quiver.Hom.op (HasZeroMorphisms.zero_comp (unop Z) f.unop)
zero_comp X {Y Z} (f : Y βΆ Z) :=
congrArg Quiver.Hom.op (HasZeroMorphisms.comp_zero f.unop (unop X))
#align category_theory.limits.has_zero_morphisms_opposite CategoryTheory.Limits.hasZeroMorphismsOpposite
section
variable [HasZeroMorphisms C]
@[simp] lemma op_zero (X Y : C) : (0 : X βΆ Y).op = 0 := rfl
#align category_theory.op_zero CategoryTheory.Limits.op_zero
@[simp] lemma unop_zero (X Y : Cα΅α΅) : (0 : X βΆ Y).unop = 0 := rfl
#align category_theory.unop_zero CategoryTheory.Limits.unop_zero
| Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean | 140 | 142 | theorem zero_of_comp_mono {X Y Z : C} {f : X βΆ Y} (g : Y βΆ Z) [Mono g] (h : f β« g = 0) : f = 0 := by |
rw [β zero_comp, cancel_mono] at h
exact h
| 2 | 7.389056 | 1 | 1 | 4 | 930 |
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.Images
import Mathlib.CategoryTheory.IsomorphismClasses
import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
#align_import category_theory.limits.shapes.zero_morphisms from "leanprover-community/mathlib"@"f7707875544ef1f81b32cb68c79e0e24e45a0e76"
noncomputable section
universe v u
universe v' u'
open CategoryTheory
open CategoryTheory.Category
open scoped Classical
namespace CategoryTheory.Limits
variable (C : Type u) [Category.{v} C]
variable (D : Type u') [Category.{v'} D]
class HasZeroMorphisms where
[zero : β X Y : C, Zero (X βΆ Y)]
comp_zero : β {X Y : C} (f : X βΆ Y) (Z : C), f β« (0 : Y βΆ Z) = (0 : X βΆ Z) := by aesop_cat
zero_comp : β (X : C) {Y Z : C} (f : Y βΆ Z), (0 : X βΆ Y) β« f = (0 : X βΆ Z) := by aesop_cat
#align category_theory.limits.has_zero_morphisms CategoryTheory.Limits.HasZeroMorphisms
#align category_theory.limits.has_zero_morphisms.comp_zero' CategoryTheory.Limits.HasZeroMorphisms.comp_zero
#align category_theory.limits.has_zero_morphisms.zero_comp' CategoryTheory.Limits.HasZeroMorphisms.zero_comp
attribute [instance] HasZeroMorphisms.zero
variable {C}
@[simp]
theorem comp_zero [HasZeroMorphisms C] {X Y : C} {f : X βΆ Y} {Z : C} :
f β« (0 : Y βΆ Z) = (0 : X βΆ Z) :=
HasZeroMorphisms.comp_zero f Z
#align category_theory.limits.comp_zero CategoryTheory.Limits.comp_zero
@[simp]
theorem zero_comp [HasZeroMorphisms C] {X : C} {Y Z : C} {f : Y βΆ Z} :
(0 : X βΆ Y) β« f = (0 : X βΆ Z) :=
HasZeroMorphisms.zero_comp X f
#align category_theory.limits.zero_comp CategoryTheory.Limits.zero_comp
instance hasZeroMorphismsPEmpty : HasZeroMorphisms (Discrete PEmpty) where
zero := by aesop_cat
#align category_theory.limits.has_zero_morphisms_pempty CategoryTheory.Limits.hasZeroMorphismsPEmpty
instance hasZeroMorphismsPUnit : HasZeroMorphisms (Discrete PUnit) where
zero X Y := by repeat (constructor)
#align category_theory.limits.has_zero_morphisms_punit CategoryTheory.Limits.hasZeroMorphismsPUnit
open Opposite HasZeroMorphisms
instance hasZeroMorphismsOpposite [HasZeroMorphisms C] : HasZeroMorphisms Cα΅α΅ where
zero X Y := β¨(0 : unop Y βΆ unop X).opβ©
comp_zero f Z := congr_arg Quiver.Hom.op (HasZeroMorphisms.zero_comp (unop Z) f.unop)
zero_comp X {Y Z} (f : Y βΆ Z) :=
congrArg Quiver.Hom.op (HasZeroMorphisms.comp_zero f.unop (unop X))
#align category_theory.limits.has_zero_morphisms_opposite CategoryTheory.Limits.hasZeroMorphismsOpposite
section
variable [HasZeroMorphisms C]
@[simp] lemma op_zero (X Y : C) : (0 : X βΆ Y).op = 0 := rfl
#align category_theory.op_zero CategoryTheory.Limits.op_zero
@[simp] lemma unop_zero (X Y : Cα΅α΅) : (0 : X βΆ Y).unop = 0 := rfl
#align category_theory.unop_zero CategoryTheory.Limits.unop_zero
theorem zero_of_comp_mono {X Y Z : C} {f : X βΆ Y} (g : Y βΆ Z) [Mono g] (h : f β« g = 0) : f = 0 := by
rw [β zero_comp, cancel_mono] at h
exact h
#align category_theory.limits.zero_of_comp_mono CategoryTheory.Limits.zero_of_comp_mono
| Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean | 145 | 147 | theorem zero_of_epi_comp {X Y Z : C} (f : X βΆ Y) {g : Y βΆ Z} [Epi f] (h : f β« g = 0) : g = 0 := by |
rw [β comp_zero, cancel_epi] at h
exact h
| 2 | 7.389056 | 1 | 1 | 4 | 930 |
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Products
import Mathlib.CategoryTheory.Limits.Shapes.Images
import Mathlib.CategoryTheory.IsomorphismClasses
import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
#align_import category_theory.limits.shapes.zero_morphisms from "leanprover-community/mathlib"@"f7707875544ef1f81b32cb68c79e0e24e45a0e76"
noncomputable section
universe v u
universe v' u'
open CategoryTheory
open CategoryTheory.Category
open scoped Classical
namespace CategoryTheory.Limits
variable (C : Type u) [Category.{v} C]
variable (D : Type u') [Category.{v'} D]
class HasZeroMorphisms where
[zero : β X Y : C, Zero (X βΆ Y)]
comp_zero : β {X Y : C} (f : X βΆ Y) (Z : C), f β« (0 : Y βΆ Z) = (0 : X βΆ Z) := by aesop_cat
zero_comp : β (X : C) {Y Z : C} (f : Y βΆ Z), (0 : X βΆ Y) β« f = (0 : X βΆ Z) := by aesop_cat
#align category_theory.limits.has_zero_morphisms CategoryTheory.Limits.HasZeroMorphisms
#align category_theory.limits.has_zero_morphisms.comp_zero' CategoryTheory.Limits.HasZeroMorphisms.comp_zero
#align category_theory.limits.has_zero_morphisms.zero_comp' CategoryTheory.Limits.HasZeroMorphisms.zero_comp
attribute [instance] HasZeroMorphisms.zero
variable {C}
@[simp]
theorem comp_zero [HasZeroMorphisms C] {X Y : C} {f : X βΆ Y} {Z : C} :
f β« (0 : Y βΆ Z) = (0 : X βΆ Z) :=
HasZeroMorphisms.comp_zero f Z
#align category_theory.limits.comp_zero CategoryTheory.Limits.comp_zero
@[simp]
theorem zero_comp [HasZeroMorphisms C] {X : C} {Y Z : C} {f : Y βΆ Z} :
(0 : X βΆ Y) β« f = (0 : X βΆ Z) :=
HasZeroMorphisms.zero_comp X f
#align category_theory.limits.zero_comp CategoryTheory.Limits.zero_comp
instance hasZeroMorphismsPEmpty : HasZeroMorphisms (Discrete PEmpty) where
zero := by aesop_cat
#align category_theory.limits.has_zero_morphisms_pempty CategoryTheory.Limits.hasZeroMorphismsPEmpty
instance hasZeroMorphismsPUnit : HasZeroMorphisms (Discrete PUnit) where
zero X Y := by repeat (constructor)
#align category_theory.limits.has_zero_morphisms_punit CategoryTheory.Limits.hasZeroMorphismsPUnit
open Opposite HasZeroMorphisms
instance hasZeroMorphismsOpposite [HasZeroMorphisms C] : HasZeroMorphisms Cα΅α΅ where
zero X Y := β¨(0 : unop Y βΆ unop X).opβ©
comp_zero f Z := congr_arg Quiver.Hom.op (HasZeroMorphisms.zero_comp (unop Z) f.unop)
zero_comp X {Y Z} (f : Y βΆ Z) :=
congrArg Quiver.Hom.op (HasZeroMorphisms.comp_zero f.unop (unop X))
#align category_theory.limits.has_zero_morphisms_opposite CategoryTheory.Limits.hasZeroMorphismsOpposite
section
variable [HasZeroMorphisms C]
@[simp] lemma op_zero (X Y : C) : (0 : X βΆ Y).op = 0 := rfl
#align category_theory.op_zero CategoryTheory.Limits.op_zero
@[simp] lemma unop_zero (X Y : Cα΅α΅) : (0 : X βΆ Y).unop = 0 := rfl
#align category_theory.unop_zero CategoryTheory.Limits.unop_zero
theorem zero_of_comp_mono {X Y Z : C} {f : X βΆ Y} (g : Y βΆ Z) [Mono g] (h : f β« g = 0) : f = 0 := by
rw [β zero_comp, cancel_mono] at h
exact h
#align category_theory.limits.zero_of_comp_mono CategoryTheory.Limits.zero_of_comp_mono
theorem zero_of_epi_comp {X Y Z : C} (f : X βΆ Y) {g : Y βΆ Z} [Epi f] (h : f β« g = 0) : g = 0 := by
rw [β comp_zero, cancel_epi] at h
exact h
#align category_theory.limits.zero_of_epi_comp CategoryTheory.Limits.zero_of_epi_comp
| Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean | 150 | 151 | theorem eq_zero_of_image_eq_zero {X Y : C} {f : X βΆ Y} [HasImage f] (w : image.ΞΉ f = 0) :
f = 0 := by | rw [β image.fac f, w, HasZeroMorphisms.comp_zero]
| 1 | 2.718282 | 0 | 1 | 4 | 930 |
import Mathlib.Geometry.RingedSpace.PresheafedSpace
import Mathlib.Topology.Category.TopCat.Limits.Basic
import Mathlib.Topology.Sheaves.Limits
import Mathlib.CategoryTheory.ConcreteCategory.Elementwise
#align_import algebraic_geometry.presheafed_space.has_colimits from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
noncomputable section
universe v' u' v u
open CategoryTheory Opposite CategoryTheory.Category CategoryTheory.Functor CategoryTheory.Limits
TopCat TopCat.Presheaf TopologicalSpace
variable {J : Type u'} [Category.{v'} J] {C : Type u} [Category.{v} C]
namespace AlgebraicGeometry
namespace PresheafedSpace
attribute [local simp] eqToHom_map
-- Porting note: we used to have:
-- local attribute [tidy] tactic.auto_cases_opens
-- We would replace this by:
-- attribute [local aesop safe cases (rule_sets := [CategoryTheory])] Opens
-- although it doesn't appear to help in this file, in any case.
@[simp]
| Mathlib/Geometry/RingedSpace/PresheafedSpace/HasColimits.lean | 59 | 65 | theorem map_id_c_app (F : J β₯€ PresheafedSpace.{_, _, v} C) (j) (U) :
(F.map (π j)).c.app (op U) =
(Pushforward.id (F.obj j).presheaf).inv.app (op U) β«
(pushforwardEq (by simp) (F.obj j).presheaf).hom.app
(op U) := by |
cases U
simp [PresheafedSpace.congr_app (F.map_id j)]
| 2 | 7.389056 | 1 | 1 | 2 | 931 |
import Mathlib.Geometry.RingedSpace.PresheafedSpace
import Mathlib.Topology.Category.TopCat.Limits.Basic
import Mathlib.Topology.Sheaves.Limits
import Mathlib.CategoryTheory.ConcreteCategory.Elementwise
#align_import algebraic_geometry.presheafed_space.has_colimits from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
noncomputable section
universe v' u' v u
open CategoryTheory Opposite CategoryTheory.Category CategoryTheory.Functor CategoryTheory.Limits
TopCat TopCat.Presheaf TopologicalSpace
variable {J : Type u'} [Category.{v'} J] {C : Type u} [Category.{v} C]
namespace AlgebraicGeometry
namespace PresheafedSpace
attribute [local simp] eqToHom_map
-- Porting note: we used to have:
-- local attribute [tidy] tactic.auto_cases_opens
-- We would replace this by:
-- attribute [local aesop safe cases (rule_sets := [CategoryTheory])] Opens
-- although it doesn't appear to help in this file, in any case.
@[simp]
theorem map_id_c_app (F : J β₯€ PresheafedSpace.{_, _, v} C) (j) (U) :
(F.map (π j)).c.app (op U) =
(Pushforward.id (F.obj j).presheaf).inv.app (op U) β«
(pushforwardEq (by simp) (F.obj j).presheaf).hom.app
(op U) := by
cases U
simp [PresheafedSpace.congr_app (F.map_id j)]
set_option linter.uppercaseLean3 false in
#align algebraic_geometry.PresheafedSpace.map_id_c_app AlgebraicGeometry.PresheafedSpace.map_id_c_app
@[simp]
| Mathlib/Geometry/RingedSpace/PresheafedSpace/HasColimits.lean | 70 | 79 | theorem map_comp_c_app (F : J β₯€ PresheafedSpace.{_, _, v} C) {jβ jβ jβ}
(f : jβ βΆ jβ) (g : jβ βΆ jβ) (U) :
(F.map (f β« g)).c.app (op U) =
(F.map g).c.app (op U) β«
(pushforwardMap (F.map g).base (F.map f).c).app (op U) β«
(Pushforward.comp (F.obj jβ).presheaf (F.map f).base (F.map g).base).inv.app (op U) β«
(pushforwardEq (by rw [F.map_comp]; rfl) _).hom.app
_ := by |
cases U
simp [PresheafedSpace.congr_app (F.map_comp f g)]
| 2 | 7.389056 | 1 | 1 | 2 | 931 |
import Mathlib.Topology.Algebra.Module.Basic
import Mathlib.LinearAlgebra.BilinearMap
#align_import topology.algebra.module.weak_dual from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open Filter
open Topology
variable {Ξ± π π R E F M : Type*}
section WeakTopology
@[nolint unusedArguments]
def WeakBilin [CommSemiring π] [AddCommMonoid E] [Module π E] [AddCommMonoid F] [Module π F]
(_ : E ββ[π] F ββ[π] π) := E
#align weak_bilin WeakBilin
namespace WeakBilin
-- Porting note: the next two instances should be derived from the definition
instance instAddCommMonoid [CommSemiring π] [a : AddCommMonoid E] [Module π E] [AddCommMonoid F]
[Module π F] (B : E ββ[π] F ββ[π] π) : AddCommMonoid (WeakBilin B) := a
instance instModule [CommSemiring π] [AddCommMonoid E] [m : Module π E] [AddCommMonoid F]
[Module π F] (B : E ββ[π] F ββ[π] π) : Module π (WeakBilin B) := m
instance instAddCommGroup [CommSemiring π] [a : AddCommGroup E] [Module π E] [AddCommMonoid F]
[Module π F] (B : E ββ[π] F ββ[π] π) : AddCommGroup (WeakBilin B) := a
instance (priority := 100) instModule' [CommSemiring π] [CommSemiring π] [AddCommGroup E]
[Module π E] [AddCommGroup F] [Module π F] [m : Module π E] (B : E ββ[π] F ββ[π] π) :
Module π (WeakBilin B) := m
#align weak_bilin.module' WeakBilin.instModule'
instance instIsScalarTower [CommSemiring π] [CommSemiring π] [AddCommGroup E] [Module π E]
[AddCommGroup F] [Module π F] [SMul π π] [Module π E] [s : IsScalarTower π π E]
(B : E ββ[π] F ββ[π] π) : IsScalarTower π π (WeakBilin B) := s
section Semiring
variable [TopologicalSpace π] [CommSemiring π]
variable [AddCommMonoid E] [Module π E]
variable [AddCommMonoid F] [Module π F]
variable (B : E ββ[π] F ββ[π] π)
instance instTopologicalSpace : TopologicalSpace (WeakBilin B) :=
TopologicalSpace.induced (fun x y => B x y) Pi.topologicalSpace
theorem coeFn_continuous : Continuous fun (x : WeakBilin B) y => B x y :=
continuous_induced_dom
#align weak_bilin.coe_fn_continuous WeakBilin.coeFn_continuous
theorem eval_continuous (y : F) : Continuous fun x : WeakBilin B => B x y :=
(continuous_pi_iff.mp (coeFn_continuous B)) y
#align weak_bilin.eval_continuous WeakBilin.eval_continuous
theorem continuous_of_continuous_eval [TopologicalSpace Ξ±] {g : Ξ± β WeakBilin B}
(h : β y, Continuous fun a => B (g a) y) : Continuous g :=
continuous_induced_rng.2 (continuous_pi_iff.mpr h)
#align weak_bilin.continuous_of_continuous_eval WeakBilin.continuous_of_continuous_eval
theorem embedding {B : E ββ[π] F ββ[π] π} (hB : Function.Injective B) :
Embedding fun (x : WeakBilin B) y => B x y :=
Function.Injective.embedding_induced <| LinearMap.coe_injective.comp hB
#align weak_bilin.embedding WeakBilin.embedding
| Mathlib/Topology/Algebra/Module/WeakDual.lean | 133 | 137 | theorem tendsto_iff_forall_eval_tendsto {l : Filter Ξ±} {f : Ξ± β WeakBilin B} {x : WeakBilin B}
(hB : Function.Injective B) :
Tendsto f l (π x) β β y, Tendsto (fun i => B (f i) y) l (π (B x y)) := by |
rw [β tendsto_pi_nhds, Embedding.tendsto_nhds_iff (embedding hB)]
rfl
| 2 | 7.389056 | 1 | 1 | 1 | 932 |
import Mathlib.Algebra.GroupWithZero.Divisibility
import Mathlib.Algebra.MonoidAlgebra.Basic
import Mathlib.Data.Finset.Sort
#align_import data.polynomial.basic from "leanprover-community/mathlib"@"949dc57e616a621462062668c9f39e4e17b64b69"
set_option linter.uppercaseLean3 false
noncomputable section
structure Polynomial (R : Type*) [Semiring R] where ofFinsupp ::
toFinsupp : AddMonoidAlgebra R β
#align polynomial Polynomial
#align polynomial.of_finsupp Polynomial.ofFinsupp
#align polynomial.to_finsupp Polynomial.toFinsupp
@[inherit_doc] scoped[Polynomial] notation:9000 R "[X]" => Polynomial R
open AddMonoidAlgebra
open Finsupp hiding single
open Function hiding Commute
open Polynomial
namespace Polynomial
universe u
variable {R : Type u} {a b : R} {m n : β}
section Semiring
variable [Semiring R] {p q : R[X]}
theorem forall_iff_forall_finsupp (P : R[X] β Prop) :
(β p, P p) β β q : R[β], P β¨qβ© :=
β¨fun h q => h β¨qβ©, fun h β¨pβ© => h pβ©
#align polynomial.forall_iff_forall_finsupp Polynomial.forall_iff_forall_finsupp
theorem exists_iff_exists_finsupp (P : R[X] β Prop) :
(β p, P p) β β q : R[β], P β¨qβ© :=
β¨fun β¨β¨pβ©, hpβ© => β¨p, hpβ©, fun β¨q, hqβ© => β¨β¨qβ©, hqβ©β©
#align polynomial.exists_iff_exists_finsupp Polynomial.exists_iff_exists_finsupp
@[simp]
| Mathlib/Algebra/Polynomial/Basic.lean | 98 | 98 | theorem eta (f : R[X]) : Polynomial.ofFinsupp f.toFinsupp = f := by | cases f; rfl
| 1 | 2.718282 | 0 | 1 | 3 | 933 |
import Mathlib.Algebra.GroupWithZero.Divisibility
import Mathlib.Algebra.MonoidAlgebra.Basic
import Mathlib.Data.Finset.Sort
#align_import data.polynomial.basic from "leanprover-community/mathlib"@"949dc57e616a621462062668c9f39e4e17b64b69"
set_option linter.uppercaseLean3 false
noncomputable section
structure Polynomial (R : Type*) [Semiring R] where ofFinsupp ::
toFinsupp : AddMonoidAlgebra R β
#align polynomial Polynomial
#align polynomial.of_finsupp Polynomial.ofFinsupp
#align polynomial.to_finsupp Polynomial.toFinsupp
@[inherit_doc] scoped[Polynomial] notation:9000 R "[X]" => Polynomial R
open AddMonoidAlgebra
open Finsupp hiding single
open Function hiding Commute
open Polynomial
namespace Polynomial
universe u
variable {R : Type u} {a b : R} {m n : β}
section Semiring
variable [Semiring R] {p q : R[X]}
theorem forall_iff_forall_finsupp (P : R[X] β Prop) :
(β p, P p) β β q : R[β], P β¨qβ© :=
β¨fun h q => h β¨qβ©, fun h β¨pβ© => h pβ©
#align polynomial.forall_iff_forall_finsupp Polynomial.forall_iff_forall_finsupp
theorem exists_iff_exists_finsupp (P : R[X] β Prop) :
(β p, P p) β β q : R[β], P β¨qβ© :=
β¨fun β¨β¨pβ©, hpβ© => β¨p, hpβ©, fun β¨q, hqβ© => β¨β¨qβ©, hqβ©β©
#align polynomial.exists_iff_exists_finsupp Polynomial.exists_iff_exists_finsupp
@[simp]
theorem eta (f : R[X]) : Polynomial.ofFinsupp f.toFinsupp = f := by cases f; rfl
#align polynomial.eta Polynomial.eta
section AddMonoidAlgebra
private irreducible_def add : R[X] β R[X] β R[X]
| β¨aβ©, β¨bβ© => β¨a + bβ©
private irreducible_def neg {R : Type u} [Ring R] : R[X] β R[X]
| β¨aβ© => β¨-aβ©
private irreducible_def mul : R[X] β R[X] β R[X]
| β¨aβ©, β¨bβ© => β¨a * bβ©
instance zero : Zero R[X] :=
β¨β¨0β©β©
#align polynomial.has_zero Polynomial.zero
instance one : One R[X] :=
β¨β¨1β©β©
#align polynomial.one Polynomial.one
instance add' : Add R[X] :=
β¨addβ©
#align polynomial.has_add Polynomial.add'
instance neg' {R : Type u} [Ring R] : Neg R[X] :=
β¨negβ©
#align polynomial.has_neg Polynomial.neg'
instance sub {R : Type u} [Ring R] : Sub R[X] :=
β¨fun a b => a + -bβ©
#align polynomial.has_sub Polynomial.sub
instance mul' : Mul R[X] :=
β¨mulβ©
#align polynomial.has_mul Polynomial.mul'
-- If the private definitions are accidentally exposed, simplify them away.
@[simp] theorem add_eq_add : add p q = p + q := rfl
@[simp] theorem mul_eq_mul : mul p q = p * q := rfl
instance smulZeroClass {S : Type*} [SMulZeroClass S R] : SMulZeroClass S R[X] where
smul r p := β¨r β’ p.toFinsuppβ©
smul_zero a := congr_arg ofFinsupp (smul_zero a)
#align polynomial.smul_zero_class Polynomial.smulZeroClass
-- to avoid a bug in the `ring` tactic
instance (priority := 1) pow : Pow R[X] β where pow p n := npowRec n p
#align polynomial.has_pow Polynomial.pow
@[simp]
theorem ofFinsupp_zero : (β¨0β© : R[X]) = 0 :=
rfl
#align polynomial.of_finsupp_zero Polynomial.ofFinsupp_zero
@[simp]
theorem ofFinsupp_one : (β¨1β© : R[X]) = 1 :=
rfl
#align polynomial.of_finsupp_one Polynomial.ofFinsupp_one
@[simp]
theorem ofFinsupp_add {a b} : (β¨a + bβ© : R[X]) = β¨aβ© + β¨bβ© :=
show _ = add _ _ by rw [add_def]
#align polynomial.of_finsupp_add Polynomial.ofFinsupp_add
@[simp]
theorem ofFinsupp_neg {R : Type u} [Ring R] {a} : (β¨-aβ© : R[X]) = -β¨aβ© :=
show _ = neg _ by rw [neg_def]
#align polynomial.of_finsupp_neg Polynomial.ofFinsupp_neg
@[simp]
| Mathlib/Algebra/Polynomial/Basic.lean | 178 | 180 | theorem ofFinsupp_sub {R : Type u} [Ring R] {a b} : (β¨a - bβ© : R[X]) = β¨aβ© - β¨bβ© := by |
rw [sub_eq_add_neg, ofFinsupp_add, ofFinsupp_neg]
rfl
| 2 | 7.389056 | 1 | 1 | 3 | 933 |
import Mathlib.Algebra.GroupWithZero.Divisibility
import Mathlib.Algebra.MonoidAlgebra.Basic
import Mathlib.Data.Finset.Sort
#align_import data.polynomial.basic from "leanprover-community/mathlib"@"949dc57e616a621462062668c9f39e4e17b64b69"
set_option linter.uppercaseLean3 false
noncomputable section
structure Polynomial (R : Type*) [Semiring R] where ofFinsupp ::
toFinsupp : AddMonoidAlgebra R β
#align polynomial Polynomial
#align polynomial.of_finsupp Polynomial.ofFinsupp
#align polynomial.to_finsupp Polynomial.toFinsupp
@[inherit_doc] scoped[Polynomial] notation:9000 R "[X]" => Polynomial R
open AddMonoidAlgebra
open Finsupp hiding single
open Function hiding Commute
open Polynomial
namespace Polynomial
universe u
variable {R : Type u} {a b : R} {m n : β}
section Semiring
variable [Semiring R] {p q : R[X]}
theorem forall_iff_forall_finsupp (P : R[X] β Prop) :
(β p, P p) β β q : R[β], P β¨qβ© :=
β¨fun h q => h β¨qβ©, fun h β¨pβ© => h pβ©
#align polynomial.forall_iff_forall_finsupp Polynomial.forall_iff_forall_finsupp
theorem exists_iff_exists_finsupp (P : R[X] β Prop) :
(β p, P p) β β q : R[β], P β¨qβ© :=
β¨fun β¨β¨pβ©, hpβ© => β¨p, hpβ©, fun β¨q, hqβ© => β¨β¨qβ©, hqβ©β©
#align polynomial.exists_iff_exists_finsupp Polynomial.exists_iff_exists_finsupp
@[simp]
theorem eta (f : R[X]) : Polynomial.ofFinsupp f.toFinsupp = f := by cases f; rfl
#align polynomial.eta Polynomial.eta
section AddMonoidAlgebra
private irreducible_def add : R[X] β R[X] β R[X]
| β¨aβ©, β¨bβ© => β¨a + bβ©
private irreducible_def neg {R : Type u} [Ring R] : R[X] β R[X]
| β¨aβ© => β¨-aβ©
private irreducible_def mul : R[X] β R[X] β R[X]
| β¨aβ©, β¨bβ© => β¨a * bβ©
instance zero : Zero R[X] :=
β¨β¨0β©β©
#align polynomial.has_zero Polynomial.zero
instance one : One R[X] :=
β¨β¨1β©β©
#align polynomial.one Polynomial.one
instance add' : Add R[X] :=
β¨addβ©
#align polynomial.has_add Polynomial.add'
instance neg' {R : Type u} [Ring R] : Neg R[X] :=
β¨negβ©
#align polynomial.has_neg Polynomial.neg'
instance sub {R : Type u} [Ring R] : Sub R[X] :=
β¨fun a b => a + -bβ©
#align polynomial.has_sub Polynomial.sub
instance mul' : Mul R[X] :=
β¨mulβ©
#align polynomial.has_mul Polynomial.mul'
-- If the private definitions are accidentally exposed, simplify them away.
@[simp] theorem add_eq_add : add p q = p + q := rfl
@[simp] theorem mul_eq_mul : mul p q = p * q := rfl
instance smulZeroClass {S : Type*} [SMulZeroClass S R] : SMulZeroClass S R[X] where
smul r p := β¨r β’ p.toFinsuppβ©
smul_zero a := congr_arg ofFinsupp (smul_zero a)
#align polynomial.smul_zero_class Polynomial.smulZeroClass
-- to avoid a bug in the `ring` tactic
instance (priority := 1) pow : Pow R[X] β where pow p n := npowRec n p
#align polynomial.has_pow Polynomial.pow
@[simp]
theorem ofFinsupp_zero : (β¨0β© : R[X]) = 0 :=
rfl
#align polynomial.of_finsupp_zero Polynomial.ofFinsupp_zero
@[simp]
theorem ofFinsupp_one : (β¨1β© : R[X]) = 1 :=
rfl
#align polynomial.of_finsupp_one Polynomial.ofFinsupp_one
@[simp]
theorem ofFinsupp_add {a b} : (β¨a + bβ© : R[X]) = β¨aβ© + β¨bβ© :=
show _ = add _ _ by rw [add_def]
#align polynomial.of_finsupp_add Polynomial.ofFinsupp_add
@[simp]
theorem ofFinsupp_neg {R : Type u} [Ring R] {a} : (β¨-aβ© : R[X]) = -β¨aβ© :=
show _ = neg _ by rw [neg_def]
#align polynomial.of_finsupp_neg Polynomial.ofFinsupp_neg
@[simp]
theorem ofFinsupp_sub {R : Type u} [Ring R] {a b} : (β¨a - bβ© : R[X]) = β¨aβ© - β¨bβ© := by
rw [sub_eq_add_neg, ofFinsupp_add, ofFinsupp_neg]
rfl
#align polynomial.of_finsupp_sub Polynomial.ofFinsupp_sub
@[simp]
theorem ofFinsupp_mul (a b) : (β¨a * bβ© : R[X]) = β¨aβ© * β¨bβ© :=
show _ = mul _ _ by rw [mul_def]
#align polynomial.of_finsupp_mul Polynomial.ofFinsupp_mul
@[simp]
theorem ofFinsupp_smul {S : Type*} [SMulZeroClass S R] (a : S) (b) :
(β¨a β’ bβ© : R[X]) = (a β’ β¨bβ© : R[X]) :=
rfl
#align polynomial.of_finsupp_smul Polynomial.ofFinsupp_smul
@[simp]
| Mathlib/Algebra/Polynomial/Basic.lean | 195 | 199 | theorem ofFinsupp_pow (a) (n : β) : (β¨a ^ nβ© : R[X]) = β¨aβ© ^ n := by |
change _ = npowRec n _
induction n with
| zero => simp [npowRec]
| succ n n_ih => simp [npowRec, n_ih, pow_succ]
| 4 | 54.59815 | 2 | 1 | 3 | 933 |
import Mathlib.LinearAlgebra.Projectivization.Basic
#align_import linear_algebra.projective_space.subspace from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
variable (K V : Type*) [Field K] [AddCommGroup V] [Module K V]
namespace Projectivization
open scoped LinearAlgebra.Projectivization
@[ext]
structure Subspace where
carrier : Set (β K V)
mem_add' (v w : V) (hv : v β 0) (hw : w β 0) (hvw : v + w β 0) :
mk K v hv β carrier β mk K w hw β carrier β mk K (v + w) hvw β carrier
#align projectivization.subspace Projectivization.Subspace
namespace Subspace
variable {K V}
instance : SetLike (Subspace K V) (β K V) where
coe := carrier
coe_injective' A B := by
cases A
cases B
simp
@[simp]
theorem mem_carrier_iff (A : Subspace K V) (x : β K V) : x β A.carrier β x β A :=
Iff.refl _
#align projectivization.subspace.mem_carrier_iff Projectivization.Subspace.mem_carrier_iff
theorem mem_add (T : Subspace K V) (v w : V) (hv : v β 0) (hw : w β 0) (hvw : v + w β 0) :
Projectivization.mk K v hv β T β
Projectivization.mk K w hw β T β Projectivization.mk K (v + w) hvw β T :=
T.mem_add' v w hv hw hvw
#align projectivization.subspace.mem_add Projectivization.Subspace.mem_add
inductive spanCarrier (S : Set (β K V)) : Set (β K V)
| of (x : β K V) (hx : x β S) : spanCarrier S x
| mem_add (v w : V) (hv : v β 0) (hw : w β 0) (hvw : v + w β 0) :
spanCarrier S (Projectivization.mk K v hv) β
spanCarrier S (Projectivization.mk K w hw) β spanCarrier S (Projectivization.mk K (v + w) hvw)
#align projectivization.subspace.span_carrier Projectivization.Subspace.spanCarrier
def span (S : Set (β K V)) : Subspace K V where
carrier := spanCarrier S
mem_add' v w hv hw hvw := spanCarrier.mem_add v w hv hw hvw
#align projectivization.subspace.span Projectivization.Subspace.span
theorem subset_span (S : Set (β K V)) : S β span S := fun _x hx => spanCarrier.of _ hx
#align projectivization.subspace.subset_span Projectivization.Subspace.subset_span
def gi : GaloisInsertion (span : Set (β K V) β Subspace K V) SetLike.coe where
choice S _hS := span S
gc A B :=
β¨fun h => le_trans (subset_span _) h, by
intro h x hx
induction' hx with y hy
Β· apply h
assumption
Β· apply B.mem_add
assumption'β©
le_l_u S := subset_span _
choice_eq _ _ := rfl
#align projectivization.subspace.gi Projectivization.Subspace.gi
@[simp]
theorem span_coe (W : Subspace K V) : span βW = W :=
GaloisInsertion.l_u_eq gi W
#align projectivization.subspace.span_coe Projectivization.Subspace.span_coe
instance instInf : Inf (Subspace K V) :=
β¨fun A B =>
β¨A β B, fun _v _w hv hw _hvw h1 h2 =>
β¨A.mem_add _ _ hv hw _ h1.1 h2.1, B.mem_add _ _ hv hw _ h1.2 h2.2β©β©β©
#align projectivization.subspace.has_inf Projectivization.Subspace.instInf
-- Porting note: delete the name of this instance since it causes problem since hasInf is already
-- defined above
instance instInfSet : InfSet (Subspace K V) :=
β¨fun A =>
β¨sInf (SetLike.coe '' A), fun v w hv hw hvw h1 h2 t => by
rintro β¨s, hs, rflβ©
exact s.mem_add v w hv hw _ (h1 s β¨s, hs, rflβ©) (h2 s β¨s, hs, rflβ©)β©β©
#align projectivization.subspace.has_Inf Projectivization.Subspace.instInfSet
instance : CompleteLattice (Subspace K V) :=
{ __ := completeLatticeOfInf (Subspace K V)
(by
refine fun s => β¨fun a ha x hx => hx _ β¨a, ha, rflβ©, fun a ha x hx E => ?_β©
rintro β¨E, hE, rflβ©
exact ha hE hx)
inf_le_left := fun A B _ hx => (@inf_le_left _ _ A B) hx
inf_le_right := fun A B _ hx => (@inf_le_right _ _ A B) hx
le_inf := fun A B _ h1 h2 _ hx => (le_inf h1 h2) hx }
instance subspaceInhabited : Inhabited (Subspace K V) where default := β€
#align projectivization.subspace.subspace_inhabited Projectivization.Subspace.subspaceInhabited
@[simp]
theorem span_empty : span (β
: Set (β K V)) = β₯ := gi.gc.l_bot
#align projectivization.subspace.span_empty Projectivization.Subspace.span_empty
@[simp]
| Mathlib/LinearAlgebra/Projectivization/Subspace.lean | 155 | 158 | theorem span_univ : span (Set.univ : Set (β K V)) = β€ := by |
rw [eq_top_iff, SetLike.le_def]
intro x _hx
exact subset_span _ (Set.mem_univ x)
| 3 | 20.085537 | 1 | 1 | 1 | 934 |
import Mathlib.Analysis.NormedSpace.AffineIsometry
import Mathlib.Topology.Algebra.ContinuousAffineMap
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
#align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3"
namespace ContinuousAffineMap
variable {π R V W Wβ P Q Qβ : Type*}
variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P]
variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q]
variable [NormedAddCommGroup Wβ] [MetricSpace Qβ] [NormedAddTorsor Wβ Qβ]
variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ]
variable [NontriviallyNormedField π] [NormedSpace π V] [NormedSpace π W] [NormedSpace π Wβ]
def contLinear (f : P βᴬ[R] Q) : V βL[R] W :=
{ f.linear with
toFun := f.linear
cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont }
#align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear
@[simp]
theorem coe_contLinear (f : P βᴬ[R] Q) : (f.contLinear : V β W) = f.linear :=
rfl
#align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear
@[simp]
| Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean | 66 | 67 | theorem coe_contLinear_eq_linear (f : P βᴬ[R] Q) :
(f.contLinear : V ββ[R] W) = (f : P βα΅[R] Q).linear := by | ext; rfl
| 1 | 2.718282 | 0 | 1 | 4 | 935 |
import Mathlib.Analysis.NormedSpace.AffineIsometry
import Mathlib.Topology.Algebra.ContinuousAffineMap
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
#align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3"
namespace ContinuousAffineMap
variable {π R V W Wβ P Q Qβ : Type*}
variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P]
variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q]
variable [NormedAddCommGroup Wβ] [MetricSpace Qβ] [NormedAddTorsor Wβ Qβ]
variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ]
variable [NontriviallyNormedField π] [NormedSpace π V] [NormedSpace π W] [NormedSpace π Wβ]
def contLinear (f : P βᴬ[R] Q) : V βL[R] W :=
{ f.linear with
toFun := f.linear
cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont }
#align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear
@[simp]
theorem coe_contLinear (f : P βᴬ[R] Q) : (f.contLinear : V β W) = f.linear :=
rfl
#align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear
@[simp]
theorem coe_contLinear_eq_linear (f : P βᴬ[R] Q) :
(f.contLinear : V ββ[R] W) = (f : P βα΅[R] Q).linear := by ext; rfl
#align continuous_affine_map.coe_cont_linear_eq_linear ContinuousAffineMap.coe_contLinear_eq_linear
@[simp]
theorem coe_mk_const_linear_eq_linear (f : P βα΅[R] Q) (h) :
((β¨f, hβ© : P βᴬ[R] Q).contLinear : V β W) = f.linear :=
rfl
#align continuous_affine_map.coe_mk_const_linear_eq_linear ContinuousAffineMap.coe_mk_const_linear_eq_linear
theorem coe_linear_eq_coe_contLinear (f : P βᴬ[R] Q) :
((f : P βα΅[R] Q).linear : V β W) = (βf.contLinear : V β W) :=
rfl
#align continuous_affine_map.coe_linear_eq_coe_cont_linear ContinuousAffineMap.coe_linear_eq_coe_contLinear
@[simp]
theorem comp_contLinear (f : P βᴬ[R] Q) (g : Q βᴬ[R] Qβ) :
(g.comp f).contLinear = g.contLinear.comp f.contLinear :=
rfl
#align continuous_affine_map.comp_cont_linear ContinuousAffineMap.comp_contLinear
@[simp]
theorem map_vadd (f : P βᴬ[R] Q) (p : P) (v : V) : f (v +α΅₯ p) = f.contLinear v +α΅₯ f p :=
f.map_vadd' p v
#align continuous_affine_map.map_vadd ContinuousAffineMap.map_vadd
@[simp]
theorem contLinear_map_vsub (f : P βᴬ[R] Q) (pβ pβ : P) : f.contLinear (pβ -α΅₯ pβ) = f pβ -α΅₯ f pβ :=
f.toAffineMap.linearMap_vsub pβ pβ
#align continuous_affine_map.cont_linear_map_vsub ContinuousAffineMap.contLinear_map_vsub
@[simp]
theorem const_contLinear (q : Q) : (const R P q).contLinear = 0 :=
rfl
#align continuous_affine_map.const_cont_linear ContinuousAffineMap.const_contLinear
| Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean | 102 | 114 | theorem contLinear_eq_zero_iff_exists_const (f : P βᴬ[R] Q) :
f.contLinear = 0 β β q, f = const R P q := by |
have hβ : f.contLinear = 0 β (f : P βα΅[R] Q).linear = 0 := by
refine β¨fun h => ?_, fun h => ?_β© <;> ext
Β· rw [β coe_contLinear_eq_linear, h]; rfl
Β· rw [β coe_linear_eq_coe_contLinear, h]; rfl
have hβ : β q : Q, f = const R P q β (f : P βα΅[R] Q) = AffineMap.const R P q := by
intro q
refine β¨fun h => ?_, fun h => ?_β© <;> ext
Β· rw [h]; rfl
Β· rw [β coe_to_affineMap, h]; rfl
simp_rw [hβ, hβ]
exact (f : P βα΅[R] Q).linear_eq_zero_iff_exists_const
| 11 | 59,874.141715 | 2 | 1 | 4 | 935 |
import Mathlib.Analysis.NormedSpace.AffineIsometry
import Mathlib.Topology.Algebra.ContinuousAffineMap
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
#align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3"
namespace ContinuousAffineMap
variable {π R V W Wβ P Q Qβ : Type*}
variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P]
variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q]
variable [NormedAddCommGroup Wβ] [MetricSpace Qβ] [NormedAddTorsor Wβ Qβ]
variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ]
variable [NontriviallyNormedField π] [NormedSpace π V] [NormedSpace π W] [NormedSpace π Wβ]
def contLinear (f : P βᴬ[R] Q) : V βL[R] W :=
{ f.linear with
toFun := f.linear
cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont }
#align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear
@[simp]
theorem coe_contLinear (f : P βᴬ[R] Q) : (f.contLinear : V β W) = f.linear :=
rfl
#align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear
@[simp]
theorem coe_contLinear_eq_linear (f : P βᴬ[R] Q) :
(f.contLinear : V ββ[R] W) = (f : P βα΅[R] Q).linear := by ext; rfl
#align continuous_affine_map.coe_cont_linear_eq_linear ContinuousAffineMap.coe_contLinear_eq_linear
@[simp]
theorem coe_mk_const_linear_eq_linear (f : P βα΅[R] Q) (h) :
((β¨f, hβ© : P βᴬ[R] Q).contLinear : V β W) = f.linear :=
rfl
#align continuous_affine_map.coe_mk_const_linear_eq_linear ContinuousAffineMap.coe_mk_const_linear_eq_linear
theorem coe_linear_eq_coe_contLinear (f : P βᴬ[R] Q) :
((f : P βα΅[R] Q).linear : V β W) = (βf.contLinear : V β W) :=
rfl
#align continuous_affine_map.coe_linear_eq_coe_cont_linear ContinuousAffineMap.coe_linear_eq_coe_contLinear
@[simp]
theorem comp_contLinear (f : P βᴬ[R] Q) (g : Q βᴬ[R] Qβ) :
(g.comp f).contLinear = g.contLinear.comp f.contLinear :=
rfl
#align continuous_affine_map.comp_cont_linear ContinuousAffineMap.comp_contLinear
@[simp]
theorem map_vadd (f : P βᴬ[R] Q) (p : P) (v : V) : f (v +α΅₯ p) = f.contLinear v +α΅₯ f p :=
f.map_vadd' p v
#align continuous_affine_map.map_vadd ContinuousAffineMap.map_vadd
@[simp]
theorem contLinear_map_vsub (f : P βᴬ[R] Q) (pβ pβ : P) : f.contLinear (pβ -α΅₯ pβ) = f pβ -α΅₯ f pβ :=
f.toAffineMap.linearMap_vsub pβ pβ
#align continuous_affine_map.cont_linear_map_vsub ContinuousAffineMap.contLinear_map_vsub
@[simp]
theorem const_contLinear (q : Q) : (const R P q).contLinear = 0 :=
rfl
#align continuous_affine_map.const_cont_linear ContinuousAffineMap.const_contLinear
theorem contLinear_eq_zero_iff_exists_const (f : P βᴬ[R] Q) :
f.contLinear = 0 β β q, f = const R P q := by
have hβ : f.contLinear = 0 β (f : P βα΅[R] Q).linear = 0 := by
refine β¨fun h => ?_, fun h => ?_β© <;> ext
Β· rw [β coe_contLinear_eq_linear, h]; rfl
Β· rw [β coe_linear_eq_coe_contLinear, h]; rfl
have hβ : β q : Q, f = const R P q β (f : P βα΅[R] Q) = AffineMap.const R P q := by
intro q
refine β¨fun h => ?_, fun h => ?_β© <;> ext
Β· rw [h]; rfl
Β· rw [β coe_to_affineMap, h]; rfl
simp_rw [hβ, hβ]
exact (f : P βα΅[R] Q).linear_eq_zero_iff_exists_const
#align continuous_affine_map.cont_linear_eq_zero_iff_exists_const ContinuousAffineMap.contLinear_eq_zero_iff_exists_const
@[simp]
| Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean | 118 | 120 | theorem to_affine_map_contLinear (f : V βL[R] W) : f.toContinuousAffineMap.contLinear = f := by |
ext
rfl
| 2 | 7.389056 | 1 | 1 | 4 | 935 |
import Mathlib.Analysis.NormedSpace.AffineIsometry
import Mathlib.Topology.Algebra.ContinuousAffineMap
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
#align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3"
namespace ContinuousAffineMap
variable {π R V W Wβ P Q Qβ : Type*}
variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P]
variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q]
variable [NormedAddCommGroup Wβ] [MetricSpace Qβ] [NormedAddTorsor Wβ Qβ]
variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ]
variable [NontriviallyNormedField π] [NormedSpace π V] [NormedSpace π W] [NormedSpace π Wβ]
def contLinear (f : P βᴬ[R] Q) : V βL[R] W :=
{ f.linear with
toFun := f.linear
cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont }
#align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear
@[simp]
theorem coe_contLinear (f : P βᴬ[R] Q) : (f.contLinear : V β W) = f.linear :=
rfl
#align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear
@[simp]
theorem coe_contLinear_eq_linear (f : P βᴬ[R] Q) :
(f.contLinear : V ββ[R] W) = (f : P βα΅[R] Q).linear := by ext; rfl
#align continuous_affine_map.coe_cont_linear_eq_linear ContinuousAffineMap.coe_contLinear_eq_linear
@[simp]
theorem coe_mk_const_linear_eq_linear (f : P βα΅[R] Q) (h) :
((β¨f, hβ© : P βᴬ[R] Q).contLinear : V β W) = f.linear :=
rfl
#align continuous_affine_map.coe_mk_const_linear_eq_linear ContinuousAffineMap.coe_mk_const_linear_eq_linear
theorem coe_linear_eq_coe_contLinear (f : P βᴬ[R] Q) :
((f : P βα΅[R] Q).linear : V β W) = (βf.contLinear : V β W) :=
rfl
#align continuous_affine_map.coe_linear_eq_coe_cont_linear ContinuousAffineMap.coe_linear_eq_coe_contLinear
@[simp]
theorem comp_contLinear (f : P βᴬ[R] Q) (g : Q βᴬ[R] Qβ) :
(g.comp f).contLinear = g.contLinear.comp f.contLinear :=
rfl
#align continuous_affine_map.comp_cont_linear ContinuousAffineMap.comp_contLinear
@[simp]
theorem map_vadd (f : P βᴬ[R] Q) (p : P) (v : V) : f (v +α΅₯ p) = f.contLinear v +α΅₯ f p :=
f.map_vadd' p v
#align continuous_affine_map.map_vadd ContinuousAffineMap.map_vadd
@[simp]
theorem contLinear_map_vsub (f : P βᴬ[R] Q) (pβ pβ : P) : f.contLinear (pβ -α΅₯ pβ) = f pβ -α΅₯ f pβ :=
f.toAffineMap.linearMap_vsub pβ pβ
#align continuous_affine_map.cont_linear_map_vsub ContinuousAffineMap.contLinear_map_vsub
@[simp]
theorem const_contLinear (q : Q) : (const R P q).contLinear = 0 :=
rfl
#align continuous_affine_map.const_cont_linear ContinuousAffineMap.const_contLinear
theorem contLinear_eq_zero_iff_exists_const (f : P βᴬ[R] Q) :
f.contLinear = 0 β β q, f = const R P q := by
have hβ : f.contLinear = 0 β (f : P βα΅[R] Q).linear = 0 := by
refine β¨fun h => ?_, fun h => ?_β© <;> ext
Β· rw [β coe_contLinear_eq_linear, h]; rfl
Β· rw [β coe_linear_eq_coe_contLinear, h]; rfl
have hβ : β q : Q, f = const R P q β (f : P βα΅[R] Q) = AffineMap.const R P q := by
intro q
refine β¨fun h => ?_, fun h => ?_β© <;> ext
Β· rw [h]; rfl
Β· rw [β coe_to_affineMap, h]; rfl
simp_rw [hβ, hβ]
exact (f : P βα΅[R] Q).linear_eq_zero_iff_exists_const
#align continuous_affine_map.cont_linear_eq_zero_iff_exists_const ContinuousAffineMap.contLinear_eq_zero_iff_exists_const
@[simp]
theorem to_affine_map_contLinear (f : V βL[R] W) : f.toContinuousAffineMap.contLinear = f := by
ext
rfl
#align continuous_affine_map.to_affine_map_cont_linear ContinuousAffineMap.to_affine_map_contLinear
@[simp]
theorem zero_contLinear : (0 : P βᴬ[R] W).contLinear = 0 :=
rfl
#align continuous_affine_map.zero_cont_linear ContinuousAffineMap.zero_contLinear
@[simp]
theorem add_contLinear (f g : P βᴬ[R] W) : (f + g).contLinear = f.contLinear + g.contLinear :=
rfl
#align continuous_affine_map.add_cont_linear ContinuousAffineMap.add_contLinear
@[simp]
theorem sub_contLinear (f g : P βᴬ[R] W) : (f - g).contLinear = f.contLinear - g.contLinear :=
rfl
#align continuous_affine_map.sub_cont_linear ContinuousAffineMap.sub_contLinear
@[simp]
theorem neg_contLinear (f : P βᴬ[R] W) : (-f).contLinear = -f.contLinear :=
rfl
#align continuous_affine_map.neg_cont_linear ContinuousAffineMap.neg_contLinear
@[simp]
theorem smul_contLinear (t : R) (f : P βᴬ[R] W) : (t β’ f).contLinear = t β’ f.contLinear :=
rfl
#align continuous_affine_map.smul_cont_linear ContinuousAffineMap.smul_contLinear
| Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean | 148 | 151 | theorem decomp (f : V βᴬ[R] W) : (f : V β W) = f.contLinear + Function.const V (f 0) := by |
rcases f with β¨f, hβ©
rw [coe_mk_const_linear_eq_linear, coe_mk, f.decomp, Pi.add_apply, LinearMap.map_zero, zero_add,
β Function.const_def]
| 3 | 20.085537 | 1 | 1 | 4 | 935 |
import Mathlib.CategoryTheory.Category.Cat
import Mathlib.CategoryTheory.Limits.Types
import Mathlib.CategoryTheory.Limits.Preserves.Basic
#align_import category_theory.category.Cat.limit from "leanprover-community/mathlib"@"1995c7bbdbb0adb1b6d5acdc654f6cf46ed96cfa"
noncomputable section
universe v u
open CategoryTheory.Limits
namespace CategoryTheory
variable {J : Type v} [SmallCategory J]
namespace Cat
namespace HasLimits
instance categoryObjects {F : J β₯€ Cat.{u, u}} {j} :
SmallCategory ((F β Cat.objects.{u, u}).obj j) :=
(F.obj j).str
set_option linter.uppercaseLean3 false in
#align category_theory.Cat.has_limits.category_objects CategoryTheory.Cat.HasLimits.categoryObjects
@[simps]
def homDiagram {F : J β₯€ Cat.{v, v}} (X Y : limit (F β Cat.objects.{v, v})) : J β₯€ Type v where
obj j := limit.Ο (F β Cat.objects) j X βΆ limit.Ο (F β Cat.objects) j Y
map f g := by
refine eqToHom ?_ β« (F.map f).map g β« eqToHom ?_
Β· exact (congr_fun (limit.w (F β Cat.objects) f) X).symm
Β· exact congr_fun (limit.w (F β Cat.objects) f) Y
map_id X := by
funext f
letI : Category (objects.obj (F.obj X)) := (inferInstance : Category (F.obj X))
simp [Functor.congr_hom (F.map_id X) f]
map_comp {_ _ Z} f g := by
funext h
letI : Category (objects.obj (F.obj Z)) := (inferInstance : Category (F.obj Z))
simp [Functor.congr_hom (F.map_comp f g) h, eqToHom_map]
set_option linter.uppercaseLean3 false in
#align category_theory.Cat.has_limits.hom_diagram CategoryTheory.Cat.HasLimits.homDiagram
@[simps]
instance (F : J β₯€ Cat.{v, v}) : Category (limit (F β Cat.objects)) where
Hom X Y := limit (homDiagram X Y)
id X := Types.Limit.mk.{v, v} (homDiagram X X) (fun j => π _) fun j j' f => by simp
comp {X Y Z} f g :=
Types.Limit.mk.{v, v} (homDiagram X Z)
(fun j => limit.Ο (homDiagram X Y) j f β« limit.Ο (homDiagram Y Z) j g) fun j j' h => by
simp [β congr_fun (limit.w (homDiagram X Y) h) f,
β congr_fun (limit.w (homDiagram Y Z) h) g]
id_comp _ := by
apply Types.limit_ext.{v, v}
aesop_cat
comp_id _ := by
apply Types.limit_ext.{v, v}
aesop_cat
@[simps]
def limitConeX (F : J β₯€ Cat.{v, v}) : Cat.{v, v} where Ξ± := limit (F β Cat.objects)
set_option linter.uppercaseLean3 false in
#align category_theory.Cat.has_limits.limit_cone_X CategoryTheory.Cat.HasLimits.limitConeX
@[simps]
def limitCone (F : J β₯€ Cat.{v, v}) : Cone F where
pt := limitConeX F
Ο :=
{ app := fun j =>
{ obj := limit.Ο (F β Cat.objects) j
map := fun f => limit.Ο (homDiagram _ _) j f }
naturality := fun j j' f =>
CategoryTheory.Functor.ext (fun X => (congr_fun (limit.w (F β Cat.objects) f) X).symm)
fun X Y h => (congr_fun (limit.w (homDiagram X Y) f) h).symm }
set_option linter.uppercaseLean3 false in
#align category_theory.Cat.has_limits.limit_cone CategoryTheory.Cat.HasLimits.limitCone
@[simps]
def limitConeLift (F : J β₯€ Cat.{v, v}) (s : Cone F) : s.pt βΆ limitConeX F where
obj :=
limit.lift (F β Cat.objects)
{ pt := s.pt
Ο :=
{ app := fun j => (s.Ο.app j).obj
naturality := fun _ _ f => objects.congr_map (s.Ο.naturality f) } }
map f := by
fapply Types.Limit.mk.{v, v}
Β· intro j
refine eqToHom ?_ β« (s.Ο.app j).map f β« eqToHom ?_ <;> simp
Β· intro j j' h
dsimp
simp only [Category.assoc, Functor.map_comp, eqToHom_map, eqToHom_trans,
eqToHom_trans_assoc, β Functor.comp_map]
have := (s.Ο.naturality h).symm
dsimp at this
rw [Category.id_comp] at this
erw [Functor.congr_hom this f]
simp
set_option linter.uppercaseLean3 false in
#align category_theory.Cat.has_limits.limit_cone_lift CategoryTheory.Cat.HasLimits.limitConeLift
@[simp]
| Mathlib/CategoryTheory/Category/Cat/Limit.lean | 127 | 132 | theorem limit_Ο_homDiagram_eqToHom {F : J β₯€ Cat.{v, v}} (X Y : limit (F β Cat.objects.{v, v}))
(j : J) (h : X = Y) :
limit.Ο (homDiagram X Y) j (eqToHom h) =
eqToHom (congr_arg (limit.Ο (F β Cat.objects.{v, v}) j) h) := by |
subst h
simp
| 2 | 7.389056 | 1 | 1 | 1 | 936 |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Data.Countable.Basic
import Mathlib.Data.Set.Image
import Mathlib.Data.Set.Subsingleton
import Mathlib.Data.Int.Cast.Lemmas
import Mathlib.GroupTheory.Subgroup.Centralizer
#align_import group_theory.subgroup.zpowers from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
variable {G : Type*} [Group G]
variable {A : Type*} [AddGroup A]
variable {N : Type*} [Group N]
namespace Subgroup
def zpowers (g : G) : Subgroup G :=
Subgroup.copy (zpowersHom G g).range (Set.range (g ^ Β· : β€ β G)) rfl
#align subgroup.zpowers Subgroup.zpowers
theorem mem_zpowers (g : G) : g β zpowers g :=
β¨1, zpow_one _β©
#align subgroup.mem_zpowers Subgroup.mem_zpowers
theorem coe_zpowers (g : G) : β(zpowers g) = Set.range (g ^ Β· : β€ β G) :=
rfl
#align subgroup.coe_zpowers Subgroup.coe_zpowers
noncomputable instance decidableMemZPowers {a : G} : DecidablePred (Β· β Subgroup.zpowers a) :=
Classical.decPred _
#align decidable_zpowers Subgroup.decidableMemZPowers
| Mathlib/Algebra/Group/Subgroup/ZPowers.lean | 47 | 49 | theorem zpowers_eq_closure (g : G) : zpowers g = closure {g} := by |
ext
exact mem_closure_singleton.symm
| 2 | 7.389056 | 1 | 1 | 1 | 937 |
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Group.FiniteSupport
import Mathlib.Algebra.Module.Defs
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Set.Subsingleton
#align_import algebra.big_operators.finprod from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
open Function Set
-- Porting note: Used to be section Sort
section sort
variable {G M N : Type*} {Ξ± Ξ² ΞΉ : Sort*} [CommMonoid M] [CommMonoid N]
section
open scoped Classical
noncomputable irreducible_def finsum (lemma := finsum_def') [AddCommMonoid M] (f : Ξ± β M) : M :=
if h : (support (f β PLift.down)).Finite then β i β h.toFinset, f i.down else 0
#align finsum finsum
@[to_additive existing]
noncomputable irreducible_def finprod (lemma := finprod_def') (f : Ξ± β M) : M :=
if h : (mulSupport (f β PLift.down)).Finite then β i β h.toFinset, f i.down else 1
#align finprod finprod
attribute [to_additive existing] finprod_def'
end
open Batteries.ExtendedBinder
notation3"βαΆ "(...)", "r:67:(scoped f => finsum f) => r
notation3"βαΆ "(...)", "r:67:(scoped f => finprod f) => r
-- Porting note: The following ports the lean3 notation for this file, but is currently very fickle.
-- syntax (name := bigfinsum) "βαΆ " extBinders ", " term:67 : term
-- macro_rules (kind := bigfinsum)
-- | `(βαΆ $x:ident, $p) => `(finsum (fun $x:ident β¦ $p))
-- | `(βαΆ $x:ident : $t, $p) => `(finsum (fun $x:ident : $t β¦ $p))
-- | `(βαΆ $x:ident $b:binderPred, $p) =>
-- `(finsum fun $x => (finsum (Ξ± := satisfies_binder_pred% $x $b) (fun _ => $p)))
-- | `(βαΆ ($x:ident) ($h:ident : $t), $p) =>
-- `(finsum fun ($x) => finsum (Ξ± := $t) (fun $h => $p))
-- | `(βαΆ ($x:ident : $_) ($h:ident : $t), $p) =>
-- `(finsum fun ($x) => finsum (Ξ± := $t) (fun $h => $p))
-- | `(βαΆ ($x:ident) ($y:ident), $p) =>
-- `(finsum fun $x => (finsum fun $y => $p))
-- | `(βαΆ ($x:ident) ($y:ident) ($h:ident : $t), $p) =>
-- `(finsum fun $x => (finsum fun $y => (finsum (Ξ± := $t) fun $h => $p)))
-- | `(βαΆ ($x:ident) ($y:ident) ($z:ident), $p) =>
-- `(finsum fun $x => (finsum fun $y => (finsum fun $z => $p)))
-- | `(βαΆ ($x:ident) ($y:ident) ($z:ident) ($h:ident : $t), $p) =>
-- `(finsum fun $x => (finsum fun $y => (finsum fun $z => (finsum (Ξ± := $t) fun $h => $p))))
--
--
-- syntax (name := bigfinprod) "βαΆ " extBinders ", " term:67 : term
-- macro_rules (kind := bigfinprod)
-- | `(βαΆ $x:ident, $p) => `(finprod (fun $x:ident β¦ $p))
-- | `(βαΆ $x:ident : $t, $p) => `(finprod (fun $x:ident : $t β¦ $p))
-- | `(βαΆ $x:ident $b:binderPred, $p) =>
-- `(finprod fun $x => (finprod (Ξ± := satisfies_binder_pred% $x $b) (fun _ => $p)))
-- | `(βαΆ ($x:ident) ($h:ident : $t), $p) =>
-- `(finprod fun ($x) => finprod (Ξ± := $t) (fun $h => $p))
-- | `(βαΆ ($x:ident : $_) ($h:ident : $t), $p) =>
-- `(finprod fun ($x) => finprod (Ξ± := $t) (fun $h => $p))
-- | `(βαΆ ($x:ident) ($y:ident), $p) =>
-- `(finprod fun $x => (finprod fun $y => $p))
-- | `(βαΆ ($x:ident) ($y:ident) ($h:ident : $t), $p) =>
-- `(finprod fun $x => (finprod fun $y => (finprod (Ξ± := $t) fun $h => $p)))
-- | `(βαΆ ($x:ident) ($y:ident) ($z:ident), $p) =>
-- `(finprod fun $x => (finprod fun $y => (finprod fun $z => $p)))
-- | `(βαΆ ($x:ident) ($y:ident) ($z:ident) ($h:ident : $t), $p) =>
-- `(finprod fun $x => (finprod fun $y => (finprod fun $z =>
-- (finprod (Ξ± := $t) fun $h => $p))))
@[to_additive]
| Mathlib/Algebra/BigOperators/Finprod.lean | 171 | 176 | theorem finprod_eq_prod_plift_of_mulSupport_toFinset_subset {f : Ξ± β M}
(hf : (mulSupport (f β PLift.down)).Finite) {s : Finset (PLift Ξ±)} (hs : hf.toFinset β s) :
βαΆ i, f i = β i β s, f i.down := by |
rw [finprod, dif_pos]
refine Finset.prod_subset hs fun x _ hxf => ?_
rwa [hf.mem_toFinset, nmem_mulSupport] at hxf
| 3 | 20.085537 | 1 | 1 | 1 | 938 |
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 LinearOrderedAddCommGroup
variable [LinearOrderedAddCommGroup Ξ±]
| Mathlib/Algebra/Order/Interval/Set/Group.lean | 151 | 157 | theorem nonempty_Ico_sdiff {x dx y dy : Ξ±} (h : dy < dx) (hx : 0 < dx) :
Nonempty β(Ico x (x + dx) \ Ico y (y + dy)) := by |
cases' lt_or_le x y with h' h'
Β· use x
simp [*, not_le.2 h']
Β· use max x (x + dy)
simp [*, le_refl]
| 5 | 148.413159 | 2 | 1 | 6 | 939 |
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]
| Mathlib/Algebra/Order/Interval/Set/Group.lean | 171 | 183 | 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
| 11 | 59,874.141715 | 2 | 1 | 6 | 939 |
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]
| Mathlib/Algebra/Order/Interval/Set/Group.lean | 188 | 200 | 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
| 11 | 59,874.141715 | 2 | 1 | 6 | 939 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.