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 | rank int64 0 2.4k |
|---|---|---|---|---|---|---|
import Batteries.Data.Array.Lemmas
import Batteries.Tactic.Lint.Misc
namespace Batteries
structure UFNode where
parent : Nat
rank : Nat
namespace UnionFind
def panicWith (v : Ξ±) (msg : String) : Ξ± := @panic Ξ± β¨vβ© msg
@[simp] theorem panicWith_eq (v : Ξ±) (msg) : panicWith v msg = v := rfl
def parentD... | .lake/packages/batteries/Batteries/Data/UnionFind/Basic.lean | 47 | 50 | theorem parentD_set {arr : Array UFNode} {x v i} :
parentD (arr.set x v) i = if x.1 = i then v.parent else parentD arr i := by |
rw [parentD]; simp [Array.get_eq_getElem, parentD]
split <;> [split <;> simp [Array.get_set, *]; split <;> [(subst i; cases βΉΒ¬_βΊ x.2); rfl]]
| 0 |
import Batteries.Data.Array.Lemmas
import Batteries.Tactic.Lint.Misc
namespace Batteries
structure UFNode where
parent : Nat
rank : Nat
namespace UnionFind
def panicWith (v : Ξ±) (msg : String) : Ξ± := @panic Ξ± β¨vβ© msg
@[simp] theorem panicWith_eq (v : Ξ±) (msg) : panicWith v msg = v := rfl
def parentD... | .lake/packages/batteries/Batteries/Data/UnionFind/Basic.lean | 52 | 55 | theorem rankD_set {arr : Array UFNode} {x v i} :
rankD (arr.set x v) i = if x.1 = i then v.rank else rankD arr i := by |
rw [rankD]; simp [Array.get_eq_getElem, rankD]
split <;> [split <;> simp [Array.get_set, *]; split <;> [(subst i; cases βΉΒ¬_βΊ x.2); rfl]]
| 0 |
import Mathlib.Algebra.MvPolynomial.Monad
#align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6"
namespace MvPolynomial
variable {Ο Ο R S : Type*} [CommSemiring R] [CommSemiring S]
noncomputable def expand (p : β) : MvPolynomial Ο R ββ[R] MvPolyno... | Mathlib/Algebra/MvPolynomial/Expand.lean | 53 | 55 | theorem expand_one_apply (f : MvPolynomial Ο R) : expand 1 f = f := by |
simp only [expand, pow_one, evalβHom_eq_bindβ, bindβ_C_left, RingHom.toMonoidHom_eq_coe,
RingHom.coe_monoidHom_id, AlgHom.coe_mk, RingHom.coe_mk, MonoidHom.id_apply, RingHom.id_apply]
| 1 |
import Mathlib.Algebra.MvPolynomial.Monad
#align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6"
namespace MvPolynomial
variable {Ο Ο R S : Type*} [CommSemiring R] [CommSemiring S]
noncomputable def expand (p : β) : MvPolynomial Ο R ββ[R] MvPolyno... | Mathlib/Algebra/MvPolynomial/Expand.lean | 59 | 61 | theorem expand_one : expand 1 = AlgHom.id R (MvPolynomial Ο R) := by |
ext1 f
rw [expand_one_apply, AlgHom.id_apply]
| 1 |
import Mathlib.Algebra.MvPolynomial.Monad
#align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6"
namespace MvPolynomial
variable {Ο Ο R S : Type*} [CommSemiring R] [CommSemiring S]
noncomputable def expand (p : β) : MvPolynomial Ο R ββ[R] MvPolyno... | Mathlib/Algebra/MvPolynomial/Expand.lean | 64 | 68 | theorem expand_comp_bindβ (p : β) (f : Ο β MvPolynomial Ο R) :
(expand p).comp (bindβ f) = bindβ fun i β¦ expand p (f i) := by |
apply algHom_ext
intro i
simp only [AlgHom.comp_apply, bindβ_X_right]
| 1 |
import Mathlib.Algebra.MvPolynomial.Monad
#align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6"
namespace MvPolynomial
variable {Ο Ο R S : Type*} [CommSemiring R] [CommSemiring S]
noncomputable def expand (p : β) : MvPolynomial Ο R ββ[R] MvPolyno... | Mathlib/Algebra/MvPolynomial/Expand.lean | 71 | 73 | theorem expand_bindβ (p : β) (f : Ο β MvPolynomial Ο R) (Ο : MvPolynomial Ο R) :
expand p (bindβ f Ο) = bindβ (fun i β¦ expand p (f i)) Ο := by |
rw [β AlgHom.comp_apply, expand_comp_bindβ]
| 1 |
import Mathlib.Algebra.MvPolynomial.Monad
#align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6"
namespace MvPolynomial
variable {Ο Ο R S : Type*} [CommSemiring R] [CommSemiring S]
noncomputable def expand (p : β) : MvPolynomial Ο R ββ[R] MvPolyno... | Mathlib/Algebra/MvPolynomial/Expand.lean | 77 | 78 | theorem map_expand (f : R β+* S) (p : β) (Ο : MvPolynomial Ο R) :
map f (expand p Ο) = expand p (map f Ο) := by | simp [expand, map_bindβ]
| 1 |
import Mathlib.Algebra.MvPolynomial.Monad
#align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6"
namespace MvPolynomial
variable {Ο Ο R S : Type*} [CommSemiring R] [CommSemiring S]
noncomputable def expand (p : β) : MvPolynomial Ο R ββ[R] MvPolyno... | Mathlib/Algebra/MvPolynomial/Expand.lean | 82 | 84 | theorem rename_expand (f : Ο β Ο) (p : β) (Ο : MvPolynomial Ο R) :
rename f (expand p Ο) = expand p (rename f Ο) := by |
simp [expand, bindβ_rename, rename_bindβ, Function.comp]
| 1 |
import Mathlib.Algebra.MvPolynomial.Monad
#align_import data.mv_polynomial.expand from "leanprover-community/mathlib"@"5da451b4c96b4c2e122c0325a7fce17d62ee46c6"
namespace MvPolynomial
variable {Ο Ο R S : Type*} [CommSemiring R] [CommSemiring S]
noncomputable def expand (p : β) : MvPolynomial Ο R ββ[R] MvPolyno... | Mathlib/Algebra/MvPolynomial/Expand.lean | 88 | 92 | theorem rename_comp_expand (f : Ο β Ο) (p : β) :
(rename f).comp (expand p) =
(expand p).comp (rename f : MvPolynomial Ο R ββ[R] MvPolynomial Ο R) := by |
ext1 Ο
simp only [rename_expand, AlgHom.comp_apply]
| 1 |
import Mathlib.LinearAlgebra.CliffordAlgebra.Basic
import Mathlib.LinearAlgebra.Alternating.Basic
#align_import linear_algebra.exterior_algebra.basic from "leanprover-community/mathlib"@"b8d2eaa69d69ce8f03179a5cda774fc0cde984e4"
universe u1 u2 u3 u4 u5
variable (R : Type u1) [CommRing R]
variable (M : Type u2) [... | Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean | 97 | 98 | theorem comp_ΞΉ_sq_zero (g : ExteriorAlgebra R M ββ[R] A) (m : M) : g (ΞΉ R m) * g (ΞΉ R m) = 0 := by |
rw [β AlgHom.map_mul, ΞΉ_sq_zero, AlgHom.map_zero]
| 2 |
import Mathlib.Algebra.Module.Equiv
#align_import linear_algebra.general_linear_group from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9"
variable (R M : Type*)
namespace LinearMap
variable [Semiring R] [AddCommMonoid M] [Module R M]
abbrev GeneralLinearGroup :=
(M ββ[R] M)Λ£
#alig... | Mathlib/LinearAlgebra/GeneralLinearGroup.lean | 68 | 69 | theorem generalLinearEquiv_to_linearMap (f : GeneralLinearGroup R M) :
(generalLinearEquiv R M f : M ββ[R] M) = f := by | ext; rfl
| 3 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 81 | 82 | theorem thickening_empty (Ξ΄ : β) : thickening Ξ΄ (β
: Set Ξ±) = β
:= by |
simp only [thickening, setOf_false, infEdist_empty, not_top_lt]
| 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 114 | 122 | theorem frontier_thickening_disjoint (A : Set Ξ±) :
Pairwise (Disjoint on fun r : β => frontier (thickening r A)) := by |
refine (pairwise_disjoint_on _).2 fun rβ rβ hr => ?_
rcases le_total rβ 0 with hβ | hβ
Β· simp [thickening_of_nonpos hβ]
refine ((disjoint_singleton.2 fun h => hr.ne ?_).preimage _).mono (frontier_thickening_subset _)
(frontier_thickening_subset _)
apply_fun ENNReal.toReal at h
rwa [ENNReal.toReal_ofRea... | 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 151 | 154 | theorem mem_thickening_iff {E : Set X} {x : X} : x β thickening Ξ΄ E β β z β E, dist x z < Ξ΄ := by |
have key_iff : β z : X, edist x z < ENNReal.ofReal Ξ΄ β dist x z < Ξ΄ := fun z β¦ by
rw [dist_edist, lt_ofReal_iff_toReal_lt (edist_ne_top _ _)]
simp_rw [mem_thickening_iff_exists_edist_lt, key_iff]
| 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 219 | 223 | theorem mem_cthickening_of_dist_le {Ξ± : Type*} [PseudoMetricSpace Ξ±] (x y : Ξ±) (Ξ΄ : β) (E : Set Ξ±)
(h : y β E) (h' : dist x y β€ Ξ΄) : x β cthickening Ξ΄ E := by |
apply mem_cthickening_of_edist_le x y Ξ΄ E h
rw [edist_dist]
exact ENNReal.ofReal_le_ofReal h'
| 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 238 | 239 | theorem cthickening_empty (Ξ΄ : β) : cthickening Ξ΄ (β
: Set Ξ±) = β
:= by |
simp only [cthickening, ENNReal.ofReal_ne_top, setOf_false, infEdist_empty, top_le_iff]
| 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 242 | 244 | theorem cthickening_of_nonpos {Ξ΄ : β} (hΞ΄ : Ξ΄ β€ 0) (E : Set Ξ±) : cthickening Ξ΄ E = closure E := by |
ext x
simp [mem_closure_iff_infEdist_zero, cthickening, ENNReal.ofReal_eq_zero.2 hΞ΄]
| 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 253 | 254 | theorem cthickening_max_zero (Ξ΄ : β) (E : Set Ξ±) : cthickening (max 0 Ξ΄) E = cthickening Ξ΄ E := by |
cases le_total Ξ΄ 0 <;> simp [cthickening_of_nonpos, *]
| 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 265 | 268 | theorem cthickening_singleton {Ξ± : Type*} [PseudoMetricSpace Ξ±] (x : Ξ±) {Ξ΄ : β} (hΞ΄ : 0 β€ Ξ΄) :
cthickening Ξ΄ ({x} : Set Ξ±) = closedBall x Ξ΄ := by |
ext y
simp [cthickening, edist_dist, ENNReal.ofReal_le_ofReal_iff hΞ΄]
| 4 |
import Mathlib.Topology.MetricSpace.HausdorffDistance
#align_import topology.metric_space.hausdorff_distance from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156"
noncomputable section
open NNReal ENNReal Topology Set Filter Bornology
universe u v w
variable {ΞΉ : Sort*} {Ξ± : Type u} {Ξ² :... | Mathlib/Topology/MetricSpace/Thickening.lean | 271 | 275 | theorem closedBall_subset_cthickening_singleton {Ξ± : Type*} [PseudoMetricSpace Ξ±] (x : Ξ±) (Ξ΄ : β) :
closedBall x Ξ΄ β cthickening Ξ΄ ({x} : Set Ξ±) := by |
rcases lt_or_le Ξ΄ 0 with (hΞ΄ | hΞ΄)
Β· simp only [closedBall_eq_empty.mpr hΞ΄, empty_subset]
Β· simp only [cthickening_singleton x hΞ΄, Subset.rfl]
| 4 |
import Batteries.Data.RBMap.Basic
import Mathlib.Init.Data.Nat.Notation
import Mathlib.Mathport.Rename
import Mathlib.Tactic.TypeStar
import Mathlib.Util.CompileInductive
#align_import data.tree from "leanprover-community/mathlib"@"ed989ff568099019c6533a4d94b27d852a5710d8"
inductive Tree.{u} (Ξ± : Type u) : Type ... | Mathlib/Data/Tree/Basic.lean | 90 | 91 | theorem numLeaves_eq_numNodes_succ (x : Tree Ξ±) : x.numLeaves = x.numNodes + 1 := by |
induction x <;> simp [*, Nat.add_comm, Nat.add_assoc, Nat.add_left_comm]
| 5 |
import Batteries.Data.RBMap.Basic
import Mathlib.Init.Data.Nat.Notation
import Mathlib.Mathport.Rename
import Mathlib.Tactic.TypeStar
import Mathlib.Util.CompileInductive
#align_import data.tree from "leanprover-community/mathlib"@"ed989ff568099019c6533a4d94b27d852a5710d8"
inductive Tree.{u} (Ξ± : Type u) : Type ... | Mathlib/Data/Tree/Basic.lean | 94 | 96 | theorem numLeaves_pos (x : Tree Ξ±) : 0 < x.numLeaves := by |
rw [numLeaves_eq_numNodes_succ]
exact x.numNodes.zero_lt_succ
| 5 |
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Tactic.Positivity.Core
import Mathlib.Algebra.Ring.NegOnePow
#align_import analysis.special_functions.trigonometric.basic from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
noncomputable section
open scoped Classical
open Top... | Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean | 54 | 56 | theorem continuous_sin : Continuous sin := by |
change Continuous fun z => (exp (-z * I) - exp (z * I)) * I / 2
continuity
| 6 |
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Tactic.Positivity.Core
import Mathlib.Algebra.Ring.NegOnePow
#align_import analysis.special_functions.trigonometric.basic from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
noncomputable section
open scoped Classical
open Top... | Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean | 65 | 67 | theorem continuous_cos : Continuous cos := by |
change Continuous fun z => (exp (z * I) + exp (-z * I)) / 2
continuity
| 6 |
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Tactic.Positivity.Core
import Mathlib.Algebra.Ring.NegOnePow
#align_import analysis.special_functions.trigonometric.basic from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
noncomputable section
open scoped Classical
open Top... | Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean | 76 | 78 | theorem continuous_sinh : Continuous sinh := by |
change Continuous fun z => (exp z - exp (-z)) / 2
continuity
| 6 |
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Tactic.Positivity.Core
import Mathlib.Algebra.Ring.NegOnePow
#align_import analysis.special_functions.trigonometric.basic from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1"
noncomputable section
open scoped Classical
open Top... | Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean | 82 | 84 | theorem continuous_cosh : Continuous cosh := by |
change Continuous fun z => (exp z + exp (-z)) / 2
continuity
| 6 |
import Mathlib.Algebra.Group.Nat
set_option autoImplicit true
open Lean hiding Literal HashMap
open Batteries
namespace Sat
inductive Literal
| pos : Nat β Literal
| neg : Nat β Literal
def Literal.ofInt (i : Int) : Literal :=
if i < 0 then Literal.neg (-i-1).toNat else Literal.pos (i-1).toNat
def Lit... | Mathlib/Tactic/Sat/FromLRAT.lean | 156 | 166 | theorem Valuation.mk_implies {as ps} (asβ) : as = List.reverseAux asβ ps β
(Valuation.mk as).implies p ps asβ.length β p := by |
induction ps generalizing asβ with
| nil => exact fun _ β¦ id
| cons a as ih =>
refine fun e H β¦ @ih (a::asβ) e (H ?_)
subst e; clear ih H
suffices β n n', n' = List.length asβ + n β
β bs, mk (asβ.reverseAux bs) n' β mk bs n from this 0 _ rfl (a::as)
induction asβ with simp
| cons b asβ ... | 7 |
import Mathlib.Algebra.Group.Nat
set_option autoImplicit true
open Lean hiding Literal HashMap
open Batteries
namespace Sat
inductive Literal
| pos : Nat β Literal
| neg : Nat β Literal
def Literal.ofInt (i : Int) : Literal :=
if i < 0 then Literal.neg (-i-1).toNat else Literal.pos (i-1).toNat
def Lit... | Mathlib/Tactic/Sat/FromLRAT.lean | 180 | 185 | theorem Fmla.reify_or (hβ : Fmla.reify v fβ a) (hβ : Fmla.reify v fβ b) :
Fmla.reify v (fβ.and fβ) (a β¨ b) := by |
refine β¨fun H β¦ by_contra fun hn β¦ H β¨fun c h β¦ by_contra fun hn' β¦ ?_β©β©
rcases List.mem_append.1 h with h | h
Β· exact hn <| Or.inl <| hβ.1 fun Hc β¦ hn' <| Hc.1 _ h
Β· exact hn <| Or.inr <| hβ.1 fun Hc β¦ hn' <| Hc.1 _ h
| 7 |
import Mathlib.Analysis.NormedSpace.Multilinear.Curry
#align_import analysis.calculus.formal_multilinear_series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open Set Fin Topology
-- Porting note: added explicit universes to fix compile
universe u u' v w x
... | Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean | 111 | 114 | theorem removeZero_of_pos (p : FormalMultilinearSeries π E F) {n : β} (h : 0 < n) :
p.removeZero n = p n := by |
rw [β Nat.succ_pred_eq_of_pos h]
rfl
| 8 |
import Mathlib.Analysis.NormedSpace.Multilinear.Curry
#align_import analysis.calculus.formal_multilinear_series from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
noncomputable section
open Set Fin Topology
-- Porting note: added explicit universes to fix compile
universe u u' v w x
... | Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean | 119 | 124 | theorem congr (p : FormalMultilinearSeries π E F) {m n : β} {v : Fin m β E} {w : Fin n β E}
(h1 : m = n) (h2 : β (i : β) (him : i < m) (hin : i < n), v β¨i, himβ© = w β¨i, hinβ©) :
p m v = p n w := by |
subst n
congr with β¨i, hiβ©
exact h2 i hi hi
| 8 |
import Aesop.Nanos
import Aesop.Util.UnionFind
import Aesop.Util.UnorderedArraySet
import Batteries.Data.String
import Batteries.Lean.Expr
import Batteries.Lean.Meta.DiscrTree
import Batteries.Lean.PersistentHashSet
import Lean.Meta.Tactic.TryThis
open Lean
open Lean.Meta Lean.Elab.Tactic
namespace Aesop.Array
| .lake/packages/aesop/Aesop/Util/Basic.lean | 21 | 24 | theorem size_modify (a : Array Ξ±) (i : Nat) (f : Ξ± β Ξ±) :
(a.modify i f).size = a.size := by |
simp only [Array.modify, Id.run, Array.modifyM]
split <;> simp
| 9 |
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
#align_import category_theory.limits.shapes.zero_objects from "leanprover-community/mathlib"@"74333bd53d25b6809203a2bfae80eea5fc1fc076"
noncomputable section
universe v u v' u'
open CategoryTheory
open CategoryTheory.Category
variable {C : Type u} [Category... | Mathlib/CategoryTheory/Limits/Shapes/ZeroObjects.lean | 117 | 123 | theorem of_iso (hY : IsZero Y) (e : X β
Y) : IsZero X := by |
refine β¨fun Z => β¨β¨β¨e.hom β« hY.to_ Zβ©, fun f => ?_β©β©,
fun Z => β¨β¨β¨hY.from_ Z β« e.invβ©, fun f => ?_β©β©β©
Β· rw [β cancel_epi e.inv]
apply hY.eq_of_src
Β· rw [β cancel_mono e.hom]
apply hY.eq_of_tgt
| 10 |
import Mathlib.CategoryTheory.EffectiveEpi.Basic
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks
import Mathlib.Tactic.ApplyFun
namespace CategoryTheory
open Limits
variable {C : Type*} [Category C]
noncomputable
def effectiveEpiStructIsColimitDescOfEffectiveEpiFamily {B : C} {Ξ± : Type*} (X : Ξ± β C)
(c... | Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean | 61 | 93 | theorem effectiveEpiFamilyStructOfEffectiveEpiDesc_aux {B : C} {Ξ± : Type*} {X : Ξ± β C}
{Ο : (a : Ξ±) β X a βΆ B} [HasCoproduct X]
[β {Z : C} (g : Z βΆ β X) (a : Ξ±), HasPullback g (Sigma.ΞΉ X a)]
[β {Z : C} (g : Z βΆ β X), HasCoproduct fun a β¦ pullback g (Sigma.ΞΉ X a)]
[β {Z : C} (g : Z βΆ β X), Epi (Sigma.des... |
apply_fun ((Sigma.desc fun a β¦ pullback.fst (f := gβ) (g := (Sigma.ΞΉ X a))) β« Β·) using
(fun a b β¦ (cancel_epi _).mp)
ext a
simp only [colimit.ΞΉ_desc_assoc, Discrete.functor_obj, Cofan.mk_pt, Cofan.mk_ΞΉ_app]
rw [β Category.assoc, pullback.condition]
simp only [Category.assoc, colimit.ΞΉ_desc, Cofan.mk_pt, ... | 11 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 63 | 63 | theorem boundary_top : β (β€ : Ξ±) = β₯ := by | rw [boundary, hnot_top, inf_bot_eq]
| 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 71 | 72 | theorem boundary_hnot_hnot (a : Ξ±) : β (οΏ’οΏ’a) = β (οΏ’a) := by |
simp_rw [boundary, hnot_hnot_hnot, inf_comm]
| 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 76 | 76 | theorem hnot_boundary (a : Ξ±) : οΏ’β a = β€ := by | rw [boundary, hnot_inf_distrib, sup_hnot_self]
| 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 80 | 82 | theorem boundary_inf (a b : Ξ±) : β (a β b) = β a β b β a β β b := by |
unfold boundary
rw [hnot_inf_distrib, inf_sup_left, inf_right_comm, β inf_assoc]
| 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 89 | 93 | theorem boundary_sup_le : β (a β b) β€ β a β β b := by |
rw [boundary, inf_sup_right]
exact
sup_le_sup (inf_le_inf_left _ <| hnot_anti le_sup_left)
(inf_le_inf_left _ <| hnot_anti le_sup_right)
| 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 105 | 117 | theorem boundary_le_boundary_sup_sup_boundary_inf_left : β a β€ β (a β b) β β (a β b) := by |
-- Porting note: the following simp generates the same term as mathlib3 if you remove
-- sup_inf_right from both. With sup_inf_right included, mathlib4 and mathlib3 generate
-- different terms
simp only [boundary, sup_inf_left, sup_inf_right, sup_right_idem, le_inf_iff, sup_assoc,
sup_comm _ a]
refine β¨β¨... | 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 120 | 122 | theorem boundary_le_boundary_sup_sup_boundary_inf_right : β b β€ β (a β b) β β (a β b) := by |
rw [sup_comm a, inf_comm]
exact boundary_le_boundary_sup_sup_boundary_inf_left
| 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 132 | 132 | theorem boundary_idem (a : Ξ±) : β β a = β a := by | rw [boundary, hnot_boundary, inf_top_eq]
| 12 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Tactic.Common
#align_import order.heyting.boundary from "leanprover-community/mathlib"@"70d50ecfd4900dd6d328da39ab7ebd516abe4025"
variable {Ξ± : Type*}
namespace Coheyting
variable [CoheytingAlgebra Ξ±] {a b : Ξ±}
def boundary (a : Ξ±) : Ξ± :=
a β οΏ’a
#align cohe... | Mathlib/Order/Heyting/Boundary.lean | 135 | 137 | theorem hnot_hnot_sup_boundary (a : Ξ±) : οΏ’οΏ’a β β a = a := by |
rw [boundary, sup_inf_left, hnot_sup_self, inf_top_eq, sup_eq_right]
exact hnot_hnot_le
| 12 |
import Mathlib.Topology.Constructions
#align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494"
open Set Filter Function Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*}
variable [TopologicalSpace Ξ±]
@[simp]
theorem nhds_bind_nhdsW... | Mathlib/Topology/ContinuousOn.lean | 57 | 59 | theorem mem_closure_ne_iff_frequently_within {z : Ξ±} {s : Set Ξ±} :
z β closure (s \ {z}) β βαΆ x in π[β ] z, x β s := by |
simp [mem_closure_iff_frequently, frequently_nhdsWithin_iff]
| 13 |
import Mathlib.Topology.Constructions
#align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494"
open Set Filter Function Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*}
variable [TopologicalSpace Ξ±]
@[simp]
theorem nhds_bind_nhdsW... | Mathlib/Topology/ContinuousOn.lean | 63 | 67 | theorem eventually_nhdsWithin_nhdsWithin {a : Ξ±} {s : Set Ξ±} {p : Ξ± β Prop} :
(βαΆ y in π[s] a, βαΆ x in π[s] y, p x) β βαΆ x in π[s] a, p x := by |
refine β¨fun h => ?_, fun h => (eventually_nhds_nhdsWithin.2 h).filter_mono inf_le_leftβ©
simp only [eventually_nhdsWithin_iff] at h β’
exact h.mono fun x hx hxs => (hx hxs).self_of_nhds hxs
| 13 |
import Mathlib.Topology.Constructions
#align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494"
open Set Filter Function Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*}
variable [TopologicalSpace Ξ±]
@[simp]
theorem nhds_bind_nhdsW... | Mathlib/Topology/ContinuousOn.lean | 75 | 76 | theorem nhdsWithin_univ (a : Ξ±) : π[Set.univ] a = π a := by |
rw [nhdsWithin, principal_univ, inf_top_eq]
| 13 |
import Mathlib.Topology.Constructions
#align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494"
open Set Filter Function Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*}
variable [TopologicalSpace Ξ±]
@[simp]
theorem nhds_bind_nhdsW... | Mathlib/Topology/ContinuousOn.lean | 89 | 91 | theorem mem_nhdsWithin {t : Set Ξ±} {a : Ξ±} {s : Set Ξ±} :
t β π[s] a β β u, IsOpen u β§ a β u β§ u β© s β t := by |
simpa only [and_assoc, and_left_comm] using (nhdsWithin_basis_open a s).mem_iff
| 13 |
import Mathlib.Topology.Constructions
#align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494"
open Set Filter Function Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*}
variable [TopologicalSpace Ξ±]
@[simp]
theorem nhds_bind_nhdsW... | Mathlib/Topology/ContinuousOn.lean | 104 | 107 | theorem diff_mem_nhdsWithin_diff {x : Ξ±} {s t : Set Ξ±} (hs : s β π[t] x) (t' : Set Ξ±) :
s \ t' β π[t \ t'] x := by |
rw [nhdsWithin, diff_eq, diff_eq, β inf_principal, β inf_assoc]
exact inter_mem_inf hs (mem_principal_self _)
| 13 |
import Mathlib.Topology.Constructions
#align_import topology.continuous_on from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494"
open Set Filter Function Topology Filter
variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*}
variable [TopologicalSpace Ξ±]
@[simp]
theorem nhds_bind_nhdsW... | Mathlib/Topology/ContinuousOn.lean | 110 | 113 | theorem nhds_of_nhdsWithin_of_nhds {s t : Set Ξ±} {a : Ξ±} (h1 : s β π a) (h2 : t β π[s] a) :
t β π a := by |
rcases mem_nhdsWithin_iff_exists_mem_nhds_inter.mp h2 with β¨_, Hw, hwβ©
exact (π a).sets_of_superset ((π a).inter_sets Hw h1) hw
| 13 |
import Mathlib.Topology.Algebra.UniformConvergence
#align_import topology.algebra.equicontinuity from "leanprover-community/mathlib"@"01ad394a11bf06b950232720cf7e8fc6b22f0d6a"
open Function
open UniformConvergence
@[to_additive]
| Mathlib/Topology/Algebra/Equicontinuity.lean | 20 | 31 | theorem equicontinuous_of_equicontinuousAt_one {ΞΉ G M hom : Type*} [TopologicalSpace G]
[UniformSpace M] [Group G] [Group M] [TopologicalGroup G] [UniformGroup M]
[FunLike hom G M] [MonoidHomClass hom G M] (F : ΞΉ β hom)
(hf : EquicontinuousAt ((β) β F) (1 : G)) :
Equicontinuous ((β) β F) := by |
rw [equicontinuous_iff_continuous]
rw [equicontinuousAt_iff_continuousAt] at hf
let Ο : G β* (ΞΉ βα΅€ M) :=
{ toFun := swap ((β) β F)
map_one' := by dsimp [UniformFun]; ext; exact map_one _
map_mul' := fun a b => by dsimp [UniformFun]; ext; exact map_mul _ _ _ }
exact continuous_of_continuousAt_on... | 14 |
import Mathlib.Topology.Algebra.UniformConvergence
#align_import topology.algebra.equicontinuity from "leanprover-community/mathlib"@"01ad394a11bf06b950232720cf7e8fc6b22f0d6a"
open Function
open UniformConvergence
@[to_additive]
theorem equicontinuous_of_equicontinuousAt_one {ΞΉ G M hom : Type*} [TopologicalSpac... | Mathlib/Topology/Algebra/Equicontinuity.lean | 36 | 47 | theorem uniformEquicontinuous_of_equicontinuousAt_one {ΞΉ G M hom : Type*} [UniformSpace G]
[UniformSpace M] [Group G] [Group M] [UniformGroup G] [UniformGroup M]
[FunLike hom G M] [MonoidHomClass hom G M]
(F : ΞΉ β hom) (hf : EquicontinuousAt ((β) β F) (1 : G)) :
UniformEquicontinuous ((β) β F) := by |
rw [uniformEquicontinuous_iff_uniformContinuous]
rw [equicontinuousAt_iff_continuousAt] at hf
let Ο : G β* (ΞΉ βα΅€ M) :=
{ toFun := swap ((β) β F)
map_one' := by dsimp [UniformFun]; ext; exact map_one _
map_mul' := fun a b => by dsimp [UniformFun]; ext; exact map_mul _ _ _ }
exact uniformContinuo... | 14 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 38 | 39 | theorem shiftLeft'_ne_zero_left (b) {m} (h : m β 0) (n) : shiftLeft' b m n β 0 := by |
induction n <;> simp [bit_ne_zero, shiftLeft', *]
| 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 51 | 51 | theorem size_zero : size 0 = 0 := by | simp [size]
| 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 55 | 61 | theorem size_bit {b n} (h : bit b n β 0) : size (bit b n) = succ (size n) := by |
rw [size]
conv =>
lhs
rw [binaryRec]
simp [h]
rw [div2_bit]
| 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 85 | 97 | theorem size_shiftLeft' {b m n} (h : shiftLeft' b m n β 0) :
size (shiftLeft' b m n) = size m + n := by |
induction' n with n IH <;> simp [shiftLeft'] at h β’
rw [size_bit h, Nat.add_succ]
by_cases s0 : shiftLeft' b m n = 0 <;> [skip; rw [IH s0]]
rw [s0] at h β’
cases b; Β· exact absurd rfl h
have : shiftLeft' true m n + 1 = 1 := congr_arg (Β· + 1) s0
rw [shiftLeft'_tt_eq_mul_pow] at this
obtain rfl := succ.in... | 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 103 | 104 | theorem size_shiftLeft {m} (h : m β 0) (n) : size (m <<< n) = size m + n := by |
simp only [size_shiftLeft' (shiftLeft'_ne_zero_left _ h _), β shiftLeft'_false]
| 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 107 | 116 | theorem lt_size_self (n : β) : n < 2 ^ size n := by |
rw [β one_shiftLeft]
have : β {n}, n = 0 β n < 1 <<< (size n) := by simp
apply binaryRec _ _ n
Β· apply this rfl
intro b n IH
by_cases h : bit b n = 0
Β· apply this h
rw [size_bit h, shiftLeft_succ, shiftLeft_eq, one_mul, β bit0_val]
exact bit_lt_bit0 _ (by simpa [shiftLeft_eq, shiftRight_eq_div_pow] u... | 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 137 | 138 | theorem lt_size {m n : β} : m < size n β 2 ^ m β€ n := by |
rw [β not_lt, Decidable.iff_not_comm, not_lt, size_le]
| 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 141 | 141 | theorem size_pos {n : β} : 0 < size n β 0 < n := by | rw [lt_size]; rfl
| 15 |
import Mathlib.Data.Nat.Bits
import Mathlib.Order.Lattice
#align_import data.nat.size from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
namespace Nat
section
set_option linter.deprecated false
theorem shiftLeft_eq_mul_pow (m) : β n, m <<< n = m * 2 ^ n := shiftLeft_eq _
#align nat.... | Mathlib/Data/Nat/Size.lean | 144 | 145 | theorem size_eq_zero {n : β} : size n = 0 β n = 0 := by |
simpa [Nat.pos_iff_ne_zero, not_iff_not] using size_pos
| 15 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 27 | 27 | theorem dist_comm (n m : β) : dist n m = dist m n := by | simp [dist, add_comm]
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 31 | 31 | theorem dist_self (n : β) : dist n n = 0 := by | simp [dist, tsub_self]
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 42 | 42 | theorem dist_eq_zero {n m : β} (h : n = m) : dist n m = 0 := by | rw [h, dist_self]
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 45 | 46 | theorem dist_eq_sub_of_le {n m : β} (h : n β€ m) : dist n m = m - n := by |
rw [dist, tsub_eq_zero_iff_le.mpr h, zero_add]
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 49 | 50 | theorem dist_eq_sub_of_le_right {n m : β} (h : m β€ n) : dist n m = n - m := by |
rw [dist_comm]; apply dist_eq_sub_of_le h
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 57 | 57 | theorem dist_tri_right (n m : β) : m β€ n + dist n m := by | rw [add_comm]; apply dist_tri_left
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 60 | 60 | theorem dist_tri_left' (n m : β) : n β€ dist n m + m := by | rw [dist_comm]; apply dist_tri_left
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 63 | 63 | theorem dist_tri_right' (n m : β) : n β€ m + dist n m := by | rw [dist_comm]; apply dist_tri_right
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 74 | 78 | theorem dist_add_add_right (n k m : β) : dist (n + k) (m + k) = dist n m :=
calc
dist (n + k) (m + k) = n + k - (m + k) + (m + k - (n + k)) := rfl
_ = n - m + (m + k - (n + k)) := by | rw [@add_tsub_add_eq_tsub_right]
_ = n - m + (m - n) := by rw [@add_tsub_add_eq_tsub_right]
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 81 | 82 | theorem dist_add_add_left (k n m : β) : dist (k + n) (k + m) = dist n m := by |
rw [add_comm k n, add_comm k m]; apply dist_add_add_right
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 85 | 89 | theorem dist_eq_intro {n m k l : β} (h : n + m = k + l) : dist n k = dist l m :=
calc
dist n k = dist (n + m) (k + m) := by | rw [dist_add_add_right]
_ = dist (k + l) (k + m) := by rw [h]
_ = dist l m := by rw [dist_add_add_left]
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 92 | 96 | theorem dist.triangle_inequality (n m k : β) : dist n k β€ dist n m + dist m k := by |
have : dist n m + dist m k = n - m + (m - k) + (k - m + (m - n)) := by
simp [dist, add_comm, add_left_comm, add_assoc]
rw [this, dist]
exact add_le_add tsub_le_tsub_add_tsub tsub_le_tsub_add_tsub
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 99 | 100 | theorem dist_mul_right (n k m : β) : dist (n * k) (m * k) = dist n m * k := by |
rw [dist, dist, right_distrib, tsub_mul n, tsub_mul m]
| 16 |
import Mathlib.Algebra.Order.Ring.Nat
#align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b"
namespace Nat
def dist (n m : β) :=
n - m + (m - n)
#align nat.dist Nat.dist
-- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't pr... | Mathlib/Data/Nat/Dist.lean | 103 | 104 | theorem dist_mul_left (k n m : β) : dist (k * n) (k * m) = k * dist n m := by |
rw [mul_comm k n, mul_comm k m, dist_mul_right, mul_comm]
| 16 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4