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