Datasets:

Modalities:
Text
Formats:
json
Libraries:
Datasets
pandas
path
stringlengths
12
84
imports
sequencelengths
0
4.45k
premises
listlengths
0
625
.lake/packages/lean4/src/lean/Init/Prelude.lean
[]
[ { "full_name": "id", "code": "@[inline] def id {α : Sort u} (a : α) : α := a", "start": [ 21, 1 ], "end": [ 33, 47 ], "kind": "commanddeclaration" }, { "full_name": "Function.comp", "code": "@[inline] def Function.comp {α : Sort u} {β : Sort v} {δ : Sort w} (f : β → δ) (g : α → β) : α → δ :=\n fun x => f (g x)", "start": [ 35, 1 ], "end": [ 53, 19 ], "kind": "commanddeclaration" }, { "full_name": "Function.const", "code": "@[inline] def Function.const {α : Sort u} (β : Sort v) (a : α) : β → α :=\n fun _ => a", "start": [ 55, 1 ], "end": [ 67, 13 ], "kind": "commanddeclaration" }, { "full_name": "letFun", "code": "@[irreducible] def letFun {α : Sort u} {β : α → Sort v} (v : α) (f : (x : α) → β x) : β v := f v", "start": [ 69, 1 ], "end": [ 80, 97 ], "kind": "commanddeclaration" }, { "full_name": "inferInstance", "code": "abbrev inferInstance {α : Sort u} [i : α] : α := i", "start": [ 83, 1 ], "end": [ 99, 51 ], "kind": "commanddeclaration" }, { "full_name": "inferInstanceAs", "code": "abbrev inferInstanceAs (α : Sort u) [i : α] : α := i", "start": [ 102, 1 ], "end": [ 113, 53 ], "kind": "commanddeclaration" }, { "full_name": "PUnit", "code": "inductive PUnit : Sort u where\n \n | unit : PUnit", "start": [ 116, 1 ], "end": [ 124, 17 ], "kind": "commanddeclaration" }, { "full_name": "Unit", "code": "abbrev Unit : Type := PUnit", "start": [ 126, 1 ], "end": [ 142, 28 ], "kind": "commanddeclaration" }, { "full_name": "Unit.unit", "code": "@[match_pattern] abbrev Unit.unit : Unit := PUnit.unit", "start": [ 144, 1 ], "end": [ 148, 55 ], "kind": "commanddeclaration" }, { "full_name": "lcErased", "code": "unsafe axiom lcErased : Type", "start": [ 150, 1 ], "end": [ 151, 29 ], "kind": "commanddeclaration" }, { "full_name": "lcProof", "code": "unsafe axiom lcProof {α : Prop} : α", "start": [ 153, 1 ], "end": [ 162, 36 ], "kind": "commanddeclaration" }, { "full_name": "lcCast", "code": "unsafe axiom lcCast {α : Sort u} {β : Sort v} (a : α) : β", "start": [ 164, 1 ], "end": [ 167, 58 ], "kind": "commanddeclaration" }, { "full_name": "lcUnreachable", "code": "unsafe axiom lcUnreachable {α : Sort u} : α", "start": [ 170, 1 ], "end": [ 182, 44 ], "kind": "commanddeclaration" }, { "full_name": "True", "code": "inductive True : Prop where\n \n | intro : True", "start": [ 184, 1 ], "end": [ 192, 17 ], "kind": "commanddeclaration" }, { "full_name": "False", "code": "inductive False : Prop", "start": [ 194, 1 ], "end": [ 202, 23 ], "kind": "commanddeclaration" }, { "full_name": "Empty", "code": "inductive Empty : Type", "start": [ 204, 1 ], "end": [ 208, 23 ], "kind": "commanddeclaration" }, { "full_name": "PEmpty", "code": "inductive PEmpty : Sort u where", "start": [ 211, 1 ], "end": [ 215, 32 ], "kind": "commanddeclaration" }, { "full_name": "Not", "code": "def Not (a : Prop) : Prop := a → False", "start": [ 217, 1 ], "end": [ 224, 39 ], "kind": "commanddeclaration" }, { "full_name": "False.elim", "code": "@[macro_inline] def False.elim {C : Sort u} (h : False) : C :=\n h.rec", "start": [ 226, 1 ], "end": [ 237, 8 ], "kind": "commanddeclaration" }, { "full_name": "absurd", "code": "@[macro_inline] def absurd {a : Prop} {b : Sort v} (h₁ : a) (h₂ : Not a) : b :=\n (h₂ h₁).rec", "start": [ 239, 1 ], "end": [ 247, 14 ], "kind": "commanddeclaration" }, { "full_name": "Eq", "code": "inductive Eq : α → α → Prop where\n \n | refl (a : α) : Eq a a", "start": [ 249, 1 ], "end": [ 279, 26 ], "kind": "commanddeclaration" }, { "full_name": "Eq.ndrec", "code": "@[simp] abbrev Eq.ndrec.{u1, u2} {α : Sort u2} {a : α} {motive : α → Sort u1} (m : motive a) {b : α} (h : Eq a b) : motive b :=\n h.rec m", "start": [ 281, 1 ], "end": [ 283, 10 ], "kind": "commanddeclaration" }, { "full_name": "rfl", "code": "@[match_pattern] def rfl {α : Sort u} {a : α} : Eq a a := Eq.refl a", "start": [ 285, 1 ], "end": [ 294, 68 ], "kind": "commanddeclaration" }, { "full_name": "id_eq", "code": "@[simp] theorem id_eq (a : α) : Eq (id a) a", "start": [ 296, 1 ], "end": [ 297, 51 ], "kind": "commanddeclaration" }, { "full_name": "Eq.subst", "code": "theorem Eq.subst {α : Sort u} {motive : α → Prop} {a b : α} (h₁ : Eq a b) (h₂ : motive a) : motive b", "start": [ 299, 1 ], "end": [ 313, 17 ], "kind": "commanddeclaration" }, { "full_name": "Eq.symm", "code": "theorem Eq.symm {α : Sort u} {a b : α} (h : Eq a b) : Eq b a", "start": [ 315, 1 ], "end": [ 324, 10 ], "kind": "commanddeclaration" }, { "full_name": "Eq.trans", "code": "theorem Eq.trans {α : Sort u} {a b c : α} (h₁ : Eq a b) (h₂ : Eq b c) : Eq a c", "start": [ 326, 1 ], "end": [ 336, 10 ], "kind": "commanddeclaration" }, { "full_name": "cast", "code": "@[macro_inline] def cast {α β : Sort u} (h : Eq α β) (a : α) : β :=\n h.rec a", "start": [ 338, 1 ], "end": [ 350, 10 ], "kind": "commanddeclaration" }, { "full_name": "congrArg", "code": "theorem congrArg {α : Sort u} {β : Sort v} {a₁ a₂ : α} (f : α → β) (h : Eq a₁ a₂) : Eq (f a₁) (f a₂)", "start": [ 352, 1 ], "end": [ 363, 10 ], "kind": "commanddeclaration" }, { "full_name": "congr", "code": "theorem congr {α : Sort u} {β : Sort v} {f₁ f₂ : α → β} {a₁ a₂ : α} (h₁ : Eq f₁ f₂) (h₂ : Eq a₁ a₂) : Eq (f₁ a₁) (f₂ a₂)", "start": [ 365, 1 ], "end": [ 373, 16 ], "kind": "commanddeclaration" }, { "full_name": "congrFun", "code": "theorem congrFun {α : Sort u} {β : α → Sort v} {f g : (x : α) → β x} (h : Eq f g) (a : α) : Eq (f a) (g a)", "start": [ 375, 1 ], "end": [ 377, 10 ], "kind": "commanddeclaration" }, { "full_name": "Quot.lcInv", "code": "unsafe axiom Quot.lcInv {α : Sort u} {r : α → α → Prop} (q : Quot r) : α", "start": [ 439, 1 ], "end": [ 442, 73 ], "kind": "commanddeclaration" }, { "full_name": "HEq", "code": "inductive HEq : {α : Sort u} → α → {β : Sort u} → β → Prop where\n \n | refl (a : α) : HEq a a", "start": [ 444, 1 ], "end": [ 458, 27 ], "kind": "commanddeclaration" }, { "full_name": "HEq.rfl", "code": "@[match_pattern] protected def HEq.rfl {α : Sort u} {a : α} : HEq a a :=\n HEq.refl a", "start": [ 460, 1 ], "end": [ 462, 13 ], "kind": "commanddeclaration" }, { "full_name": "eq_of_heq", "code": "theorem eq_of_heq {α : Sort u} {a a' : α} (h : HEq a a') : Eq a a'", "start": [ 464, 1 ], "end": [ 468, 22 ], "kind": "commanddeclaration" }, { "full_name": "Prod", "code": "structure Prod (α : Type u) (β : Type v) where\n \n mk ::\n \n fst : α\n \n snd : β", "start": [ 470, 1 ], "end": [ 485, 10 ], "kind": "commanddeclaration" }, { "full_name": "PProd", "code": "@[pp_using_anonymous_constructor]\nstructure PProd (α : Sort u) (β : Sort v) where\n \n fst : α\n \n snd : β", "start": [ 489, 1 ], "end": [ 498, 10 ], "kind": "commanddeclaration" }, { "full_name": "MProd", "code": "structure MProd (α β : Type u) where\n \n fst : α\n \n snd : β", "start": [ 500, 1 ], "end": [ 508, 10 ], "kind": "commanddeclaration" }, { "full_name": "And", "code": "@[pp_using_anonymous_constructor]\nstructure And (a b : Prop) : Prop where\n \n intro ::\n \n left : a\n \n right : b", "start": [ 510, 1 ], "end": [ 524, 12 ], "kind": "commanddeclaration" }, { "full_name": "Or", "code": "inductive Or (a b : Prop) : Prop where\n \n | inl (h : a) : Or a b\n \n | inr (h : b) : Or a b", "start": [ 526, 1 ], "end": [ 536, 25 ], "kind": "commanddeclaration" }, { "full_name": "Or.intro_left", "code": "theorem Or.intro_left (b : Prop) (h : a) : Or a b", "start": [ 538, 1 ], "end": [ 540, 11 ], "kind": "commanddeclaration" }, { "full_name": "Or.intro_right", "code": "theorem Or.intro_right (a : Prop) (h : b) : Or a b", "start": [ 542, 1 ], "end": [ 544, 11 ], "kind": "commanddeclaration" }, { "full_name": "Or.elim", "code": "theorem Or.elim {c : Prop} (h : Or a b) (left : a → c) (right : b → c) : c", "start": [ 546, 1 ], "end": [ 553, 24 ], "kind": "commanddeclaration" }, { "full_name": "Or.resolve_left", "code": "theorem Or.resolve_left (h: Or a b) (na : Not a) : b", "start": [ 555, 1 ], "end": [ 555, 81 ], "kind": "commanddeclaration" }, { "full_name": "Or.resolve_right", "code": "theorem Or.resolve_right (h: Or a b) (nb : Not b) : a", "start": [ 556, 1 ], "end": [ 556, 81 ], "kind": "commanddeclaration" }, { "full_name": "Or.neg_resolve_left", "code": "theorem Or.neg_resolve_left (h : Or (Not a) b) (ha : a) : b", "start": [ 557, 1 ], "end": [ 557, 86 ], "kind": "commanddeclaration" }, { "full_name": "Or.neg_resolve_right", "code": "theorem Or.neg_resolve_right (h : Or a (Not b)) (nb : b) : a", "start": [ 558, 1 ], "end": [ 558, 86 ], "kind": "commanddeclaration" }, { "full_name": "Bool", "code": "inductive Bool : Type where\n \n | false : Bool\n \n | true : Bool", "start": [ 560, 1 ], "end": [ 571, 16 ], "kind": "commanddeclaration" }, { "full_name": "Subtype", "code": "@[pp_using_anonymous_constructor]\nstructure Subtype {α : Sort u} (p : α → Prop) where\n \n val : α\n \n property : p val", "start": [ 575, 1 ], "end": [ 590, 19 ], "kind": "commanddeclaration" }, { "full_name": "optParam", "code": "@[reducible] def optParam (α : Sort u) (default : α) : Sort u := α", "start": [ 593, 1 ], "end": [ 600, 67 ], "kind": "commanddeclaration" }, { "full_name": "outParam", "code": "@[reducible] def outParam (α : Sort u) : Sort u := α", "start": [ 602, 1 ], "end": [ 618, 53 ], "kind": "commanddeclaration" }, { "full_name": "semiOutParam", "code": "@[reducible] def semiOutParam (α : Sort u) : Sort u := α", "start": [ 620, 1 ], "end": [ 641, 57 ], "kind": "commanddeclaration" }, { "full_name": "namedPattern", "code": "@[reducible] def namedPattern {α : Sort u} (x a : α) (h : Eq x a) : α := a", "start": [ 644, 1 ], "end": [ 645, 75 ], "kind": "commanddeclaration" }, { "full_name": "sorryAx", "code": "@[extern \"lean_sorry\", never_extract]\naxiom sorryAx (α : Sort u) (synthetic := false) : α", "start": [ 647, 1 ], "end": [ 664, 52 ], "kind": "commanddeclaration" }, { "full_name": "eq_false_of_ne_true", "code": "theorem eq_false_of_ne_true : {b : Bool} → Not (Eq b true) → Eq b false", "start": [ 666, 1 ], "end": [ 668, 20 ], "kind": "commanddeclaration" }, { "full_name": "eq_true_of_ne_false", "code": "theorem eq_true_of_ne_false : {b : Bool} → Not (Eq b false) → Eq b true", "start": [ 670, 1 ], "end": [ 672, 35 ], "kind": "commanddeclaration" }, { "full_name": "ne_false_of_eq_true", "code": "theorem ne_false_of_eq_true : {b : Bool} → Eq b true → Not (Eq b false)", "start": [ 674, 1 ], "end": [ 676, 35 ], "kind": "commanddeclaration" }, { "full_name": "ne_true_of_eq_false", "code": "theorem ne_true_of_eq_false : {b : Bool} → Eq b false → Not (Eq b true)", "start": [ 678, 1 ], "end": [ 680, 44 ], "kind": "commanddeclaration" }, { "full_name": "Inhabited", "code": "class Inhabited (α : Sort u) where\n \n default : α", "start": [ 682, 1 ], "end": [ 697, 14 ], "kind": "commanddeclaration" }, { "full_name": "Nonempty", "code": "class inductive Nonempty (α : Sort u) : Prop where\n \n | intro (val : α) : Nonempty α", "start": [ 701, 1 ], "end": [ 711, 33 ], "kind": "commanddeclaration" }, { "full_name": "Classical.choice", "code": "axiom Classical.choice {α : Sort u} : Nonempty α → α", "start": [ 713, 1 ], "end": [ 735, 53 ], "kind": "commanddeclaration" }, { "full_name": "Nonempty.elim", "code": "protected theorem Nonempty.elim {α : Sort u} {p : Prop} (h₁ : Nonempty α) (h₂ : α → p) : p", "start": [ 737, 1 ], "end": [ 745, 20 ], "kind": "commanddeclaration" }, { "full_name": "Classical.ofNonempty", "code": "noncomputable def Classical.ofNonempty {α : Sort u} [Nonempty α] : α :=\n Classical.choice inferInstance", "start": [ 750, 1 ], "end": [ 755, 33 ], "kind": "commanddeclaration" }, { "full_name": "PLift", "code": "structure PLift (α : Sort u) : Type u where\n up ::\n down : α", "start": [ 774, 1 ], "end": [ 777, 49 ], "kind": "commanddeclaration" }, { "full_name": "PLift.up_down", "code": "theorem PLift.up_down {α : Sort u} (b : PLift α) : Eq (up (down b)) b", "start": [ 779, 1 ], "end": [ 780, 77 ], "kind": "commanddeclaration" }, { "full_name": "PLift.down_up", "code": "theorem PLift.down_up {α : Sort u} (a : α) : Eq (down (up a)) a", "start": [ 782, 1 ], "end": [ 783, 71 ], "kind": "commanddeclaration" }, { "full_name": "NonemptyType", "code": "def NonemptyType := Subtype fun α : Type u => Nonempty α", "start": [ 785, 1 ], "end": [ 791, 57 ], "kind": "commanddeclaration" }, { "full_name": "NonemptyType.type", "code": "abbrev NonemptyType.type (type : NonemptyType.{u}) : Type u :=\n type.val", "start": [ 793, 1 ], "end": [ 795, 11 ], "kind": "commanddeclaration" }, { "full_name": "ULift", "code": "structure ULift.{r, s} (α : Type s) : Type (max s r) where\n up ::\n down : α", "start": [ 801, 1 ], "end": [ 811, 49 ], "kind": "commanddeclaration" }, { "full_name": "ULift.up_down", "code": "theorem ULift.up_down {α : Type u} (b : ULift.{v} α) : Eq (up (down b)) b", "start": [ 813, 1 ], "end": [ 814, 81 ], "kind": "commanddeclaration" }, { "full_name": "ULift.down_up", "code": "theorem ULift.down_up {α : Type u} (a : α) : Eq (down (up.{v} a)) a", "start": [ 816, 1 ], "end": [ 817, 75 ], "kind": "commanddeclaration" }, { "full_name": "Decidable", "code": "class inductive Decidable (p : Prop) where\n \n | isFalse (h : Not p) : Decidable p\n \n | isTrue (h : p) : Decidable p", "start": [ 819, 1 ], "end": [ 843, 33 ], "kind": "commanddeclaration" }, { "full_name": "Decidable.decide", "code": "@[inline_if_reduce, nospecialize] def Decidable.decide (p : Prop) [h : Decidable p] : Bool :=\n h.casesOn (fun _ => false) (fun _ => true)", "start": [ 845, 1 ], "end": [ 852, 45 ], "kind": "commanddeclaration" }, { "full_name": "DecidablePred", "code": "abbrev DecidablePred {α : Sort u} (r : α → Prop) :=\n (a : α) → Decidable (r a)", "start": [ 856, 1 ], "end": [ 858, 28 ], "kind": "commanddeclaration" }, { "full_name": "DecidableRel", "code": "abbrev DecidableRel {α : Sort u} (r : α → α → Prop) :=\n (a b : α) → Decidable (r a b)", "start": [ 860, 1 ], "end": [ 862, 32 ], "kind": "commanddeclaration" }, { "full_name": "DecidableEq", "code": "abbrev DecidableEq (α : Sort u) :=\n (a b : α) → Decidable (Eq a b)", "start": [ 864, 1 ], "end": [ 869, 33 ], "kind": "commanddeclaration" }, { "full_name": "decEq", "code": "def decEq {α : Sort u} [inst : DecidableEq α] (a b : α) : Decidable (Eq a b) :=\n inst a b", "start": [ 871, 1 ], "end": [ 873, 11 ], "kind": "commanddeclaration" }, { "full_name": "decide_eq_true", "code": "theorem decide_eq_true : [inst : Decidable p] → p → Eq (decide p) true", "start": [ 876, 1 ], "end": [ 878, 35 ], "kind": "commanddeclaration" }, { "full_name": "decide_eq_false", "code": "theorem decide_eq_false : [Decidable p] → Not p → Eq (decide p) false", "start": [ 880, 1 ], "end": [ 882, 26 ], "kind": "commanddeclaration" }, { "full_name": "of_decide_eq_true", "code": "theorem of_decide_eq_true [inst : Decidable p] : Eq (decide p) true → p", "start": [ 884, 1 ], "end": [ 887, 70 ], "kind": "commanddeclaration" }, { "full_name": "of_decide_eq_false", "code": "theorem of_decide_eq_false [inst : Decidable p] : Eq (decide p) false → Not p", "start": [ 889, 1 ], "end": [ 892, 21 ], "kind": "commanddeclaration" }, { "full_name": "of_decide_eq_self_eq_true", "code": "theorem of_decide_eq_self_eq_true [inst : DecidableEq α] (a : α) : Eq (decide (Eq a a)) true", "start": [ 894, 1 ], "end": [ 897, 32 ], "kind": "commanddeclaration" }, { "full_name": "Bool.decEq", "code": "@[inline] def Bool.decEq (a b : Bool) : Decidable (Eq a b) :=\n match a, b with\n | false, false => isTrue rfl\n | false, true => isFalse (fun h => Bool.noConfusion h)\n | true, false => isFalse (fun h => Bool.noConfusion h)\n | true, true => isTrue rfl", "start": [ 899, 1 ], "end": [ 905, 32 ], "kind": "commanddeclaration" }, { "full_name": "BEq", "code": "class BEq (α : Type u) where\n \n beq : α → α → Bool", "start": [ 910, 1 ], "end": [ 923, 21 ], "kind": "commanddeclaration" }, { "full_name": "dite", "code": "@[macro_inline] def dite {α : Sort u} (c : Prop) [h : Decidable c] (t : c → α) (e : Not c → α) : α :=\n h.casesOn e t", "start": [ 931, 1 ], "end": [ 946, 16 ], "kind": "commanddeclaration" }, { "full_name": "ite", "code": "@[macro_inline] def ite {α : Sort u} (c : Prop) [h : Decidable c] (t e : α) : α :=\n h.casesOn (fun _ => e) (fun _ => t)", "start": [ 950, 1 ], "end": [ 971, 38 ], "kind": "commanddeclaration" }, { "full_name": "cond", "code": "@[macro_inline] def cond {α : Type u} (c : Bool) (x y : α) : α :=\n match c with\n | true => x\n | false => y", "start": [ 1000, 1 ], "end": [ 1009, 15 ], "kind": "commanddeclaration" }, { "full_name": "or", "code": "@[macro_inline] def or (x y : Bool) : Bool :=\n match x with\n | true => true\n | false => y", "start": [ 1011, 1 ], "end": [ 1020, 15 ], "kind": "commanddeclaration" }, { "full_name": "and", "code": "@[macro_inline] def and (x y : Bool) : Bool :=\n match x with\n | false => false\n | true => y", "start": [ 1022, 1 ], "end": [ 1031, 15 ], "kind": "commanddeclaration" }, { "full_name": "not", "code": "@[inline] def not : Bool → Bool\n | true => false\n | false => true", "start": [ 1033, 1 ], "end": [ 1039, 18 ], "kind": "commanddeclaration" }, { "full_name": "Nat", "code": "inductive Nat where\n \n | zero : Nat\n \n | succ (n : Nat) : Nat", "start": [ 1041, 1 ], "end": [ 1083, 25 ], "kind": "commanddeclaration" }, { "full_name": "OfNat", "code": "class OfNat (α : Type u) (_ : Nat) where\n \n ofNat : α", "start": [ 1088, 1 ], "end": [ 1105, 12 ], "kind": "commanddeclaration" }, { "full_name": "instOfNatNat", "code": "@[default_instance 100] \ninstance instOfNatNat (n : Nat) : OfNat Nat n where\n ofNat := n", "start": [ 1107, 1 ], "end": [ 1109, 13 ], "kind": "commanddeclaration" }, { "full_name": "LE", "code": "class LE (α : Type u) where\n \n le : α → α → Prop", "start": [ 1111, 1 ], "end": [ 1114, 20 ], "kind": "commanddeclaration" }, { "full_name": "LT", "code": "class LT (α : Type u) where\n \n lt : α → α → Prop", "start": [ 1116, 1 ], "end": [ 1119, 20 ], "kind": "commanddeclaration" }, { "full_name": "GE.ge", "code": "@[reducible] def GE.ge {α : Type u} [LE α] (a b : α) : Prop := LE.le b a", "start": [ 1121, 1 ], "end": [ 1122, 73 ], "kind": "commanddeclaration" }, { "full_name": "GT.gt", "code": "@[reducible] def GT.gt {α : Type u} [LT α] (a b : α) : Prop := LT.lt b a", "start": [ 1123, 1 ], "end": [ 1124, 73 ], "kind": "commanddeclaration" }, { "full_name": "Max", "code": "class Max (α : Type u) where\n \n max : α → α → α", "start": [ 1126, 1 ], "end": [ 1129, 18 ], "kind": "commanddeclaration" }, { "full_name": "maxOfLe", "code": "@[inline]\ndef maxOfLe [LE α] [DecidableRel (@LE.le α _)] : Max α where\n max x y := ite (LE.le x y) y x", "start": [ 1133, 1 ], "end": [ 1137, 33 ], "kind": "commanddeclaration" }, { "full_name": "Min", "code": "class Min (α : Type u) where\n \n min : α → α → α", "start": [ 1139, 1 ], "end": [ 1142, 18 ], "kind": "commanddeclaration" }, { "full_name": "minOfLe", "code": "@[inline]\ndef minOfLe [LE α] [DecidableRel (@LE.le α _)] : Min α where\n min x y := ite (LE.le x y) x y", "start": [ 1146, 1 ], "end": [ 1150, 33 ], "kind": "commanddeclaration" }, { "full_name": "Trans", "code": "class Trans (r : α → β → Sort u) (s : β → γ → Sort v) (t : outParam (α → γ → Sort w)) where\n \n trans : r a b → s b c → t a c", "start": [ 1152, 1 ], "end": [ 1163, 32 ], "kind": "commanddeclaration" }, { "full_name": "HAdd", "code": "class HAdd (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hAdd : α → β → γ", "start": [ 1173, 1 ], "end": [ 1180, 19 ], "kind": "commanddeclaration" }, { "full_name": "HSub", "code": "class HSub (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hSub : α → β → γ", "start": [ 1182, 1 ], "end": [ 1190, 19 ], "kind": "commanddeclaration" }, { "full_name": "HMul", "code": "class HMul (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hMul : α → β → γ", "start": [ 1192, 1 ], "end": [ 1199, 19 ], "kind": "commanddeclaration" }, { "full_name": "HDiv", "code": "class HDiv (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hDiv : α → β → γ", "start": [ 1201, 1 ], "end": [ 1217, 19 ], "kind": "commanddeclaration" }, { "full_name": "HMod", "code": "class HMod (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hMod : α → β → γ", "start": [ 1219, 1 ], "end": [ 1228, 19 ], "kind": "commanddeclaration" }, { "full_name": "HPow", "code": "class HPow (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hPow : α → β → γ", "start": [ 1230, 1 ], "end": [ 1237, 19 ], "kind": "commanddeclaration" }, { "full_name": "HAppend", "code": "class HAppend (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hAppend : α → β → γ", "start": [ 1239, 1 ], "end": [ 1246, 22 ], "kind": "commanddeclaration" }, { "full_name": "HOrElse", "code": "class HOrElse (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hOrElse : α → (Unit → β) → γ", "start": [ 1248, 1 ], "end": [ 1258, 31 ], "kind": "commanddeclaration" }, { "full_name": "HAndThen", "code": "class HAndThen (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hAndThen : α → (Unit → β) → γ", "start": [ 1260, 1 ], "end": [ 1270, 32 ], "kind": "commanddeclaration" }, { "full_name": "HAnd", "code": "class HAnd (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hAnd : α → β → γ", "start": [ 1272, 1 ], "end": [ 1276, 19 ], "kind": "commanddeclaration" }, { "full_name": "HXor", "code": "class HXor (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hXor : α → β → γ", "start": [ 1278, 1 ], "end": [ 1282, 19 ], "kind": "commanddeclaration" }, { "full_name": "HOr", "code": "class HOr (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hOr : α → β → γ", "start": [ 1284, 1 ], "end": [ 1288, 18 ], "kind": "commanddeclaration" }, { "full_name": "HShiftLeft", "code": "class HShiftLeft (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hShiftLeft : α → β → γ", "start": [ 1290, 1 ], "end": [ 1297, 25 ], "kind": "commanddeclaration" }, { "full_name": "HShiftRight", "code": "class HShiftRight (α : Type u) (β : Type v) (γ : outParam (Type w)) where\n \n hShiftRight : α → β → γ", "start": [ 1299, 1 ], "end": [ 1305, 26 ], "kind": "commanddeclaration" }, { "full_name": "Add", "code": "class Add (α : Type u) where\n \n add : α → α → α", "start": [ 1307, 1 ], "end": [ 1310, 18 ], "kind": "commanddeclaration" }, { "full_name": "Sub", "code": "class Sub (α : Type u) where\n \n sub : α → α → α", "start": [ 1312, 1 ], "end": [ 1315, 18 ], "kind": "commanddeclaration" }, { "full_name": "Mul", "code": "class Mul (α : Type u) where\n \n mul : α → α → α", "start": [ 1317, 1 ], "end": [ 1320, 18 ], "kind": "commanddeclaration" }, { "full_name": "Neg", "code": "class Neg (α : Type u) where\n \n neg : α → α", "start": [ 1322, 1 ], "end": [ 1329, 14 ], "kind": "commanddeclaration" }, { "full_name": "Div", "code": "class Div (α : Type u) where\n \n div : α → α → α", "start": [ 1331, 1 ], "end": [ 1334, 18 ], "kind": "commanddeclaration" }, { "full_name": "Mod", "code": "class Mod (α : Type u) where\n \n mod : α → α → α", "start": [ 1336, 1 ], "end": [ 1339, 18 ], "kind": "commanddeclaration" }, { "full_name": "Dvd", "code": "class Dvd (α : Type _) where\n \n dvd : α → α → Prop", "start": [ 1341, 1 ], "end": [ 1344, 21 ], "kind": "commanddeclaration" }, { "full_name": "Pow", "code": "class Pow (α : Type u) (β : Type v) where\n \n pow : α → β → α", "start": [ 1346, 1 ], "end": [ 1358, 18 ], "kind": "commanddeclaration" }, { "full_name": "NatPow", "code": "class NatPow (α : Type u) where\n \n protected pow : α → Nat → α", "start": [ 1360, 1 ], "end": [ 1368, 30 ], "kind": "commanddeclaration" }, { "full_name": "HomogeneousPow", "code": "class HomogeneousPow (α : Type u) where\n \n protected pow : α → α → α", "start": [ 1370, 1 ], "end": [ 1380, 28 ], "kind": "commanddeclaration" }, { "full_name": "Append", "code": "class Append (α : Type u) where\n \n append : α → α → α", "start": [ 1382, 1 ], "end": [ 1385, 21 ], "kind": "commanddeclaration" }, { "full_name": "OrElse", "code": "class OrElse (α : Type u) where\n \n orElse : α → (Unit → α) → α", "start": [ 1387, 1 ], "end": [ 1394, 31 ], "kind": "commanddeclaration" }, { "full_name": "AndThen", "code": "class AndThen (α : Type u) where\n \n andThen : α → (Unit → α) → α", "start": [ 1396, 1 ], "end": [ 1403, 31 ], "kind": "commanddeclaration" }, { "full_name": "AndOp", "code": "class AndOp (α : Type u) where\n \n and : α → α → α", "start": [ 1405, 1 ], "end": [ 1411, 18 ], "kind": "commanddeclaration" }, { "full_name": "Xor", "code": "class Xor (α : Type u) where\n \n xor : α → α → α", "start": [ 1413, 1 ], "end": [ 1416, 18 ], "kind": "commanddeclaration" }, { "full_name": "OrOp", "code": "class OrOp (α : Type u) where\n \n or : α → α → α", "start": [ 1418, 1 ], "end": [ 1424, 17 ], "kind": "commanddeclaration" }, { "full_name": "Complement", "code": "class Complement (α : Type u) where\n \n complement : α → α", "start": [ 1426, 1 ], "end": [ 1429, 21 ], "kind": "commanddeclaration" }, { "full_name": "ShiftLeft", "code": "class ShiftLeft (α : Type u) where\n \n shiftLeft : α → α → α", "start": [ 1431, 1 ], "end": [ 1434, 24 ], "kind": "commanddeclaration" }, { "full_name": "ShiftRight", "code": "class ShiftRight (α : Type u) where\n \n shiftRight : α → α → α", "start": [ 1436, 1 ], "end": [ 1439, 25 ], "kind": "commanddeclaration" }, { "full_name": "instHAdd", "code": "@[default_instance]\ninstance instHAdd [Add α] : HAdd α α α where\n hAdd a b := Add.add a b", "start": [ 1441, 1 ], "end": [ 1443, 26 ], "kind": "commanddeclaration" }, { "full_name": "instHSub", "code": "@[default_instance]\ninstance instHSub [Sub α] : HSub α α α where\n hSub a b := Sub.sub a b", "start": [ 1445, 1 ], "end": [ 1447, 26 ], "kind": "commanddeclaration" }, { "full_name": "instHMul", "code": "@[default_instance]\ninstance instHMul [Mul α] : HMul α α α where\n hMul a b := Mul.mul a b", "start": [ 1449, 1 ], "end": [ 1451, 26 ], "kind": "commanddeclaration" }, { "full_name": "instHDiv", "code": "@[default_instance]\ninstance instHDiv [Div α] : HDiv α α α where\n hDiv a b := Div.div a b", "start": [ 1453, 1 ], "end": [ 1455, 26 ], "kind": "commanddeclaration" }, { "full_name": "instHMod", "code": "@[default_instance]\ninstance instHMod [Mod α] : HMod α α α where\n hMod a b := Mod.mod a b", "start": [ 1457, 1 ], "end": [ 1459, 26 ], "kind": "commanddeclaration" }, { "full_name": "instHPow", "code": "@[default_instance]\ninstance instHPow [Pow α β] : HPow α β α where\n hPow a b := Pow.pow a b", "start": [ 1461, 1 ], "end": [ 1463, 26 ], "kind": "commanddeclaration" }, { "full_name": "instPowNat", "code": "@[default_instance]\ninstance instPowNat [NatPow α] : Pow α Nat where\n pow a n := NatPow.pow a n", "start": [ 1465, 1 ], "end": [ 1467, 28 ], "kind": "commanddeclaration" }, { "full_name": "Membership", "code": "class Membership (α : outParam (Type u)) (γ : Type v) where\n \n mem : α → γ → Prop", "start": [ 1511, 1 ], "end": [ 1518, 21 ], "kind": "commanddeclaration" }, { "full_name": "Nat.add", "code": "@[extern \"lean_nat_add\"]\nprotected def Nat.add : (@& Nat) → (@& Nat) → Nat\n | a, Nat.zero => a\n | a, Nat.succ b => Nat.succ (Nat.add a b)", "start": [ 1521, 1 ], "end": [ 1531, 44 ], "kind": "commanddeclaration" }, { "full_name": "instAddNat", "code": "instance instAddNat : Add Nat where\n add := Nat.add", "start": [ 1533, 1 ], "end": [ 1534, 17 ], "kind": "commanddeclaration" }, { "full_name": "Nat.mul", "code": "@[extern \"lean_nat_mul\"]\nprotected def Nat.mul : (@& Nat) → (@& Nat) → Nat\n | _, 0 => 0\n | a, Nat.succ b => Nat.add (Nat.mul a b) a", "start": [ 1541, 1 ], "end": [ 1551, 45 ], "kind": "commanddeclaration" }, { "full_name": "instMulNat", "code": "instance instMulNat : Mul Nat where\n mul := Nat.mul", "start": [ 1553, 1 ], "end": [ 1554, 17 ], "kind": "commanddeclaration" }, { "full_name": "Nat.pow", "code": "@[extern \"lean_nat_pow\"]\nprotected def Nat.pow (m : @& Nat) : (@& Nat) → Nat\n | 0 => 1\n | succ n => Nat.mul (Nat.pow m n) m", "start": [ 1557, 1 ], "end": [ 1567, 38 ], "kind": "commanddeclaration" }, { "full_name": "instNatPowNat", "code": "instance instNatPowNat : NatPow Nat := ⟨Nat.pow⟩", "start": [ 1569, 1 ], "end": [ 1569, 49 ], "kind": "commanddeclaration" }, { "full_name": "Nat.beq", "code": "@[extern \"lean_nat_dec_eq\"]\ndef Nat.beq : (@& Nat) → (@& Nat) → Bool\n | zero, zero => true\n | zero, succ _ => false\n | succ _, zero => false\n | succ n, succ m => beq n m", "start": [ 1572, 1 ], "end": [ 1584, 30 ], "kind": "commanddeclaration" }, { "full_name": "Nat.eq_of_beq_eq_true", "code": "theorem Nat.eq_of_beq_eq_true : {n m : Nat} → Eq (beq n m) true → Eq n m", "start": [ 1589, 1 ], "end": [ 1596, 15 ], "kind": "commanddeclaration" }, { "full_name": "Nat.ne_of_beq_eq_false", "code": "theorem Nat.ne_of_beq_eq_false : {n m : Nat} → Eq (beq n m) false → Not (Eq n m)", "start": [ 1598, 1 ], "end": [ 1604, 71 ], "kind": "commanddeclaration" }, { "full_name": "Nat.decEq", "code": "@[reducible, extern \"lean_nat_dec_eq\"]\nprotected def Nat.decEq (n m : @& Nat) : Decidable (Eq n m) :=\n match h:beq n m with\n | true => isTrue (eq_of_beq_eq_true h)\n | false => isFalse (ne_of_beq_eq_false h)", "start": [ 1606, 1 ], "end": [ 1617, 44 ], "kind": "commanddeclaration" }, { "full_name": "Nat.ble", "code": "@[extern \"lean_nat_dec_le\"]\ndef Nat.ble : @& Nat → @& Nat → Bool\n | zero, zero => true\n | zero, succ _ => true\n | succ _, zero => false\n | succ n, succ m => ble n m", "start": [ 1622, 1 ], "end": [ 1634, 30 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le", "code": "protected inductive Nat.le (n : Nat) : Nat → Prop\n \n | refl : Nat.le n n\n \n | step {m} : Nat.le n m → Nat.le n (succ m)", "start": [ 1636, 1 ], "end": [ 1644, 46 ], "kind": "commanddeclaration" }, { "full_name": "instLENat", "code": "instance instLENat : LE Nat where\n le := Nat.le", "start": [ 1646, 1 ], "end": [ 1647, 15 ], "kind": "commanddeclaration" }, { "full_name": "Nat.lt", "code": "protected def Nat.lt (n m : Nat) : Prop :=\n Nat.le (succ n) m", "start": [ 1649, 1 ], "end": [ 1651, 20 ], "kind": "commanddeclaration" }, { "full_name": "instLTNat", "code": "instance instLTNat : LT Nat where\n lt := Nat.lt", "start": [ 1653, 1 ], "end": [ 1654, 15 ], "kind": "commanddeclaration" }, { "full_name": "Nat.not_succ_le_zero", "code": "theorem Nat.not_succ_le_zero : ∀ (n : Nat), LE.le (succ n) 0 → False", "start": [ 1656, 1 ], "end": [ 1658, 20 ], "kind": "commanddeclaration" }, { "full_name": "Nat.not_lt_zero", "code": "theorem Nat.not_lt_zero (n : Nat) : Not (LT.lt n 0)", "start": [ 1660, 1 ], "end": [ 1661, 21 ], "kind": "commanddeclaration" }, { "full_name": "Nat.zero_le", "code": "theorem Nat.zero_le : (n : Nat) → LE.le 0 n", "start": [ 1663, 1 ], "end": [ 1665, 38 ], "kind": "commanddeclaration" }, { "full_name": "Nat.succ_le_succ", "code": "theorem Nat.succ_le_succ : LE.le n m → LE.le (succ n) (succ m)", "start": [ 1667, 1 ], "end": [ 1669, 50 ], "kind": "commanddeclaration" }, { "full_name": "Nat.zero_lt_succ", "code": "theorem Nat.zero_lt_succ (n : Nat) : LT.lt 0 (succ n)", "start": [ 1671, 1 ], "end": [ 1672, 27 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_step", "code": "theorem Nat.le_step (h : LE.le n m) : LE.le n (succ m)", "start": [ 1674, 1 ], "end": [ 1675, 16 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_trans", "code": "protected theorem Nat.le_trans {n m k : Nat} : LE.le n m → LE.le m k → LE.le n k", "start": [ 1677, 1 ], "end": [ 1679, 59 ], "kind": "commanddeclaration" }, { "full_name": "Nat.lt_trans", "code": "protected theorem Nat.lt_trans {n m k : Nat} (h₁ : LT.lt n m) : LT.lt m k → LT.lt n k", "start": [ 1681, 1 ], "end": [ 1682, 28 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_succ", "code": "theorem Nat.le_succ (n : Nat) : LE.le n (succ n)", "start": [ 1684, 1 ], "end": [ 1685, 26 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_succ_of_le", "code": "theorem Nat.le_succ_of_le {n m : Nat} (h : LE.le n m) : LE.le n (succ m)", "start": [ 1687, 1 ], "end": [ 1688, 29 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_refl", "code": "protected theorem Nat.le_refl (n : Nat) : LE.le n n", "start": [ 1690, 1 ], "end": [ 1691, 14 ], "kind": "commanddeclaration" }, { "full_name": "Nat.succ_pos", "code": "theorem Nat.succ_pos (n : Nat) : LT.lt 0 (succ n)", "start": [ 1693, 1 ], "end": [ 1694, 17 ], "kind": "commanddeclaration" }, { "full_name": "Nat.pred", "code": "@[extern \"lean_nat_pred\"]\ndef Nat.pred : (@& Nat) → Nat\n | 0 => 0\n | succ a => a", "start": [ 1697, 1 ], "end": [ 1706, 16 ], "kind": "commanddeclaration" }, { "full_name": "Nat.pred_le_pred", "code": "theorem Nat.pred_le_pred : {n m : Nat} → LE.le n m → LE.le (pred n) (pred m)", "start": [ 1708, 1 ], "end": [ 1711, 64 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_of_succ_le_succ", "code": "theorem Nat.le_of_succ_le_succ {n m : Nat} : LE.le (succ n) (succ m) → LE.le n m", "start": [ 1713, 1 ], "end": [ 1714, 15 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_of_lt_succ", "code": "theorem Nat.le_of_lt_succ {m n : Nat} : LT.lt m (succ n) → LE.le m n", "start": [ 1716, 1 ], "end": [ 1717, 21 ], "kind": "commanddeclaration" }, { "full_name": "Nat.eq_or_lt_of_le", "code": "protected theorem Nat.eq_or_lt_of_le : {n m: Nat} → LE.le n m → Or (Eq n m) (LT.lt n m)", "start": [ 1719, 1 ], "end": [ 1727, 42 ], "kind": "commanddeclaration" }, { "full_name": "Nat.lt_or_ge", "code": "protected theorem Nat.lt_or_ge (n m : Nat) : Or (LT.lt n m) (GE.ge n m)", "start": [ 1729, 1 ], "end": [ 1738, 31 ], "kind": "commanddeclaration" }, { "full_name": "Nat.not_succ_le_self", "code": "theorem Nat.not_succ_le_self : (n : Nat) → Not (LE.le (succ n) n)", "start": [ 1740, 1 ], "end": [ 1742, 74 ], "kind": "commanddeclaration" }, { "full_name": "Nat.lt_irrefl", "code": "protected theorem Nat.lt_irrefl (n : Nat) : Not (LT.lt n n)", "start": [ 1744, 1 ], "end": [ 1745, 25 ], "kind": "commanddeclaration" }, { "full_name": "Nat.lt_of_le_of_lt", "code": "protected theorem Nat.lt_of_le_of_lt {n m k : Nat} (h₁ : LE.le n m) (h₂ : LT.lt m k) : LT.lt n k", "start": [ 1747, 1 ], "end": [ 1748, 40 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_antisymm", "code": "protected theorem Nat.le_antisymm {n m : Nat} (h₁ : LE.le n m) (h₂ : LE.le m n) : Eq n m", "start": [ 1750, 1 ], "end": [ 1753, 72 ], "kind": "commanddeclaration" }, { "full_name": "Nat.lt_of_le_of_ne", "code": "protected theorem Nat.lt_of_le_of_ne {n m : Nat} (h₁ : LE.le n m) (h₂ : Not (Eq n m)) : LT.lt n m", "start": [ 1755, 1 ], "end": [ 1758, 51 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_of_ble_eq_true", "code": "theorem Nat.le_of_ble_eq_true (h : Eq (Nat.ble n m) true) : LE.le n m", "start": [ 1760, 1 ], "end": [ 1763, 61 ], "kind": "commanddeclaration" }, { "full_name": "Nat.ble_self_eq_true", "code": "theorem Nat.ble_self_eq_true : (n : Nat) → Eq (Nat.ble n n) true", "start": [ 1765, 1 ], "end": [ 1767, 33 ], "kind": "commanddeclaration" }, { "full_name": "Nat.ble_succ_eq_true", "code": "theorem Nat.ble_succ_eq_true : {n m : Nat} → Eq (Nat.ble n m) true → Eq (Nat.ble n (succ m)) true", "start": [ 1769, 1 ], "end": [ 1771, 53 ], "kind": "commanddeclaration" }, { "full_name": "Nat.ble_eq_true_of_le", "code": "theorem Nat.ble_eq_true_of_le (h : LE.le n m) : Eq (Nat.ble n m) true", "start": [ 1773, 1 ], "end": [ 1776, 64 ], "kind": "commanddeclaration" }, { "full_name": "Nat.not_le_of_not_ble_eq_true", "code": "theorem Nat.not_le_of_not_ble_eq_true (h : Not (Eq (Nat.ble n m) true)) : Not (LE.le n m)", "start": [ 1778, 1 ], "end": [ 1779, 48 ], "kind": "commanddeclaration" }, { "full_name": "Nat.decLe", "code": "@[extern \"lean_nat_dec_le\"]\ninstance Nat.decLe (n m : @& Nat) : Decidable (LE.le n m) :=\n dite (Eq (Nat.ble n m) true) (fun h => isTrue (Nat.le_of_ble_eq_true h)) (fun h => isFalse (Nat.not_le_of_not_ble_eq_true h))", "start": [ 1781, 1 ], "end": [ 1783, 128 ], "kind": "commanddeclaration" }, { "full_name": "Nat.decLt", "code": "@[extern \"lean_nat_dec_lt\"]\ninstance Nat.decLt (n m : @& Nat) : Decidable (LT.lt n m) :=\n decLe (succ n) m", "start": [ 1785, 1 ], "end": [ 1787, 19 ], "kind": "commanddeclaration" }, { "full_name": "Nat.sub", "code": "@[extern \"lean_nat_sub\"]\nprotected def Nat.sub : (@& Nat) → (@& Nat) → Nat\n | a, 0 => a\n | a, succ b => pred (Nat.sub a b)", "start": [ 1792, 1 ], "end": [ 1803, 36 ], "kind": "commanddeclaration" }, { "full_name": "instSubNat", "code": "instance instSubNat : Sub Nat where\n sub := Nat.sub", "start": [ 1805, 1 ], "end": [ 1806, 17 ], "kind": "commanddeclaration" }, { "full_name": "System.Platform.getNumBits", "code": "@[extern \"lean_system_platform_nbits\"] opaque System.Platform.getNumBits : Unit → Subtype fun (n : Nat) => Or (Eq n 32) (Eq n 64) :=\n fun _ => ⟨64, Or.inr rfl⟩", "start": [ 1808, 1 ], "end": [ 1817, 28 ], "kind": "commanddeclaration" }, { "full_name": "System.Platform.numBits", "code": "def System.Platform.numBits : Nat :=\n (getNumBits ()).val", "start": [ 1819, 1 ], "end": [ 1821, 22 ], "kind": "commanddeclaration" }, { "full_name": "System.Platform.numBits_eq", "code": "theorem System.Platform.numBits_eq : Or (Eq numBits 32) (Eq numBits 64)", "start": [ 1823, 1 ], "end": [ 1824, 27 ], "kind": "commanddeclaration" }, { "full_name": "Fin", "code": "@[pp_using_anonymous_constructor]\nstructure Fin (n : Nat) where\n \n mk ::\n \n val : Nat\n \n isLt : LT.lt val n", "start": [ 1826, 1 ], "end": [ 1838, 21 ], "kind": "commanddeclaration" }, { "full_name": "Fin.eq_of_val_eq", "code": "theorem Fin.eq_of_val_eq {n} : ∀ {i j : Fin n}, Eq i.val j.val → Eq i j", "start": [ 1842, 1 ], "end": [ 1843, 31 ], "kind": "commanddeclaration" }, { "full_name": "Fin.val_eq_of_eq", "code": "theorem Fin.val_eq_of_eq {n} {i j : Fin n} (h : Eq i j) : Eq i.val j.val", "start": [ 1845, 1 ], "end": [ 1846, 10 ], "kind": "commanddeclaration" }, { "full_name": "Fin.ne_of_val_ne", "code": "theorem Fin.ne_of_val_ne {n} {i j : Fin n} (h : Not (Eq i.val j.val)) : Not (Eq i j)", "start": [ 1848, 1 ], "end": [ 1849, 39 ], "kind": "commanddeclaration" }, { "full_name": "Fin.decLt", "code": "instance Fin.decLt {n} (a b : Fin n) : Decidable (LT.lt a b) := Nat.decLt ..", "start": [ 1863, 1 ], "end": [ 1863, 77 ], "kind": "commanddeclaration" }, { "full_name": "Fin.decLe", "code": "instance Fin.decLe {n} (a b : Fin n) : Decidable (LE.le a b) := Nat.decLe ..", "start": [ 1864, 1 ], "end": [ 1864, 77 ], "kind": "commanddeclaration" }, { "full_name": "UInt8.size", "code": "abbrev UInt8.size : Nat := 256", "start": [ 1866, 1 ], "end": [ 1867, 31 ], "kind": "commanddeclaration" }, { "full_name": "UInt8", "code": "structure UInt8 where\n \n val : Fin UInt8.size", "start": [ 1869, 1 ], "end": [ 1876, 23 ], "kind": "commanddeclaration" }, { "full_name": "UInt8.ofNatCore", "code": "@[extern \"lean_uint8_of_nat\"]\ndef UInt8.ofNatCore (n : @& Nat) (h : LT.lt n UInt8.size) : UInt8 where\n val := { val := n, isLt := h }", "start": [ 1881, 1 ], "end": [ 1887, 33 ], "kind": "commanddeclaration" }, { "full_name": "UInt8.decEq", "code": "@[extern \"lean_uint8_dec_eq\"]\ndef UInt8.decEq (a b : UInt8) : Decidable (Eq a b) :=\n match a, b with\n | ⟨n⟩, ⟨m⟩ =>\n dite (Eq n m) (fun h => isTrue (h ▸ rfl)) (fun h => isFalse (fun h' => UInt8.noConfusion h' (fun h' => absurd h' h)))", "start": [ 1890, 1 ], "end": [ 1898, 122 ], "kind": "commanddeclaration" }, { "full_name": "UInt16.size", "code": "abbrev UInt16.size : Nat := 65536", "start": [ 1905, 1 ], "end": [ 1906, 34 ], "kind": "commanddeclaration" }, { "full_name": "UInt16", "code": "structure UInt16 where\n \n val : Fin UInt16.size", "start": [ 1908, 1 ], "end": [ 1915, 24 ], "kind": "commanddeclaration" }, { "full_name": "UInt16.ofNatCore", "code": "@[extern \"lean_uint16_of_nat\"]\ndef UInt16.ofNatCore (n : @& Nat) (h : LT.lt n UInt16.size) : UInt16 where\n val := { val := n, isLt := h }", "start": [ 1920, 1 ], "end": [ 1926, 33 ], "kind": "commanddeclaration" }, { "full_name": "UInt16.decEq", "code": "@[extern \"lean_uint16_dec_eq\"]\ndef UInt16.decEq (a b : UInt16) : Decidable (Eq a b) :=\n match a, b with\n | ⟨n⟩, ⟨m⟩ =>\n dite (Eq n m) (fun h => isTrue (h ▸ rfl)) (fun h => isFalse (fun h' => UInt16.noConfusion h' (fun h' => absurd h' h)))", "start": [ 1929, 1 ], "end": [ 1937, 123 ], "kind": "commanddeclaration" }, { "full_name": "UInt32.size", "code": "abbrev UInt32.size : Nat := 4294967296", "start": [ 1944, 1 ], "end": [ 1945, 39 ], "kind": "commanddeclaration" }, { "full_name": "UInt32", "code": "structure UInt32 where\n \n val : Fin UInt32.size", "start": [ 1947, 1 ], "end": [ 1954, 24 ], "kind": "commanddeclaration" }, { "full_name": "UInt32.ofNatCore", "code": "@[extern \"lean_uint32_of_nat\"]\ndef UInt32.ofNatCore (n : @& Nat) (h : LT.lt n UInt32.size) : UInt32 where\n val := { val := n, isLt := h }", "start": [ 1959, 1 ], "end": [ 1965, 33 ], "kind": "commanddeclaration" }, { "full_name": "UInt32.toNat", "code": "@[extern \"lean_uint32_to_nat\"]\ndef UInt32.toNat (n : UInt32) : Nat := n.val.val", "start": [ 1967, 1 ], "end": [ 1972, 49 ], "kind": "commanddeclaration" }, { "full_name": "UInt32.decEq", "code": "@[extern \"lean_uint32_dec_eq\"]\ndef UInt32.decEq (a b : UInt32) : Decidable (Eq a b) :=\n match a, b with\n | ⟨n⟩, ⟨m⟩ =>\n dite (Eq n m) (fun h => isTrue (h ▸ rfl)) (fun h => isFalse (fun h' => UInt32.noConfusion h' (fun h' => absurd h' h)))", "start": [ 1975, 1 ], "end": [ 1983, 123 ], "kind": "commanddeclaration" }, { "full_name": "UInt32.decLt", "code": "@[extern \"lean_uint32_dec_lt\"]\ndef UInt32.decLt (a b : UInt32) : Decidable (LT.lt a b) :=\n match a, b with\n | ⟨n⟩, ⟨m⟩ => inferInstanceAs (Decidable (LT.lt n m))", "start": [ 1997, 1 ], "end": [ 2004, 56 ], "kind": "commanddeclaration" }, { "full_name": "UInt32.decLe", "code": "@[extern \"lean_uint32_dec_le\"]\ndef UInt32.decLe (a b : UInt32) : Decidable (LE.le a b) :=\n match a, b with\n | ⟨n⟩, ⟨m⟩ => inferInstanceAs (Decidable (LE.le n m))", "start": [ 2007, 1 ], "end": [ 2014, 56 ], "kind": "commanddeclaration" }, { "full_name": "UInt64.size", "code": "abbrev UInt64.size : Nat := 18446744073709551616", "start": [ 2021, 1 ], "end": [ 2022, 49 ], "kind": "commanddeclaration" }, { "full_name": "UInt64", "code": "structure UInt64 where\n \n val : Fin UInt64.size", "start": [ 2023, 1 ], "end": [ 2030, 24 ], "kind": "commanddeclaration" }, { "full_name": "UInt64.ofNatCore", "code": "@[extern \"lean_uint64_of_nat\"]\ndef UInt64.ofNatCore (n : @& Nat) (h : LT.lt n UInt64.size) : UInt64 where\n val := { val := n, isLt := h }", "start": [ 2035, 1 ], "end": [ 2041, 33 ], "kind": "commanddeclaration" }, { "full_name": "UInt64.decEq", "code": "@[extern \"lean_uint64_dec_eq\"]\ndef UInt64.decEq (a b : UInt64) : Decidable (Eq a b) :=\n match a, b with\n | ⟨n⟩, ⟨m⟩ =>\n dite (Eq n m) (fun h => isTrue (h ▸ rfl)) (fun h => isFalse (fun h' => UInt64.noConfusion h' (fun h' => absurd h' h)))", "start": [ 2044, 1 ], "end": [ 2052, 123 ], "kind": "commanddeclaration" }, { "full_name": "USize.size", "code": "abbrev USize.size : Nat := hAdd (hSub (hPow 2 System.Platform.numBits) 1) 1", "start": [ 2059, 1 ], "end": [ 2078, 76 ], "kind": "commanddeclaration" }, { "full_name": "usize_size_eq", "code": "theorem usize_size_eq : Or (Eq USize.size 4294967296) (Eq USize.size 18446744073709551616)", "start": [ 2080, 1 ], "end": [ 2084, 40 ], "kind": "commanddeclaration" }, { "full_name": "USize", "code": "structure USize where\n \n val : Fin USize.size", "start": [ 2086, 1 ], "end": [ 2096, 23 ], "kind": "commanddeclaration" }, { "full_name": "USize.ofNatCore", "code": "@[extern \"lean_usize_of_nat\"]\ndef USize.ofNatCore (n : @& Nat) (h : LT.lt n USize.size) : USize := {\n val := { val := n, isLt := h }\n}", "start": [ 2101, 1 ], "end": [ 2108, 2 ], "kind": "commanddeclaration" }, { "full_name": "USize.decEq", "code": "@[extern \"lean_usize_dec_eq\"]\ndef USize.decEq (a b : USize) : Decidable (Eq a b) :=\n match a, b with\n | ⟨n⟩, ⟨m⟩ =>\n dite (Eq n m) (fun h =>isTrue (h ▸ rfl)) (fun h => isFalse (fun h' => USize.noConfusion h' (fun h' => absurd h' h)))", "start": [ 2111, 1 ], "end": [ 2119, 121 ], "kind": "commanddeclaration" }, { "full_name": "USize.ofNat32", "code": "@[extern \"lean_usize_of_nat\"]\ndef USize.ofNat32 (n : @& Nat) (h : LT.lt n 4294967296) : USize where\n val := {\n val := n\n isLt := match USize.size, usize_size_eq with\n | _, Or.inl rfl => h\n | _, Or.inr rfl => Nat.lt_trans h (by decide)\n }", "start": [ 2128, 1 ], "end": [ 2140, 4 ], "kind": "commanddeclaration" }, { "full_name": "Nat.isValidChar", "code": "abbrev Nat.isValidChar (n : Nat) : Prop :=\n Or (LT.lt n 0xd800) (And (LT.lt 0xdfff n) (LT.lt n 0x110000))", "start": [ 2142, 1 ], "end": [ 2147, 64 ], "kind": "commanddeclaration" }, { "full_name": "UInt32.isValidChar", "code": "abbrev UInt32.isValidChar (n : UInt32) : Prop :=\n n.toNat.isValidChar", "start": [ 2149, 1 ], "end": [ 2154, 22 ], "kind": "commanddeclaration" }, { "full_name": "Char", "code": "structure Char where\n \n val : UInt32\n \n valid : val.isValidChar", "start": [ 2156, 1 ], "end": [ 2162, 26 ], "kind": "commanddeclaration" }, { "full_name": "isValidChar_UInt32", "code": "private theorem isValidChar_UInt32 {n : Nat} (h : n.isValidChar) : LT.lt n UInt32.size", "start": [ 2164, 1 ], "end": [ 2167, 48 ], "kind": "commanddeclaration" }, { "full_name": "Char.ofNatAux", "code": "@[extern \"lean_uint32_of_nat\"]\ndef Char.ofNatAux (n : @& Nat) (h : n.isValidChar) : Char :=\n { val := ⟨{ val := n, isLt := isValidChar_UInt32 h }⟩, valid := h }", "start": [ 2169, 1 ], "end": [ 2175, 70 ], "kind": "commanddeclaration" }, { "full_name": "Char.ofNat", "code": "@[noinline, match_pattern]\ndef Char.ofNat (n : Nat) : Char :=\n dite (n.isValidChar)\n (fun h => Char.ofNatAux n h)\n (fun _ => { val := ⟨{ val := 0, isLt := by decide }⟩, valid := Or.inl (by decide) })", "start": [ 2177, 1 ], "end": [ 2185, 89 ], "kind": "commanddeclaration" }, { "full_name": "Char.eq_of_val_eq", "code": "theorem Char.eq_of_val_eq : ∀ {c d : Char}, Eq c.val d.val → Eq c d", "start": [ 2187, 1 ], "end": [ 2188, 31 ], "kind": "commanddeclaration" }, { "full_name": "Char.val_eq_of_eq", "code": "theorem Char.val_eq_of_eq : ∀ {c d : Char}, Eq c d → Eq c.val d.val", "start": [ 2190, 1 ], "end": [ 2191, 21 ], "kind": "commanddeclaration" }, { "full_name": "Char.ne_of_val_ne", "code": "theorem Char.ne_of_val_ne {c d : Char} (h : Not (Eq c.val d.val)) : Not (Eq c d)", "start": [ 2193, 1 ], "end": [ 2194, 39 ], "kind": "commanddeclaration" }, { "full_name": "Char.val_ne_of_ne", "code": "theorem Char.val_ne_of_ne {c d : Char} (h : Not (Eq c d)) : Not (Eq c.val d.val)", "start": [ 2196, 1 ], "end": [ 2197, 39 ], "kind": "commanddeclaration" }, { "full_name": "Char.utf8Size", "code": "def Char.utf8Size (c : Char) : Nat :=\n let v := c.val\n ite (LE.le v (UInt32.ofNatCore 0x7F (by decide))) 1\n (ite (LE.le v (UInt32.ofNatCore 0x7FF (by decide))) 2\n (ite (LE.le v (UInt32.ofNatCore 0xFFFF (by decide))) 3 4))", "start": [ 2205, 1 ], "end": [ 2210, 65 ], "kind": "commanddeclaration" }, { "full_name": "Option", "code": "inductive Option (α : Type u) where\n \n | none : Option α\n \n | some (val : α) : Option α", "start": [ 2212, 1 ], "end": [ 2244, 30 ], "kind": "commanddeclaration" }, { "full_name": "Option.getD", "code": "@[macro_inline] def Option.getD (opt : Option α) (dflt : α) : α :=\n match opt with\n | some x => x\n | none => dflt", "start": [ 2253, 1 ], "end": [ 2263, 17 ], "kind": "commanddeclaration" }, { "full_name": "Option.map", "code": "@[inline] protected def Option.map (f : α → β) : Option α → Option β\n | some x => some (f x)\n | none => none", "start": [ 2265, 1 ], "end": [ 2271, 19 ], "kind": "commanddeclaration" }, { "full_name": "List", "code": "inductive List (α : Type u) where\n \n | nil : List α\n \n | cons (head : α) (tail : List α) : List α", "start": [ 2273, 1 ], "end": [ 2289, 45 ], "kind": "commanddeclaration" }, { "full_name": "List.hasDecEq", "code": "protected def List.hasDecEq {α : Type u} [DecidableEq α] : (a b : List α) → Decidable (Eq a b)\n | nil, nil => isTrue rfl\n | cons _ _, nil => isFalse (fun h => List.noConfusion h)\n | nil, cons _ _ => isFalse (fun h => List.noConfusion h)\n | cons a as, cons b bs =>\n match decEq a b with\n | isTrue hab =>\n match List.hasDecEq as bs with\n | isTrue habs => isTrue (hab ▸ habs ▸ rfl)\n | isFalse nabs => isFalse (fun h => List.noConfusion h (fun _ habs => absurd habs nabs))\n | isFalse nab => isFalse (fun h => List.noConfusion h (fun hab _ => absurd hab nab))", "start": [ 2294, 1 ], "end": [ 2305, 89 ], "kind": "commanddeclaration" }, { "full_name": "List.length", "code": "def List.length : List α → Nat\n | nil => 0\n | cons _ as => HAdd.hAdd (length as) 1", "start": [ 2309, 1 ], "end": [ 2318, 41 ], "kind": "commanddeclaration" }, { "full_name": "List.lengthTRAux", "code": "def List.lengthTRAux : List α → Nat → Nat\n | nil, n => n\n | cons _ as, n => lengthTRAux as (Nat.succ n)", "start": [ 2320, 1 ], "end": [ 2323, 48 ], "kind": "commanddeclaration" }, { "full_name": "List.lengthTR", "code": "def List.lengthTR (as : List α) : Nat :=\n lengthTRAux as 0", "start": [ 2325, 1 ], "end": [ 2330, 19 ], "kind": "commanddeclaration" }, { "full_name": "List.get", "code": "def List.get {α : Type u} : (as : List α) → Fin as.length → α\n | cons a _, ⟨0, _⟩ => a\n | cons _ as, ⟨Nat.succ i, h⟩ => get as ⟨i, Nat.le_of_succ_le_succ h⟩", "start": [ 2332, 1 ], "end": [ 2339, 71 ], "kind": "commanddeclaration" }, { "full_name": "List.set", "code": "def List.set : List α → Nat → α → List α\n | cons _ as, 0, b => cons b as\n | cons a as, Nat.succ n, b => cons a (set as n b)\n | nil, _, _ => nil", "start": [ 2341, 1 ], "end": [ 2348, 36 ], "kind": "commanddeclaration" }, { "full_name": "List.foldl", "code": "@[specialize]\ndef List.foldl {α : Type u} {β : Type v} (f : α → β → α) : (init : α) → List β → α\n | a, nil => a\n | a, cons b l => foldl f (f a b) l", "start": [ 2350, 1 ], "end": [ 2357, 37 ], "kind": "commanddeclaration" }, { "full_name": "List.concat", "code": "def List.concat {α : Type u} : List α → α → List α\n | nil, b => cons b nil\n | cons a as, b => cons a (concat as b)", "start": [ 2359, 1 ], "end": [ 2362, 41 ], "kind": "commanddeclaration" }, { "full_name": "String", "code": "structure String where\n \n mk ::\n \n data : List Char", "start": [ 2364, 1 ], "end": [ 2376, 19 ], "kind": "commanddeclaration" }, { "full_name": "String.decEq", "code": "@[extern \"lean_string_dec_eq\"]\ndef String.decEq (s₁ s₂ : @& String) : Decidable (Eq s₁ s₂) :=\n match s₁, s₂ with\n | ⟨s₁⟩, ⟨s₂⟩ =>\n dite (Eq s₁ s₂) (fun h => isTrue (congrArg _ h)) (fun h => isFalse (fun h' => String.noConfusion h' (fun h' => absurd h' h)))", "start": [ 2381, 1 ], "end": [ 2389, 130 ], "kind": "commanddeclaration" }, { "full_name": "String.Pos", "code": "structure String.Pos where\n \n byteIdx : Nat := 0", "start": [ 2393, 1 ], "end": [ 2405, 21 ], "kind": "commanddeclaration" }, { "full_name": "Substring", "code": "structure Substring where\n \n str : String\n \n startPos : String.Pos\n \n stopPos : String.Pos", "start": [ 2415, 1 ], "end": [ 2427, 24 ], "kind": "commanddeclaration" }, { "full_name": "Substring.bsize", "code": "@[inline] def Substring.bsize : Substring → Nat\n | ⟨_, b, e⟩ => e.byteIdx.sub b.byteIdx", "start": [ 2432, 1 ], "end": [ 2434, 41 ], "kind": "commanddeclaration" }, { "full_name": "String.utf8ByteSize", "code": "@[extern \"lean_string_utf8_byte_size\"]\ndef String.utf8ByteSize : (@& String) → Nat\n | ⟨s⟩ => go s\nwhere\n go : List Char → Nat\n | .nil => 0\n | .cons c cs => hAdd (go cs) c.utf8Size", "start": [ 2436, 1 ], "end": [ 2446, 43 ], "kind": "commanddeclaration" }, { "full_name": "String.endPos", "code": "@[inline] def String.endPos (s : String) : String.Pos where\n byteIdx := utf8ByteSize s", "start": [ 2472, 1 ], "end": [ 2474, 28 ], "kind": "commanddeclaration" }, { "full_name": "String.toSubstring", "code": "@[inline] def String.toSubstring (s : String) : Substring where\n str := s\n startPos := {}\n stopPos := s.endPos", "start": [ 2476, 1 ], "end": [ 2480, 23 ], "kind": "commanddeclaration" }, { "full_name": "String.toSubstring'", "code": "def String.toSubstring' (s : String) : Substring :=\n s.toSubstring", "start": [ 2482, 1 ], "end": [ 2484, 16 ], "kind": "commanddeclaration" }, { "full_name": "unsafeCast", "code": "unsafe def unsafeCast {α : Sort u} {β : Sort v} (a : α) : β :=\n PLift.down (ULift.down.{max u v} (cast lcProof (ULift.up.{max u v} (PLift.up a))))", "start": [ 2486, 1 ], "end": [ 2511, 85 ], "kind": "commanddeclaration" }, { "full_name": "panicCore", "code": "@[never_extract, extern \"lean_panic_fn\"]\ndef panicCore {α : Type u} [Inhabited α] (msg : String) : α := default", "start": [ 2514, 1 ], "end": [ 2526, 71 ], "kind": "commanddeclaration" }, { "full_name": "panic", "code": "@[noinline, never_extract]\ndef panic {α : Type u} [Inhabited α] (msg : String) : α :=\n panicCore msg", "start": [ 2528, 1 ], "end": [ 2541, 16 ], "kind": "commanddeclaration" }, { "full_name": "Array", "code": "structure Array (α : Type u) where\n \n mk ::\n \n data : List α", "start": [ 2546, 1 ], "end": [ 2571, 16 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkEmpty", "code": "@[extern \"lean_mk_empty_array_with_capacity\"]\ndef Array.mkEmpty {α : Type u} (c : @& Nat) : Array α where\n data := List.nil", "start": [ 2576, 1 ], "end": [ 2579, 19 ], "kind": "commanddeclaration" }, { "full_name": "Array.empty", "code": "def Array.empty {α : Type u} : Array α := mkEmpty 0", "start": [ 2581, 1 ], "end": [ 2582, 52 ], "kind": "commanddeclaration" }, { "full_name": "Array.size", "code": "@[reducible, extern \"lean_array_get_size\"]\ndef Array.size {α : Type u} (a : @& Array α) : Nat :=\n a.data.length", "start": [ 2584, 1 ], "end": [ 2587, 15 ], "kind": "commanddeclaration" }, { "full_name": "Array.get", "code": "@[extern \"lean_array_fget\"]\ndef Array.get {α : Type u} (a : @& Array α) (i : @& Fin a.size) : α :=\n a.data.get i", "start": [ 2589, 1 ], "end": [ 2592, 15 ], "kind": "commanddeclaration" }, { "full_name": "Array.getD", "code": "@[inline] abbrev Array.getD (a : Array α) (i : Nat) (v₀ : α) : α :=\n dite (LT.lt i a.size) (fun h => a.get ⟨i, h⟩) (fun _ => v₀)", "start": [ 2594, 1 ], "end": [ 2596, 62 ], "kind": "commanddeclaration" }, { "full_name": "Array.get!", "code": "@[extern \"lean_array_get\"]\ndef Array.get! {α : Type u} [Inhabited α] (a : @& Array α) (i : @& Nat) : α :=\n Array.getD a i default", "start": [ 2598, 1 ], "end": [ 2601, 25 ], "kind": "commanddeclaration" }, { "full_name": "Array.push", "code": "@[extern \"lean_array_push\"]\ndef Array.push {α : Type u} (a : Array α) (v : α) : Array α where\n data := List.concat a.data v", "start": [ 2603, 1 ], "end": [ 2609, 31 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray0", "code": "def Array.mkArray0 {α : Type u} : Array α :=\n mkEmpty 0", "start": [ 2611, 1 ], "end": [ 2613, 12 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray1", "code": "def Array.mkArray1 {α : Type u} (a₁ : α) : Array α :=\n (mkEmpty 1).push a₁", "start": [ 2615, 1 ], "end": [ 2617, 22 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray2", "code": "def Array.mkArray2 {α : Type u} (a₁ a₂ : α) : Array α :=\n ((mkEmpty 2).push a₁).push a₂", "start": [ 2619, 1 ], "end": [ 2621, 32 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray3", "code": "def Array.mkArray3 {α : Type u} (a₁ a₂ a₃ : α) : Array α :=\n (((mkEmpty 3).push a₁).push a₂).push a₃", "start": [ 2623, 1 ], "end": [ 2625, 42 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray4", "code": "def Array.mkArray4 {α : Type u} (a₁ a₂ a₃ a₄ : α) : Array α :=\n ((((mkEmpty 4).push a₁).push a₂).push a₃).push a₄", "start": [ 2627, 1 ], "end": [ 2629, 52 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray5", "code": "def Array.mkArray5 {α : Type u} (a₁ a₂ a₃ a₄ a₅ : α) : Array α :=\n (((((mkEmpty 5).push a₁).push a₂).push a₃).push a₄).push a₅", "start": [ 2631, 1 ], "end": [ 2633, 62 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray6", "code": "def Array.mkArray6 {α : Type u} (a₁ a₂ a₃ a₄ a₅ a₆ : α) : Array α :=\n ((((((mkEmpty 6).push a₁).push a₂).push a₃).push a₄).push a₅).push a₆", "start": [ 2635, 1 ], "end": [ 2637, 72 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray7", "code": "def Array.mkArray7 {α : Type u} (a₁ a₂ a₃ a₄ a₅ a₆ a₇ : α) : Array α :=\n (((((((mkEmpty 7).push a₁).push a₂).push a₃).push a₄).push a₅).push a₆).push a₇", "start": [ 2639, 1 ], "end": [ 2641, 82 ], "kind": "commanddeclaration" }, { "full_name": "Array.mkArray8", "code": "def Array.mkArray8 {α : Type u} (a₁ a₂ a₃ a₄ a₅ a₆ a₇ a₈ : α) : Array α :=\n ((((((((mkEmpty 8).push a₁).push a₂).push a₃).push a₄).push a₅).push a₆).push a₇).push a₈", "start": [ 2643, 1 ], "end": [ 2645, 92 ], "kind": "commanddeclaration" }, { "full_name": "Array.set", "code": "@[extern \"lean_array_fset\"]\ndef Array.set (a : Array α) (i : @& Fin a.size) (v : α) : Array α where\n data := a.data.set i.val v", "start": [ 2647, 1 ], "end": [ 2655, 29 ], "kind": "commanddeclaration" }, { "full_name": "Array.setD", "code": "@[inline] def Array.setD (a : Array α) (i : Nat) (v : α) : Array α :=\n dite (LT.lt i a.size) (fun h => a.set ⟨i, h⟩ v) (fun _ => a)", "start": [ 2657, 1 ], "end": [ 2664, 63 ], "kind": "commanddeclaration" }, { "full_name": "Array.set!", "code": "@[extern \"lean_array_set\"]\ndef Array.set! (a : Array α) (i : @& Nat) (v : α) : Array α :=\n Array.setD a i v", "start": [ 2666, 1 ], "end": [ 2674, 19 ], "kind": "commanddeclaration" }, { "full_name": "Array.appendCore", "code": "protected def Array.appendCore {α : Type u} (as : Array α) (bs : Array α) : Array α :=\n let rec loop (i : Nat) (j : Nat) (as : Array α) : Array α :=\n dite (LT.lt j bs.size)\n (fun hlt =>\n match i with\n | 0 => as\n | Nat.succ i' => loop i' (hAdd j 1) (as.push (bs.get ⟨j, hlt⟩)))\n (fun _ => as)\n loop bs.size 0 as", "start": [ 2676, 1 ], "end": [ 2685, 20 ], "kind": "commanddeclaration" }, { "full_name": "Array.extract", "code": "def Array.extract (as : Array α) (start stop : Nat) : Array α :=\n let rec loop (i : Nat) (j : Nat) (bs : Array α) : Array α :=\n dite (LT.lt j as.size)\n (fun hlt =>\n match i with\n | 0 => bs\n | Nat.succ i' => loop i' (hAdd j 1) (bs.push (as.get ⟨j, hlt⟩)))\n (fun _ => bs)\n let sz' := Nat.sub (min stop as.size) start\n loop sz' start (mkEmpty sz')", "start": [ 2687, 1 ], "end": [ 2701, 31 ], "kind": "commanddeclaration" }, { "full_name": "List.toArrayAux", "code": "@[inline_if_reduce]\ndef List.toArrayAux : List α → Array α → Array α\n | nil, r => r\n | cons a as, r => toArrayAux as (r.push a)", "start": [ 2703, 1 ], "end": [ 2707, 45 ], "kind": "commanddeclaration" }, { "full_name": "List.redLength", "code": "@[inline_if_reduce]\ndef List.redLength : List α → Nat\n | nil => 0\n | cons _ as => as.redLength.succ", "start": [ 2709, 1 ], "end": [ 2713, 35 ], "kind": "commanddeclaration" }, { "full_name": "List.toArray", "code": "@[inline, match_pattern, pp_nodot, export lean_list_to_array]\ndef List.toArray (as : List α) : Array α :=\n as.toArrayAux (Array.mkEmpty as.redLength)", "start": [ 2715, 1 ], "end": [ 2720, 45 ], "kind": "commanddeclaration" }, { "full_name": "Bind", "code": "class Bind (m : Type u → Type v) where\n \n bind : {α β : Type u} → m α → (α → m β) → m β", "start": [ 2722, 1 ], "end": [ 2726, 48 ], "kind": "commanddeclaration" }, { "full_name": "Pure", "code": "class Pure (f : Type u → Type v) where\n \n pure {α : Type u} : α → f α", "start": [ 2730, 1 ], "end": [ 2734, 30 ], "kind": "commanddeclaration" }, { "full_name": "Functor", "code": "class Functor (f : Type u → Type v) : Type (max (u+1) v) where\n \n map : {α β : Type u} → (α → β) → f α → f β\n \n mapConst : {α β : Type u} → α → f β → f α := Function.comp map (Function.const _)", "start": [ 2738, 1 ], "end": [ 2752, 84 ], "kind": "commanddeclaration" }, { "full_name": "Seq", "code": "class Seq (f : Type u → Type v) : Type (max (u+1) v) where\n \n seq : {α β : Type u} → f (α → β) → (Unit → f α) → f β", "start": [ 2754, 1 ], "end": [ 2762, 56 ], "kind": "commanddeclaration" }, { "full_name": "SeqLeft", "code": "class SeqLeft (f : Type u → Type v) : Type (max (u+1) v) where\n \n seqLeft : {α β : Type u} → f α → (Unit → f β) → f α", "start": [ 2764, 1 ], "end": [ 2771, 54 ], "kind": "commanddeclaration" }, { "full_name": "SeqRight", "code": "class SeqRight (f : Type u → Type v) : Type (max (u+1) v) where\n \n seqRight : {α β : Type u} → f α → (Unit → f β) → f β", "start": [ 2773, 1 ], "end": [ 2780, 55 ], "kind": "commanddeclaration" }, { "full_name": "Applicative", "code": "class Applicative (f : Type u → Type v) extends Functor f, Pure f, Seq f, SeqLeft f, SeqRight f where\n map := fun x y => Seq.seq (pure x) fun _ => y\n seqLeft := fun a b => Seq.seq (Functor.map (Function.const _) a) b\n seqRight := fun a b => Seq.seq (Functor.map (Function.const _ id) a) b", "start": [ 2782, 1 ], "end": [ 2797, 73 ], "kind": "commanddeclaration" }, { "full_name": "Monad", "code": "class Monad (m : Type u → Type v) extends Applicative m, Bind m : Type (max (u+1) v) where\n map f x := bind x (Function.comp pure f)\n seq f x := bind f fun y => Functor.map y (x ())\n seqLeft x y := bind x fun a => bind (y ()) (fun _ => pure a)\n seqRight x y := bind x fun _ => y ()", "start": [ 2799, 1 ], "end": [ 2818, 39 ], "kind": "commanddeclaration" }, { "full_name": "Array.sequenceMap", "code": "def Array.sequenceMap {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m] (as : Array α) (f : α → m β) : m (Array β) :=\n let rec loop (i : Nat) (j : Nat) (bs : Array β) : m (Array β) :=\n dite (LT.lt j as.size)\n (fun hlt =>\n match i with\n | 0 => pure bs\n | Nat.succ i' => Bind.bind (f (as.get ⟨j, hlt⟩)) fun b => loop i' (hAdd j 1) (bs.push b))\n (fun _ => pure bs)\n loop as.size 0 (Array.mkEmpty as.size)", "start": [ 2829, 1 ], "end": [ 2838, 41 ], "kind": "commanddeclaration" }, { "full_name": "MonadLift", "code": "class MonadLift (m : semiOutParam (Type u → Type v)) (n : Type u → Type w) where\n \n monadLift : {α : Type u} → m α → n α", "start": [ 2840, 1 ], "end": [ 2850, 39 ], "kind": "commanddeclaration" }, { "full_name": "MonadLiftT", "code": "class MonadLiftT (m : Type u → Type v) (n : Type u → Type w) where\n \n monadLift : {α : Type u} → m α → n α", "start": [ 2852, 1 ], "end": [ 2861, 39 ], "kind": "commanddeclaration" }, { "full_name": "liftM", "code": "abbrev liftM := @monadLift", "start": [ 2865, 1 ], "end": [ 2866, 27 ], "kind": "commanddeclaration" }, { "full_name": "MonadFunctor", "code": "class MonadFunctor (m : semiOutParam (Type u → Type v)) (n : Type u → Type w) where\n \n monadMap {α : Type u} : ({β : Type u} → m β → m β) → n α → n α", "start": [ 2875, 1 ], "end": [ 2886, 65 ], "kind": "commanddeclaration" }, { "full_name": "MonadFunctorT", "code": "class MonadFunctorT (m : Type u → Type v) (n : Type u → Type w) where\n \n monadMap {α : Type u} : ({β : Type u} → m β → m β) → n α → n α", "start": [ 2888, 1 ], "end": [ 2893, 65 ], "kind": "commanddeclaration" }, { "full_name": "monadFunctorRefl", "code": "instance monadFunctorRefl (m) : MonadFunctorT m m where\n monadMap f := f", "start": [ 2901, 1 ], "end": [ 2902, 18 ], "kind": "commanddeclaration" }, { "full_name": "Except", "code": "inductive Except (ε : Type u) (α : Type v) where\n \n | error : ε → Except ε α\n \n | ok : α → Except ε α", "start": [ 2904, 1 ], "end": [ 2914, 27 ], "kind": "commanddeclaration" }, { "full_name": "MonadExceptOf", "code": "class MonadExceptOf (ε : semiOutParam (Type u)) (m : Type v → Type w) where\n \n throw {α : Type v} : ε → m α\n \n tryCatch {α : Type v} (body : m α) (handler : ε → m α) : m α", "start": [ 2921, 1 ], "end": [ 2943, 63 ], "kind": "commanddeclaration" }, { "full_name": "throwThe", "code": "abbrev throwThe (ε : Type u) {m : Type v → Type w} [MonadExceptOf ε m] {α : Type v} (e : ε) : m α :=\n MonadExceptOf.throw e", "start": [ 2945, 1 ], "end": [ 2950, 24 ], "kind": "commanddeclaration" }, { "full_name": "tryCatchThe", "code": "abbrev tryCatchThe (ε : Type u) {m : Type v → Type w} [MonadExceptOf ε m] {α : Type v} (x : m α) (handle : ε → m α) : m α :=\n MonadExceptOf.tryCatch x handle", "start": [ 2952, 1 ], "end": [ 2957, 34 ], "kind": "commanddeclaration" }, { "full_name": "MonadExcept", "code": "class MonadExcept (ε : outParam (Type u)) (m : Type v → Type w) where\n \n throw {α : Type v} : ε → m α\n \n tryCatch {α : Type v} : m α → (ε → m α) → m α", "start": [ 2959, 1 ], "end": [ 2967, 48 ], "kind": "commanddeclaration" }, { "full_name": "MonadExcept.ofExcept", "code": "def MonadExcept.ofExcept [Monad m] [MonadExcept ε m] : Except ε α → m α\n | .ok a => pure a\n | .error e => throw e", "start": [ 2969, 1 ], "end": [ 2972, 24 ], "kind": "commanddeclaration" }, { "full_name": "MonadExcept.orElse", "code": "@[inline] protected def orElse [MonadExcept ε m] {α : Type v} (t₁ : m α) (t₂ : Unit → m α) : m α :=\n tryCatch t₁ fun _ => t₂ ()", "start": [ 2983, 1 ], "end": [ 2985, 29 ], "kind": "commanddeclaration" }, { "full_name": "ReaderT", "code": "def ReaderT (ρ : Type u) (m : Type u → Type v) (α : Type u) : Type (max u v) :=\n ρ → m α", "start": [ 2992, 1 ], "end": [ 2999, 10 ], "kind": "commanddeclaration" }, { "full_name": "ReaderT.run", "code": "@[always_inline, inline]\ndef ReaderT.run {ρ : Type u} {m : Type u → Type v} {α : Type u} (x : ReaderT ρ m α) (r : ρ) : m α :=\n x r", "start": [ 3004, 1 ], "end": [ 3010, 6 ], "kind": "commanddeclaration" }, { "full_name": "ReaderT.read", "code": "@[always_inline, inline]\nprotected def read [Monad m] : ReaderT ρ m ρ :=\n pure", "start": [ 3030, 1 ], "end": [ 3033, 7 ], "kind": "commanddeclaration" }, { "full_name": "ReaderT.pure", "code": "@[always_inline, inline]\nprotected def pure [Monad m] {α} (a : α) : ReaderT ρ m α :=\n fun _ => pure a", "start": [ 3035, 1 ], "end": [ 3038, 18 ], "kind": "commanddeclaration" }, { "full_name": "ReaderT.bind", "code": "@[always_inline, inline]\nprotected def bind [Monad m] {α β} (x : ReaderT ρ m α) (f : α → ReaderT ρ m β) : ReaderT ρ m β :=\n fun r => bind (x r) fun a => f a r", "start": [ 3040, 1 ], "end": [ 3043, 37 ], "kind": "commanddeclaration" }, { "full_name": "ReaderT.adapt", "code": "@[always_inline, inline]\nprotected def adapt {ρ' α : Type u} (f : ρ' → ρ) : ReaderT ρ m α → ReaderT ρ' m α :=\n fun x r => x (f r)", "start": [ 3063, 1 ], "end": [ 3069, 21 ], "kind": "commanddeclaration" }, { "full_name": "MonadReaderOf", "code": "class MonadReaderOf (ρ : semiOutParam (Type u)) (m : Type u → Type v) where\n \n read : m ρ", "start": [ 3074, 1 ], "end": [ 3090, 13 ], "kind": "commanddeclaration" }, { "full_name": "readThe", "code": "@[always_inline, inline]\ndef readThe (ρ : Type u) {m : Type u → Type v} [MonadReaderOf ρ m] : m ρ :=\n MonadReaderOf.read", "start": [ 3092, 1 ], "end": [ 3098, 21 ], "kind": "commanddeclaration" }, { "full_name": "MonadReader", "code": "class MonadReader (ρ : outParam (Type u)) (m : Type u → Type v) where\n \n read : m ρ", "start": [ 3100, 1 ], "end": [ 3103, 13 ], "kind": "commanddeclaration" }, { "full_name": "MonadWithReaderOf", "code": "class MonadWithReaderOf (ρ : semiOutParam (Type u)) (m : Type u → Type v) where\n \n withReader {α : Type u} : (ρ → ρ) → m α → m α", "start": [ 3116, 1 ], "end": [ 3126, 48 ], "kind": "commanddeclaration" }, { "full_name": "withTheReader", "code": "@[always_inline, inline]\ndef withTheReader (ρ : Type u) {m : Type u → Type v} [MonadWithReaderOf ρ m] {α : Type u} (f : ρ → ρ) (x : m α) : m α :=\n MonadWithReaderOf.withReader f x", "start": [ 3128, 1 ], "end": [ 3134, 35 ], "kind": "commanddeclaration" }, { "full_name": "MonadWithReader", "code": "class MonadWithReader (ρ : outParam (Type u)) (m : Type u → Type v) where\n \n withReader {α : Type u} : (ρ → ρ) → m α → m α", "start": [ 3136, 1 ], "end": [ 3140, 48 ], "kind": "commanddeclaration" }, { "full_name": "MonadStateOf", "code": "class MonadStateOf (σ : semiOutParam (Type u)) (m : Type u → Type v) where\n \n get : m σ\n \n set : σ → m PUnit\n \n modifyGet {α : Type u} : (σ → Prod α σ) → m α", "start": [ 3153, 1 ], "end": [ 3170, 48 ], "kind": "commanddeclaration" }, { "full_name": "getThe", "code": "abbrev getThe (σ : Type u) {m : Type u → Type v} [MonadStateOf σ m] : m σ :=\n MonadStateOf.get", "start": [ 3174, 1 ], "end": [ 3179, 19 ], "kind": "commanddeclaration" }, { "full_name": "modifyThe", "code": "@[always_inline, inline]\nabbrev modifyThe (σ : Type u) {m : Type u → Type v} [MonadStateOf σ m] (f : σ → σ) : m PUnit :=\n MonadStateOf.modifyGet fun s => (PUnit.unit, f s)", "start": [ 3181, 1 ], "end": [ 3187, 52 ], "kind": "commanddeclaration" }, { "full_name": "modifyGetThe", "code": "@[always_inline, inline]\nabbrev modifyGetThe {α : Type u} (σ : Type u) {m : Type u → Type v} [MonadStateOf σ m] (f : σ → Prod α σ) : m α :=\n MonadStateOf.modifyGet f", "start": [ 3189, 1 ], "end": [ 3195, 27 ], "kind": "commanddeclaration" }, { "full_name": "MonadState", "code": "class MonadState (σ : outParam (Type u)) (m : Type u → Type v) where\n \n get : m σ\n \n set : σ → m PUnit\n \n modifyGet {α : Type u} : (σ → Prod α σ) → m α", "start": [ 3197, 1 ], "end": [ 3209, 48 ], "kind": "commanddeclaration" }, { "full_name": "modify", "code": "@[always_inline, inline]\ndef modify {σ : Type u} {m : Type u → Type v} [MonadState σ m] (f : σ → σ) : m PUnit :=\n modifyGet fun s => (PUnit.unit, f s)", "start": [ 3218, 1 ], "end": [ 3226, 39 ], "kind": "commanddeclaration" }, { "full_name": "getModify", "code": "@[always_inline, inline]\ndef getModify {σ : Type u} {m : Type u → Type v} [MonadState σ m] (f : σ → σ) : m σ :=\n modifyGet fun s => (s, f s)", "start": [ 3228, 1 ], "end": [ 3234, 30 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.Result", "code": "inductive Result (ε σ α : Type u) where\n \n | ok : α → σ → Result ε σ α\n \n | error : ε → σ → Result ε σ α", "start": [ 3246, 1 ], "end": [ 3254, 33 ], "kind": "commanddeclaration" }, { "full_name": "EStateM", "code": "def EStateM (ε σ α : Type u) := σ → Result ε σ α", "start": [ 3264, 1 ], "end": [ 3268, 49 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.pure", "code": "@[always_inline, inline]\nprotected def pure (a : α) : EStateM ε σ α := fun s =>\n Result.ok a s", "start": [ 3277, 1 ], "end": [ 3280, 16 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.set", "code": "@[always_inline, inline]\nprotected def set (s : σ) : EStateM ε σ PUnit := fun _ =>\n Result.ok ⟨⟩ s", "start": [ 3282, 1 ], "end": [ 3285, 17 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.get", "code": "@[always_inline, inline]\nprotected def get : EStateM ε σ σ := fun s =>\n Result.ok s s", "start": [ 3287, 1 ], "end": [ 3290, 16 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.modifyGet", "code": "@[always_inline, inline]\nprotected def modifyGet (f : σ → Prod α σ) : EStateM ε σ α := fun s =>\n match f s with\n | (a, s) => Result.ok a s", "start": [ 3292, 1 ], "end": [ 3296, 28 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.throw", "code": "@[always_inline, inline]\nprotected def throw (e : ε) : EStateM ε σ α := fun s =>\n Result.error e s", "start": [ 3298, 1 ], "end": [ 3301, 19 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.Backtrackable", "code": "class Backtrackable (δ : outParam (Type u)) (σ : Type u) where\n \n save : σ → δ\n \n restore : σ → δ → σ", "start": [ 3303, 1 ], "end": [ 3313, 22 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.tryCatch", "code": "@[always_inline, inline]\nprotected def tryCatch {δ} [Backtrackable δ σ] {α} (x : EStateM ε σ α) (handle : ε → EStateM ε σ α) : EStateM ε σ α := fun s =>\n let d := Backtrackable.save s\n match x s with\n | Result.error e s => handle e (Backtrackable.restore s d)\n | ok => ok", "start": [ 3315, 1 ], "end": [ 3321, 27 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.orElse", "code": "@[always_inline, inline]\nprotected def orElse {δ} [Backtrackable δ σ] (x₁ : EStateM ε σ α) (x₂ : Unit → EStateM ε σ α) : EStateM ε σ α := fun s =>\n let d := Backtrackable.save s;\n match x₁ s with\n | Result.error _ s => x₂ () (Backtrackable.restore s d)\n | ok => ok", "start": [ 3323, 1 ], "end": [ 3329, 27 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.adaptExcept", "code": "@[always_inline, inline]\ndef adaptExcept {ε' : Type u} (f : ε → ε') (x : EStateM ε σ α) : EStateM ε' σ α := fun s =>\n match x s with\n | Result.error e s => Result.error (f e) s\n | Result.ok a s => Result.ok a s", "start": [ 3331, 1 ], "end": [ 3336, 38 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.bind", "code": "@[always_inline, inline]\nprotected def bind (x : EStateM ε σ α) (f : α → EStateM ε σ β) : EStateM ε σ β := fun s =>\n match x s with\n | Result.ok a s => f a s\n | Result.error e s => Result.error e s", "start": [ 3338, 1 ], "end": [ 3343, 41 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.map", "code": "@[always_inline, inline]\nprotected def map (f : α → β) (x : EStateM ε σ α) : EStateM ε σ β := fun s =>\n match x s with\n | Result.ok a s => Result.ok (f a) s\n | Result.error e s => Result.error e s", "start": [ 3345, 1 ], "end": [ 3350, 41 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.seqRight", "code": "@[always_inline, inline]\nprotected def seqRight (x : EStateM ε σ α) (y : Unit → EStateM ε σ β) : EStateM ε σ β := fun s =>\n match x s with\n | Result.ok _ s => y () s\n | Result.error e s => Result.error e s", "start": [ 3352, 1 ], "end": [ 3357, 41 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.instMonad", "code": "@[always_inline]\ninstance instMonad : Monad (EStateM ε σ) where\n bind := EStateM.bind\n pure := EStateM.pure\n map := EStateM.map\n seqRight := EStateM.seqRight", "start": [ 3359, 1 ], "end": [ 3364, 31 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.run", "code": "@[always_inline, inline]\ndef run (x : EStateM ε σ α) (s : σ) : Result ε σ α := x s", "start": [ 3378, 1 ], "end": [ 3380, 58 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.run'", "code": "@[always_inline, inline]\ndef run' (x : EStateM ε σ α) (s : σ) : Option α :=\n match run x s with\n | Result.ok v _ => some v\n | Result.error .. => none", "start": [ 3382, 1 ], "end": [ 3390, 28 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.dummySave", "code": "@[inline] def dummySave : σ → PUnit := fun _ => ⟨⟩", "start": [ 3392, 1 ], "end": [ 3393, 51 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.dummyRestore", "code": "@[inline] def dummyRestore : σ → PUnit → σ := fun s _ => s", "start": [ 3395, 1 ], "end": [ 3396, 59 ], "kind": "commanddeclaration" }, { "full_name": "EStateM.nonBacktrackable", "code": "instance nonBacktrackable : Backtrackable PUnit σ where\n save := dummySave\n restore := dummyRestore", "start": [ 3398, 1 ], "end": [ 3406, 26 ], "kind": "commanddeclaration" }, { "full_name": "Hashable", "code": "class Hashable (α : Sort u) where\n \n hash : α → UInt64", "start": [ 3410, 1 ], "end": [ 3413, 20 ], "kind": "commanddeclaration" }, { "full_name": "UInt64.toUSize", "code": "@[extern \"lean_uint64_to_usize\"]\nopaque UInt64.toUSize (u : UInt64) : USize", "start": [ 3417, 1 ], "end": [ 3419, 43 ], "kind": "commanddeclaration" }, { "full_name": "USize.toUInt64", "code": "@[extern \"lean_usize_to_uint64\"]\ndef USize.toUInt64 (u : USize) : UInt64 where\n val := {\n val := u.val.val\n isLt :=\n let ⟨n, h⟩ := u\n show LT.lt n _ from\n match USize.size, usize_size_eq, h with\n | _, Or.inl rfl, h => Nat.lt_trans h (by decide)\n | _, Or.inr rfl, h => h\n }", "start": [ 3421, 1 ], "end": [ 3436, 4 ], "kind": "commanddeclaration" }, { "full_name": "mixHash", "code": "@[extern \"lean_uint64_mix_hash\"]\nopaque mixHash (u₁ u₂ : UInt64) : UInt64", "start": [ 3438, 1 ], "end": [ 3440, 41 ], "kind": "commanddeclaration" }, { "full_name": "String.hash", "code": "@[extern \"lean_string_hash\"]\nprotected opaque String.hash (s : @& String) : UInt64", "start": [ 3445, 1 ], "end": [ 3447, 54 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name", "code": "inductive Name where\n \n | anonymous : Name\n \n | str (pre : Name) (str : String)\n \n | num (pre : Name) (i : Nat)\nwith\n \n @[computed_field] hash : Name → UInt64\n | .anonymous => .ofNatCore 1723 (by decide)\n | .str p s => mixHash p.hash s.hash\n | .num p v => mixHash p.hash (dite (LT.lt v UInt64.size) (fun h => UInt64.ofNatCore v h) (fun _ => UInt64.ofNatCore 17 (by decide)))", "start": [ 3454, 1 ], "end": [ 3505, 137 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr", "code": "@[export lean_name_mk_string]\nabbrev mkStr (p : Name) (s : String) : Name :=\n Name.str p s", "start": [ 3515, 1 ], "end": [ 3520, 15 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkNum", "code": "@[export lean_name_mk_numeral]\nabbrev mkNum (p : Name) (v : Nat) : Name :=\n Name.num p v", "start": [ 3522, 1 ], "end": [ 3527, 15 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkSimple", "code": "abbrev mkSimple (s : String) : Name :=\n .str .anonymous s", "start": [ 3529, 1 ], "end": [ 3535, 20 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr1", "code": "@[reducible] def mkStr1 (s₁ : String) : Name :=\n .str .anonymous s₁", "start": [ 3537, 1 ], "end": [ 3539, 21 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr2", "code": "@[reducible] def mkStr2 (s₁ s₂ : String) : Name :=\n .str (.str .anonymous s₁) s₂", "start": [ 3541, 1 ], "end": [ 3543, 31 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr3", "code": "@[reducible] def mkStr3 (s₁ s₂ s₃ : String) : Name :=\n .str (.str (.str .anonymous s₁) s₂) s₃", "start": [ 3545, 1 ], "end": [ 3547, 41 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr4", "code": "@[reducible] def mkStr4 (s₁ s₂ s₃ s₄ : String) : Name :=\n .str (.str (.str (.str .anonymous s₁) s₂) s₃) s₄", "start": [ 3549, 1 ], "end": [ 3551, 51 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr5", "code": "@[reducible] def mkStr5 (s₁ s₂ s₃ s₄ s₅ : String) : Name :=\n .str (.str (.str (.str (.str .anonymous s₁) s₂) s₃) s₄) s₅", "start": [ 3553, 1 ], "end": [ 3555, 61 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr6", "code": "@[reducible] def mkStr6 (s₁ s₂ s₃ s₄ s₅ s₆ : String) : Name :=\n .str (.str (.str (.str (.str (.str .anonymous s₁) s₂) s₃) s₄) s₅) s₆", "start": [ 3557, 1 ], "end": [ 3559, 71 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr7", "code": "@[reducible] def mkStr7 (s₁ s₂ s₃ s₄ s₅ s₆ s₇ : String) : Name :=\n .str (.str (.str (.str (.str (.str (.str .anonymous s₁) s₂) s₃) s₄) s₅) s₆) s₇", "start": [ 3561, 1 ], "end": [ 3563, 81 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.mkStr8", "code": "@[reducible] def mkStr8 (s₁ s₂ s₃ s₄ s₅ s₆ s₇ s₈ : String) : Name :=\n .str (.str (.str (.str (.str (.str (.str (.str .anonymous s₁) s₂) s₃) s₄) s₅) s₆) s₇) s₈", "start": [ 3565, 1 ], "end": [ 3567, 91 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.beq", "code": "@[extern \"lean_name_eq\"]\nprotected def beq : (@& Name) → (@& Name) → Bool\n | anonymous, anonymous => true\n | str p₁ s₁, str p₂ s₂ => and (BEq.beq s₁ s₂) (Name.beq p₁ p₂)\n | num p₁ n₁, num p₂ n₂ => and (BEq.beq n₁ n₂) (Name.beq p₁ p₂)\n | _, _ => false", "start": [ 3569, 1 ], "end": [ 3575, 34 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.appendCore", "code": "def appendCore : Name → Name → Name\n | n, .anonymous => n\n | n, .str p s => .str (appendCore n p) s\n | n, .num p d => .num (appendCore n p) d", "start": [ 3580, 1 ], "end": [ 3587, 43 ], "kind": "commanddeclaration" }, { "full_name": "Lean.SourceInfo", "code": "inductive SourceInfo where\n \n | original (leading : Substring) (pos : String.Pos) (trailing : Substring) (endPos : String.Pos)\n \n | synthetic (pos : String.Pos) (endPos : String.Pos) (canonical := false)\n \n | protected none", "start": [ 3593, 1 ], "end": [ 3626, 19 ], "kind": "commanddeclaration" }, { "full_name": "Lean.SourceInfo.getPos?", "code": "def getPos? (info : SourceInfo) (canonicalOnly := false) : Option String.Pos :=\n match info, canonicalOnly with\n | original (pos := pos) .., _\n | synthetic (pos := pos) (canonical := true) .., _\n | synthetic (pos := pos) .., false => some pos\n | _, _ => none", "start": [ 3632, 1 ], "end": [ 3641, 45 ], "kind": "commanddeclaration" }, { "full_name": "Lean.SourceInfo.getTailPos?", "code": "def getTailPos? (info : SourceInfo) (canonicalOnly := false) : Option String.Pos :=\n match info, canonicalOnly with\n | original (endPos := endPos) .., _\n | synthetic (endPos := endPos) (canonical := true) .., _\n | synthetic (endPos := endPos) .., false => some endPos\n | _, _ => none", "start": [ 3643, 1 ], "end": [ 3652, 51 ], "kind": "commanddeclaration" }, { "full_name": "Lean.SyntaxNodeKind", "code": "abbrev SyntaxNodeKind := Name", "start": [ 3656, 1 ], "end": [ 3663, 30 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.Preresolved", "code": "inductive Syntax.Preresolved where\n \n | namespace (ns : Name)\n \n | decl (n : Name) (fields : List String)", "start": [ 3667, 1 ], "end": [ 3676, 43 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax", "code": "inductive Syntax where\n \n | missing : Syntax\n \n | node (info : SourceInfo) (kind : SyntaxNodeKind) (args : Array Syntax) : Syntax\n \n | atom (info : SourceInfo) (val : String) : Syntax\n \n | ident (info : SourceInfo) (rawVal : Substring) (val : Name) (preresolved : List Syntax.Preresolved) : Syntax", "start": [ 3678, 1 ], "end": [ 3716, 114 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node1", "code": "def Syntax.node1 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray1 a₁)", "start": [ 3718, 1 ], "end": [ 3720, 44 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node2", "code": "def Syntax.node2 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ a₂ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray2 a₁ a₂)", "start": [ 3722, 1 ], "end": [ 3724, 47 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node3", "code": "def Syntax.node3 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ a₂ a₃ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray3 a₁ a₂ a₃)", "start": [ 3726, 1 ], "end": [ 3728, 50 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node4", "code": "def Syntax.node4 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ a₂ a₃ a₄ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray4 a₁ a₂ a₃ a₄)", "start": [ 3730, 1 ], "end": [ 3732, 53 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node5", "code": "def Syntax.node5 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ a₂ a₃ a₄ a₅ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray5 a₁ a₂ a₃ a₄ a₅)", "start": [ 3734, 1 ], "end": [ 3736, 56 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node6", "code": "def Syntax.node6 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ a₂ a₃ a₄ a₅ a₆ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray6 a₁ a₂ a₃ a₄ a₅ a₆)", "start": [ 3738, 1 ], "end": [ 3740, 59 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node7", "code": "def Syntax.node7 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ a₂ a₃ a₄ a₅ a₆ a₇ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray7 a₁ a₂ a₃ a₄ a₅ a₆ a₇)", "start": [ 3742, 1 ], "end": [ 3744, 62 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.node8", "code": "def Syntax.node8 (info : SourceInfo) (kind : SyntaxNodeKind) (a₁ a₂ a₃ a₄ a₅ a₆ a₇ a₈ : Syntax) : Syntax :=\n Syntax.node info kind (Array.mkArray8 a₁ a₂ a₃ a₄ a₅ a₆ a₇ a₈)", "start": [ 3746, 1 ], "end": [ 3748, 65 ], "kind": "commanddeclaration" }, { "full_name": "Lean.SyntaxNodeKinds", "code": "def SyntaxNodeKinds := List SyntaxNodeKind", "start": [ 3750, 1 ], "end": [ 3751, 43 ], "kind": "commanddeclaration" }, { "full_name": "Lean.TSyntax", "code": "structure TSyntax (ks : SyntaxNodeKinds) where\n \n raw : Syntax", "start": [ 3753, 1 ], "end": [ 3762, 15 ], "kind": "commanddeclaration" }, { "full_name": "Lean.choiceKind", "code": "abbrev choiceKind : SyntaxNodeKind := `choice", "start": [ 3772, 1 ], "end": [ 3776, 46 ], "kind": "commanddeclaration" }, { "full_name": "Lean.nullKind", "code": "abbrev nullKind : SyntaxNodeKind := `null", "start": [ 3778, 1 ], "end": [ 3779, 42 ], "kind": "commanddeclaration" }, { "full_name": "Lean.groupKind", "code": "abbrev groupKind : SyntaxNodeKind := `group", "start": [ 3781, 1 ], "end": [ 3785, 44 ], "kind": "commanddeclaration" }, { "full_name": "Lean.identKind", "code": "abbrev identKind : SyntaxNodeKind := `ident", "start": [ 3787, 1 ], "end": [ 3792, 44 ], "kind": "commanddeclaration" }, { "full_name": "Lean.strLitKind", "code": "abbrev strLitKind : SyntaxNodeKind := `str", "start": [ 3794, 1 ], "end": [ 3795, 43 ], "kind": "commanddeclaration" }, { "full_name": "Lean.charLitKind", "code": "abbrev charLitKind : SyntaxNodeKind := `char", "start": [ 3797, 1 ], "end": [ 3798, 45 ], "kind": "commanddeclaration" }, { "full_name": "Lean.numLitKind", "code": "abbrev numLitKind : SyntaxNodeKind := `num", "start": [ 3800, 1 ], "end": [ 3801, 43 ], "kind": "commanddeclaration" }, { "full_name": "Lean.scientificLitKind", "code": "abbrev scientificLitKind : SyntaxNodeKind := `scientific", "start": [ 3803, 1 ], "end": [ 3804, 57 ], "kind": "commanddeclaration" }, { "full_name": "Lean.nameLitKind", "code": "abbrev nameLitKind : SyntaxNodeKind := `name", "start": [ 3806, 1 ], "end": [ 3807, 45 ], "kind": "commanddeclaration" }, { "full_name": "Lean.fieldIdxKind", "code": "abbrev fieldIdxKind : SyntaxNodeKind := `fieldIdx", "start": [ 3809, 1 ], "end": [ 3810, 50 ], "kind": "commanddeclaration" }, { "full_name": "Lean.hygieneInfoKind", "code": "abbrev hygieneInfoKind : SyntaxNodeKind := `hygieneInfo", "start": [ 3812, 1 ], "end": [ 3820, 56 ], "kind": "commanddeclaration" }, { "full_name": "Lean.interpolatedStrLitKind", "code": "abbrev interpolatedStrLitKind : SyntaxNodeKind := `interpolatedStrLitKind", "start": [ 3822, 1 ], "end": [ 3826, 74 ], "kind": "commanddeclaration" }, { "full_name": "Lean.interpolatedStrKind", "code": "abbrev interpolatedStrKind : SyntaxNodeKind := `interpolatedStrKind", "start": [ 3827, 1 ], "end": [ 3831, 68 ], "kind": "commanddeclaration" }, { "full_name": "Lean.mkNode", "code": "@[inline] def mkNode (k : SyntaxNodeKind) (args : Array Syntax) : TSyntax (.cons k .nil) :=\n ⟨Syntax.node SourceInfo.none k args⟩", "start": [ 3833, 1 ], "end": [ 3835, 39 ], "kind": "commanddeclaration" }, { "full_name": "Lean.mkNullNode", "code": "@[inline] def mkNullNode (args : Array Syntax := Array.empty) : Syntax :=\n mkNode nullKind args |>.raw", "start": [ 3837, 1 ], "end": [ 3840, 30 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getKind", "code": "def getKind (stx : Syntax) : SyntaxNodeKind :=\n match stx with\n | Syntax.node _ k _ => k\n | Syntax.missing => `missing\n | Syntax.atom _ v => Name.mkSimple v\n | Syntax.ident .. => identKind", "start": [ 3844, 1 ], "end": [ 3857, 36 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.setKind", "code": "def setKind (stx : Syntax) (k : SyntaxNodeKind) : Syntax :=\n match stx with\n | Syntax.node info _ args => Syntax.node info k args\n | _ => stx", "start": [ 3859, 1 ], "end": [ 3866, 35 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.isOfKind", "code": "def isOfKind (stx : Syntax) (k : SyntaxNodeKind) : Bool :=\n beq stx.getKind k", "start": [ 3868, 1 ], "end": [ 3870, 20 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getArg", "code": "def getArg (stx : Syntax) (i : Nat) : Syntax :=\n match stx with\n | Syntax.node _ _ args => args.getD i Syntax.missing\n | _ => Syntax.missing", "start": [ 3872, 1 ], "end": [ 3879, 43 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getArgs", "code": "def getArgs (stx : Syntax) : Array Syntax :=\n match stx with\n | Syntax.node _ _ args => args\n | _ => Array.empty", "start": [ 3881, 1 ], "end": [ 3885, 40 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getNumArgs", "code": "def getNumArgs (stx : Syntax) : Nat :=\n match stx with\n | Syntax.node _ _ args => args.size\n | _ => 0", "start": [ 3887, 1 ], "end": [ 3891, 30 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getOptional?", "code": "def getOptional? (stx : Syntax) : Option Syntax :=\n match stx with\n | Syntax.node _ k args => match and (beq k nullKind) (beq args.size 1) with\n | true => some (args.get! 0)\n | false => none\n | _ => none", "start": [ 3893, 1 ], "end": [ 3902, 33 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.isMissing", "code": "def isMissing : Syntax → Bool\n | Syntax.missing => true\n | _ => false", "start": [ 3904, 1 ], "end": [ 3907, 15 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.isNodeOf", "code": "def isNodeOf (stx : Syntax) (k : SyntaxNodeKind) (n : Nat) : Bool :=\n and (stx.isOfKind k) (beq stx.getNumArgs n)", "start": [ 3909, 1 ], "end": [ 3911, 46 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.isIdent", "code": "def isIdent : Syntax → Bool\n | ident .. => true\n | _ => false", "start": [ 3913, 1 ], "end": [ 3916, 22 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getId", "code": "def getId : Syntax → Name\n | ident _ _ val _ => val\n | _ => Name.anonymous", "start": [ 3918, 1 ], "end": [ 3921, 38 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.setArgs", "code": "def setArgs (stx : Syntax) (args : Array Syntax) : Syntax :=\n match stx with\n | node info k _ => node info k args\n | stx => stx", "start": [ 3923, 1 ], "end": [ 3930, 25 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.setArg", "code": "def setArg (stx : Syntax) (i : Nat) (arg : Syntax) : Syntax :=\n match stx with\n | node info k args => node info k (args.setD i arg)\n | stx => stx", "start": [ 3932, 1 ], "end": [ 3939, 28 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getHeadInfo?", "code": "partial def getHeadInfo? : Syntax → Option SourceInfo\n | atom info _ => some info\n | ident info .. => some info\n | node SourceInfo.none _ args =>\n let rec loop (i : Nat) : Option SourceInfo :=\n match decide (LT.lt i args.size) with\n | true => match getHeadInfo? (args.get! i) with\n | some info => some info\n | none => loop (hAdd i 1)\n | false => none\n loop 0\n | node info _ _ => some info\n | _ => none", "start": [ 3941, 1 ], "end": [ 3954, 26 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getHeadInfo", "code": "partial def getHeadInfo (stx : Syntax) : SourceInfo :=\n match stx.getHeadInfo? with\n | some info => info\n | none => SourceInfo.none", "start": [ 3956, 1 ], "end": [ 3960, 33 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getPos?", "code": "def getPos? (stx : Syntax) (canonicalOnly := false) : Option String.Pos :=\n stx.getHeadInfo.getPos? canonicalOnly", "start": [ 3962, 1 ], "end": [ 3968, 40 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.getTailPos?", "code": "partial def getTailPos? (stx : Syntax) (canonicalOnly := false) : Option String.Pos :=\n match stx, canonicalOnly with\n | atom (SourceInfo.original (endPos := pos) ..) .., _\n | atom (SourceInfo.synthetic (endPos := pos) (canonical := true) ..) _, _\n | atom (SourceInfo.synthetic (endPos := pos) ..) _, false\n | ident (SourceInfo.original (endPos := pos) ..) .., _\n | ident (SourceInfo.synthetic (endPos := pos) (canonical := true) ..) .., _\n | ident (SourceInfo.synthetic (endPos := pos) ..) .., false\n | node (SourceInfo.original (endPos := pos) ..) .., _\n | node (SourceInfo.synthetic (endPos := pos) (canonical := true) ..) .., _\n | node (SourceInfo.synthetic (endPos := pos) ..) .., false => some pos\n | node _ _ args, _ =>\n let rec loop (i : Nat) : Option String.Pos :=\n match decide (LT.lt i args.size) with\n | true => match getTailPos? (args.get! ((args.size.sub i).sub 1)) canonicalOnly with\n | some info => some info\n | none => loop (hAdd i 1)\n | false => none\n loop 0\n | _, _ => none", "start": [ 3971, 1 ], "end": [ 3995, 17 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.SepArray", "code": "structure SepArray (sep : String) where\n \n elemsAndSeps : Array Syntax", "start": [ 3997, 1 ], "end": [ 4004, 30 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.TSepArray", "code": "structure TSepArray (ks : SyntaxNodeKinds) (sep : String) where\n \n elemsAndSeps : Array Syntax", "start": [ 4006, 1 ], "end": [ 4010, 30 ], "kind": "commanddeclaration" }, { "full_name": "Lean.TSyntaxArray", "code": "abbrev TSyntaxArray (ks : SyntaxNodeKinds) := Array (TSyntax ks)", "start": [ 4014, 1 ], "end": [ 4015, 65 ], "kind": "commanddeclaration" }, { "full_name": "Lean.TSyntaxArray.rawImpl", "code": "unsafe def TSyntaxArray.rawImpl : TSyntaxArray ks → Array Syntax := unsafeCast", "start": [ 4017, 1 ], "end": [ 4018, 79 ], "kind": "commanddeclaration" }, { "full_name": "Lean.TSyntaxArray.raw", "code": "@[implemented_by TSyntaxArray.rawImpl]\nopaque TSyntaxArray.raw (as : TSyntaxArray ks) : Array Syntax := Array.empty", "start": [ 4020, 1 ], "end": [ 4022, 77 ], "kind": "commanddeclaration" }, { "full_name": "Lean.TSyntaxArray.mkImpl", "code": "unsafe def TSyntaxArray.mkImpl : Array Syntax → TSyntaxArray ks := unsafeCast", "start": [ 4024, 1 ], "end": [ 4025, 78 ], "kind": "commanddeclaration" }, { "full_name": "Lean.TSyntaxArray.mk", "code": "@[implemented_by TSyntaxArray.mkImpl]\nopaque TSyntaxArray.mk (as : Array Syntax) : TSyntaxArray ks := Array.empty", "start": [ 4027, 1 ], "end": [ 4029, 76 ], "kind": "commanddeclaration" }, { "full_name": "Lean.SourceInfo.fromRef", "code": "def SourceInfo.fromRef (ref : Syntax) (canonical := false) : SourceInfo :=\n let noncanonical ref :=\n match ref.getPos?, ref.getTailPos? with\n | some pos, some tailPos => .synthetic pos tailPos\n | _, _ => .none\n match canonical with\n | true =>\n match ref.getPos? true, ref.getTailPos? true with\n | some pos, some tailPos => .synthetic pos tailPos true\n | _, _ => noncanonical ref\n | false => noncanonical ref", "start": [ 4031, 1 ], "end": [ 4042, 30 ], "kind": "commanddeclaration" }, { "full_name": "Lean.mkAtom", "code": "def mkAtom (val : String) : Syntax :=\n Syntax.atom SourceInfo.none val", "start": [ 4044, 1 ], "end": [ 4046, 34 ], "kind": "commanddeclaration" }, { "full_name": "Lean.mkAtomFrom", "code": "def mkAtomFrom (src : Syntax) (val : String) (canonical := false) : Syntax :=\n Syntax.atom (SourceInfo.fromRef src canonical) val", "start": [ 4048, 1 ], "end": [ 4050, 53 ], "kind": "commanddeclaration" }, { "full_name": "Lean.ParserDescr", "code": "inductive ParserDescr where\n \n | const (name : Name)\n \n | unary (name : Name) (p : ParserDescr)\n \n | binary (name : Name) (p₁ p₂ : ParserDescr)\n \n | node (kind : SyntaxNodeKind) (prec : Nat) (p : ParserDescr)\n \n | trailingNode (kind : SyntaxNodeKind) (prec lhsPrec : Nat) (p : ParserDescr)\n \n | symbol (val : String)\n \n | nonReservedSymbol (val : String) (includeIdent : Bool)\n \n | cat (catName : Name) (rbp : Nat)\n \n | parser (declName : Name)\n \n | nodeWithAntiquot (name : String) (kind : SyntaxNodeKind) (p : ParserDescr)\n \n | sepBy (p : ParserDescr) (sep : String) (psep : ParserDescr) (allowTrailingSep : Bool := false)\n \n | sepBy1 (p : ParserDescr) (sep : String) (psep : ParserDescr) (allowTrailingSep : Bool := false)", "start": [ 4054, 1 ], "end": [ 4100, 100 ], "kind": "commanddeclaration" }, { "full_name": "Lean.TrailingParserDescr", "code": "abbrev TrailingParserDescr := ParserDescr", "start": [ 4105, 1 ], "end": [ 4111, 42 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MacroScope", "code": "abbrev MacroScope := Nat", "start": [ 4119, 1 ], "end": [ 4125, 25 ], "kind": "commanddeclaration" }, { "full_name": "Lean.reservedMacroScope", "code": "def reservedMacroScope := 0", "start": [ 4126, 1 ], "end": [ 4127, 28 ], "kind": "commanddeclaration" }, { "full_name": "Lean.firstFrontendMacroScope", "code": "def firstFrontendMacroScope := hAdd reservedMacroScope 1", "start": [ 4128, 1 ], "end": [ 4129, 57 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MonadRef", "code": "class MonadRef (m : Type → Type) where\n \n getRef : m Syntax\n \n withRef {α} : Syntax → m α → m α", "start": [ 4131, 1 ], "end": [ 4141, 35 ], "kind": "commanddeclaration" }, { "full_name": "Lean.replaceRef", "code": "def replaceRef (ref : Syntax) (oldRef : Syntax) : Syntax :=\n match ref.getPos? with\n | some _ => ref\n | _ => oldRef", "start": [ 4149, 1 ], "end": [ 4156, 21 ], "kind": "commanddeclaration" }, { "full_name": "Lean.withRef", "code": "@[always_inline, inline]\ndef withRef [Monad m] [MonadRef m] {α} (ref : Syntax) (x : m α) : m α :=\n bind getRef fun oldRef =>\n let ref := replaceRef ref oldRef\n MonadRef.withRef ref x", "start": [ 4158, 1 ], "end": [ 4167, 25 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MonadQuotation", "code": "class MonadQuotation (m : Type → Type) extends MonadRef m where\n \n getCurrMacroScope : m MacroScope\n \n getMainModule : m Name\n \n withFreshMacroScope {α : Type} : m α → m α", "start": [ 4169, 1 ], "end": [ 4196, 45 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MonadRef.mkInfoFromRefPos", "code": "@[inline]\ndef MonadRef.mkInfoFromRefPos [Monad m] [MonadRef m] : m SourceInfo :=\n return SourceInfo.fromRef (← getRef)", "start": [ 4200, 1 ], "end": [ 4203, 39 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.hasMacroScopes", "code": "def Name.hasMacroScopes : Name → Bool\n | str _ s => beq s \"_hyg\"\n | num p _ => hasMacroScopes p\n | _ => false", "start": [ 4231, 1 ], "end": [ 4235, 21 ], "kind": "commanddeclaration" }, { "full_name": "Lean.eraseMacroScopesAux", "code": "private def eraseMacroScopesAux : Name → Name\n | .str p s => match beq s \"_@\" with\n | true => p\n | false => eraseMacroScopesAux p\n | .num p _ => eraseMacroScopesAux p\n | .anonymous => Name.anonymous", "start": [ 4237, 1 ], "end": [ 4242, 33 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.eraseMacroScopes", "code": "@[export lean_erase_macro_scopes]\ndef Name.eraseMacroScopes (n : Name) : Name :=\n match n.hasMacroScopes with\n | true => eraseMacroScopesAux n\n | false => n", "start": [ 4244, 1 ], "end": [ 4249, 15 ], "kind": "commanddeclaration" }, { "full_name": "Lean.simpMacroScopesAux", "code": "private def simpMacroScopesAux : Name → Name\n | .num p i => Name.mkNum (simpMacroScopesAux p) i\n | n => eraseMacroScopesAux n", "start": [ 4251, 1 ], "end": [ 4253, 38 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.simpMacroScopes", "code": "@[export lean_simp_macro_scopes]\ndef Name.simpMacroScopes (n : Name) : Name :=\n match n.hasMacroScopes with\n | true => simpMacroScopesAux n\n | false => n", "start": [ 4255, 1 ], "end": [ 4260, 15 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MacroScopesView", "code": "structure MacroScopesView where\n \n name : Name\n \n imported : Name\n \n mainModule : Name\n \n scopes : List MacroScope", "start": [ 4262, 1 ], "end": [ 4279, 31 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MacroScopesView.review", "code": "def MacroScopesView.review (view : MacroScopesView) : Name :=\n match view.scopes with\n | List.nil => view.name\n | List.cons _ _ =>\n let base := (Name.mkStr (Name.appendCore (Name.appendCore (Name.mkStr view.name \"_@\") view.imported) view.mainModule) \"_hyg\")\n view.scopes.foldl Name.mkNum base", "start": [ 4284, 1 ], "end": [ 4290, 38 ], "kind": "commanddeclaration" }, { "full_name": "Lean.assembleParts", "code": "private def assembleParts : List Name → Name → Name\n | .nil, acc => acc\n | .cons (.str _ s) ps, acc => assembleParts ps (Name.mkStr acc s)\n | .cons (.num _ n) ps, acc => assembleParts ps (Name.mkNum acc n)\n | _, _ => panic \"Error: unreachable @ assembleParts\"", "start": [ 4292, 1 ], "end": [ 4296, 75 ], "kind": "commanddeclaration" }, { "full_name": "Lean.extractImported", "code": "private def extractImported (scps : List MacroScope) (mainModule : Name) : Name → List Name → MacroScopesView\n | n@(Name.str p str), parts =>\n match beq str \"_@\" with\n | true => { name := p, mainModule := mainModule, imported := assembleParts parts Name.anonymous, scopes := scps }\n | false => extractImported scps mainModule p (List.cons n parts)\n | n@(Name.num p _), parts => extractImported scps mainModule p (List.cons n parts)\n | _, _ => panic \"Error: unreachable @ extractImported\"", "start": [ 4298, 1 ], "end": [ 4304, 80 ], "kind": "commanddeclaration" }, { "full_name": "Lean.extractMainModule", "code": "private def extractMainModule (scps : List MacroScope) : Name → List Name → MacroScopesView\n | n@(Name.str p str), parts =>\n match beq str \"_@\" with\n | true => { name := p, mainModule := assembleParts parts Name.anonymous, imported := Name.anonymous, scopes := scps }\n | false => extractMainModule scps p (List.cons n parts)\n | n@(Name.num _ _), acc => extractImported scps (assembleParts acc Name.anonymous) n List.nil\n | _, _ => panic \"Error: unreachable @ extractMainModule\"", "start": [ 4306, 1 ], "end": [ 4312, 80 ], "kind": "commanddeclaration" }, { "full_name": "Lean.extractMacroScopesAux", "code": "private def extractMacroScopesAux : Name → List MacroScope → MacroScopesView\n | Name.num p scp, acc => extractMacroScopesAux p (List.cons scp acc)\n | Name.str p _ , acc => extractMainModule acc p List.nil | _, _ => panic \"Error: unreachable @ extractMacroScopesAux\"", "start": [ 4314, 1 ], "end": [ 4317, 80 ], "kind": "commanddeclaration" }, { "full_name": "Lean.extractMacroScopes", "code": "def extractMacroScopes (n : Name) : MacroScopesView :=\n match n.hasMacroScopes with\n | true => extractMacroScopesAux n List.nil\n | false => { name := n, scopes := List.nil, imported := Name.anonymous, mainModule := Name.anonymous }", "start": [ 4319, 1 ], "end": [ 4326, 105 ], "kind": "commanddeclaration" }, { "full_name": "Lean.addMacroScope", "code": "def addMacroScope (mainModule : Name) (n : Name) (scp : MacroScope) : Name :=\n match n.hasMacroScopes with\n | true =>\n let view := extractMacroScopes n\n match beq view.mainModule mainModule with\n | true => Name.mkNum n scp\n | false =>\n { view with\n imported := view.scopes.foldl Name.mkNum (Name.appendCore view.imported view.mainModule)\n mainModule := mainModule\n scopes := List.cons scp List.nil\n }.review\n | false =>\n Name.mkNum (Name.mkStr (Name.appendCore (Name.mkStr n \"_@\") mainModule) \"_hyg\") scp", "start": [ 4328, 1 ], "end": [ 4342, 88 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.append", "code": "def Name.append (a b : Name) : Name :=\n match a.hasMacroScopes, b.hasMacroScopes with\n | true, true =>\n panic \"Error: invalid `Name.append`, both arguments have macro scopes, consider using `eraseMacroScopes`\"\n | true, false =>\n let view := extractMacroScopes a\n { view with name := appendCore view.name b }.review\n | false, true =>\n let view := extractMacroScopes b\n { view with name := appendCore a view.name }.review\n | false, false => appendCore a b", "start": [ 4344, 1 ], "end": [ 4363, 35 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MonadQuotation.addMacroScope", "code": "@[inline] def MonadQuotation.addMacroScope {m : Type → Type} [MonadQuotation m] [Monad m] (n : Name) : m Name :=\n bind getMainModule fun mainModule =>\n bind getCurrMacroScope fun scp =>\n pure (Lean.addMacroScope mainModule n scp)", "start": [ 4368, 1 ], "end": [ 4375, 45 ], "kind": "commanddeclaration" }, { "full_name": "Lean.defaultMaxRecDepth", "code": "def defaultMaxRecDepth := 512", "start": [ 4377, 1 ], "end": [ 4378, 30 ], "kind": "commanddeclaration" }, { "full_name": "Lean.maxRecDepthErrorMessage", "code": "def maxRecDepthErrorMessage : String :=\n \"maximum recursion depth has been reached\\nuse `set_option maxRecDepth <num>` to increase limit\\nuse `set_option diagnostics true` to get diagnostic information\"", "start": [ 4380, 1 ], "end": [ 4382, 164 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.matchesNull", "code": "def matchesNull (stx : Syntax) (n : Nat) : Bool :=\n stx.isNodeOf nullKind n", "start": [ 4386, 1 ], "end": [ 4388, 26 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.matchesIdent", "code": "def matchesIdent (stx : Syntax) (id : Name) : Bool :=\n and stx.isIdent (beq stx.getId.eraseMacroScopes id.eraseMacroScopes)", "start": [ 4390, 1 ], "end": [ 4399, 71 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Syntax.matchesLit", "code": "def matchesLit (stx : Syntax) (k : SyntaxNodeKind) (val : String) : Bool :=\n match stx with\n | Syntax.node _ k' args => and (beq k k') (match args.getD 0 Syntax.missing with\n | Syntax.atom _ val' => beq val val'\n | _ => false)\n | _ => false", "start": [ 4401, 1 ], "end": [ 4407, 35 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.MethodsRefPointed", "code": "private opaque MethodsRefPointed : NonemptyType.{0}", "start": [ 4413, 1 ], "end": [ 4414, 52 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.MethodsRef", "code": "private def MethodsRef : Type := MethodsRefPointed.type", "start": [ 4416, 1 ], "end": [ 4416, 56 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.Context", "code": "structure Context where\n \n methods : MethodsRef\n \n mainModule : Name\n \n currMacroScope : MacroScope\n \n currRecDepth : Nat := 0\n \n maxRecDepth : Nat := defaultMaxRecDepth\n \n ref : Syntax", "start": [ 4420, 1 ], "end": [ 4434, 26 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.Exception", "code": "inductive Exception where\n \n | error : Syntax → String → Exception\n \n | unsupportedSyntax : Exception", "start": [ 4436, 1 ], "end": [ 4443, 34 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.State", "code": "structure State where\n \n macroScope : MacroScope\n \n traceMsgs : List (Prod Name String) := List.nil\n deriving Inhabited", "start": [ 4445, 1 ], "end": [ 4452, 21 ], "kind": "commanddeclaration" }, { "full_name": "Lean.MacroM", "code": "abbrev MacroM := ReaderT Macro.Context (EStateM Macro.Exception Macro.State)", "start": [ 4456, 1 ], "end": [ 4466, 77 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro", "code": "abbrev Macro := Syntax → MacroM Syntax", "start": [ 4468, 1 ], "end": [ 4473, 39 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.addMacroScope", "code": "def addMacroScope (n : Name) : MacroM Name :=\n bind read fun ctx =>\n pure (Lean.addMacroScope ctx.mainModule n ctx.currMacroScope)", "start": [ 4481, 1 ], "end": [ 4484, 64 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.throwUnsupported", "code": "def throwUnsupported {α} : MacroM α :=\n throw Exception.unsupportedSyntax", "start": [ 4486, 1 ], "end": [ 4488, 36 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.throwError", "code": "def throwError {α} (msg : String) : MacroM α :=\n bind getRef fun ref =>\n throw (Exception.error ref msg)", "start": [ 4490, 1 ], "end": [ 4496, 34 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.throwErrorAt", "code": "def throwErrorAt {α} (ref : Syntax) (msg : String) : MacroM α :=\n withRef ref (throwError msg)", "start": [ 4498, 1 ], "end": [ 4500, 31 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.withFreshMacroScope", "code": "@[inline] protected def withFreshMacroScope {α} (x : MacroM α) : MacroM α :=\n bind (modifyGet (fun s => (s.macroScope, { s with macroScope := hAdd s.macroScope 1 }))) fun fresh =>\n withReader (fun ctx => { ctx with currMacroScope := fresh }) x", "start": [ 4502, 1 ], "end": [ 4508, 65 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.withIncRecDepth", "code": "@[inline] def withIncRecDepth {α} (ref : Syntax) (x : MacroM α) : MacroM α :=\n bind read fun ctx =>\n match beq ctx.currRecDepth ctx.maxRecDepth with\n | true => throw (Exception.error ref maxRecDepthErrorMessage)\n | false => withReader (fun ctx => { ctx with currRecDepth := hAdd ctx.currRecDepth 1 }) x", "start": [ 4510, 1 ], "end": [ 4515, 92 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.Methods", "code": "structure Methods where\n \n expandMacro? : Syntax → MacroM (Option Syntax)\n \n getCurrNamespace : MacroM Name\n \n hasDecl : Name → MacroM Bool\n \n resolveNamespace : Name → MacroM (List Name)\n \n resolveGlobalName : Name → MacroM (List (Prod Name (List String)))\n deriving Inhabited", "start": [ 4522, 1 ], "end": [ 4537, 21 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.mkMethodsImp", "code": "unsafe def mkMethodsImp (methods : Methods) : MethodsRef :=\n unsafeCast methods", "start": [ 4539, 1 ], "end": [ 4541, 21 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.mkMethods", "code": "@[implemented_by mkMethodsImp]\nopaque mkMethods (methods : Methods) : MethodsRef", "start": [ 4543, 1 ], "end": [ 4545, 50 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.getMethodsImp", "code": "unsafe def getMethodsImp : MacroM Methods :=\n bind read fun ctx => pure (unsafeCast (ctx.methods))", "start": [ 4550, 1 ], "end": [ 4552, 55 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.getMethods", "code": "@[implemented_by getMethodsImp] opaque getMethods : MacroM Methods", "start": [ 4554, 1 ], "end": [ 4555, 67 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.expandMacro?", "code": "def expandMacro? (stx : Syntax) : MacroM (Option Syntax) := do\n (← getMethods).expandMacro? stx", "start": [ 4557, 1 ], "end": [ 4562, 34 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.hasDecl", "code": "def hasDecl (declName : Name) : MacroM Bool := do\n (← getMethods).hasDecl declName", "start": [ 4564, 1 ], "end": [ 4566, 34 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.getCurrNamespace", "code": "def getCurrNamespace : MacroM Name := do\n (← getMethods).getCurrNamespace", "start": [ 4568, 1 ], "end": [ 4570, 34 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.resolveNamespace", "code": "def resolveNamespace (n : Name) : MacroM (List Name) := do\n (← getMethods).resolveNamespace n", "start": [ 4572, 3 ], "end": [ 4574, 36 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.resolveGlobalName", "code": "def resolveGlobalName (n : Name) : MacroM (List (Prod Name (List String))) := do\n (← getMethods).resolveGlobalName n", "start": [ 4576, 1 ], "end": [ 4588, 37 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Macro.trace", "code": "def trace (clsName : Name) (msg : String) : MacroM Unit := do\n modify fun s => { s with traceMsgs := List.cons (Prod.mk clsName msg) s.traceMsgs }", "start": [ 4590, 1 ], "end": [ 4592, 86 ], "kind": "commanddeclaration" }, { "full_name": "Lean.PrettyPrinter.UnexpandM", "code": "abbrev UnexpandM := ReaderT Syntax (EStateM Unit Unit)", "start": [ 4600, 1 ], "end": [ 4604, 55 ], "kind": "commanddeclaration" }, { "full_name": "Lean.PrettyPrinter.Unexpander", "code": "abbrev Unexpander := Syntax → UnexpandM Syntax", "start": [ 4606, 1 ], "end": [ 4612, 47 ], "kind": "commanddeclaration" } ]
.lake/packages/lean4/src/lean/Init/Coe.lean
[ ".lake/packages/lean4/src/lean/Init/Prelude.lean" ]
[ { "full_name": "Coe", "code": "class Coe (α : semiOutParam (Sort u)) (β : Sort v) where\n \n coe : α → β", "start": [ 120, 1 ], "end": [ 129, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeTC", "code": "class CoeTC (α : Sort u) (β : Sort v) where\n \n coe : α → β", "start": [ 132, 1 ], "end": [ 139, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeOut", "code": "class CoeOut (α : Sort u) (β : semiOutParam (Sort v)) where\n \n coe : α → β", "start": [ 146, 1 ], "end": [ 152, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeOTC", "code": "class CoeOTC (α : Sort u) (β : Sort v) where\n \n coe : α → β", "start": [ 155, 1 ], "end": [ 162, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeHead", "code": "class CoeHead (α : Sort u) (β : semiOutParam (Sort v)) where\n \n coe : α → β", "start": [ 173, 1 ], "end": [ 180, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeHTC", "code": "class CoeHTC (α : Sort u) (β : Sort v) where\n \n coe : α → β", "start": [ 183, 1 ], "end": [ 190, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeTail", "code": "class CoeTail (α : semiOutParam (Sort u)) (β : Sort v) where\n \n coe : α → β", "start": [ 197, 1 ], "end": [ 205, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeHTCT", "code": "class CoeHTCT (α : Sort u) (β : Sort v) where\n \n coe : α → β", "start": [ 208, 1 ], "end": [ 215, 14 ], "kind": "commanddeclaration" }, { "full_name": "CoeDep", "code": "class CoeDep (α : Sort u) (_ : α) (β : Sort v) where\n \n coe : β", "start": [ 222, 1 ], "end": [ 234, 10 ], "kind": "commanddeclaration" }, { "full_name": "CoeT", "code": "class CoeT (α : Sort u) (_ : α) (β : Sort v) where\n \n coe : β", "start": [ 237, 1 ], "end": [ 248, 10 ], "kind": "commanddeclaration" }, { "full_name": "CoeFun", "code": "class CoeFun (α : Sort u) (γ : outParam (α → Sort v)) where\n \n coe : (f : α) → γ f", "start": [ 255, 1 ], "end": [ 266, 22 ], "kind": "commanddeclaration" }, { "full_name": "CoeSort", "code": "class CoeSort (α : Sort u) (β : outParam (Sort v)) where\n \n coe : α → β", "start": [ 271, 1 ], "end": [ 279, 14 ], "kind": "commanddeclaration" }, { "full_name": "boolToProp", "code": "instance boolToProp : Coe Bool Prop where\n coe b := Eq b true", "start": [ 301, 1 ], "end": [ 302, 21 ], "kind": "commanddeclaration" }, { "full_name": "boolToSort", "code": "instance boolToSort : CoeSort Bool Prop where\n coe b := b", "start": [ 304, 1 ], "end": [ 305, 13 ], "kind": "commanddeclaration" }, { "full_name": "decPropToBool", "code": "instance decPropToBool (p : Prop) [Decidable p] : CoeDep Prop p Bool where\n coe := decide p", "start": [ 307, 1 ], "end": [ 308, 18 ], "kind": "commanddeclaration" }, { "full_name": "optionCoe", "code": "instance optionCoe {α : Type u} : Coe α (Option α) where\n coe := some", "start": [ 310, 1 ], "end": [ 311, 14 ], "kind": "commanddeclaration" }, { "full_name": "subtypeCoe", "code": "instance subtypeCoe {α : Sort u} {p : α → Prop} : CoeOut (Subtype p) α where\n coe v := v.val", "start": [ 313, 1 ], "end": [ 314, 17 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Internal.liftCoeM", "code": "@[coe_decl] abbrev Lean.Internal.liftCoeM {m : Type u → Type v} {n : Type u → Type w} {α β : Type u}\n [MonadLiftT m n] [∀ a, CoeT α a β] [Monad n] (x : m α) : n β := do\n let a ← liftM x\n pure (CoeT.coe a)", "start": [ 318, 1 ], "end": [ 327, 20 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Internal.coeM", "code": "@[coe_decl] abbrev Lean.Internal.coeM {m : Type u → Type v} {α β : Type u}\n [∀ a, CoeT α a β] [Monad m] (x : m α) : m β := do\n let a ← x\n pure (CoeT.coe a)", "start": [ 329, 1 ], "end": [ 337, 20 ], "kind": "commanddeclaration" } ]
.lake/packages/lean4/src/lean/Init/Notation.lean
[ ".lake/packages/lean4/src/lean/Init/Coe.lean", ".lake/packages/lean4/src/lean/Init/Prelude.lean" ]
[ { "full_name": "Lean.Parser.Category", "code": "structure Parser.Category", "start": [ 15, 1 ], "end": [ 19, 26 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.command", "code": "def command : Category := {}", "start": [ 23, 1 ], "end": [ 28, 29 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.term", "code": "def term : Category := {}", "start": [ 30, 1 ], "end": [ 35, 26 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.tactic", "code": "def tactic : Category := {}", "start": [ 37, 1 ], "end": [ 45, 28 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.doElem", "code": "def doElem : Category := {}", "start": [ 47, 1 ], "end": [ 49, 28 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.level", "code": "def level : Category := {}", "start": [ 51, 1 ], "end": [ 54, 27 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.attr", "code": "def attr : Category := {}", "start": [ 56, 1 ], "end": [ 58, 26 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.stx", "code": "def stx : Category := {}", "start": [ 60, 1 ], "end": [ 62, 25 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.prio", "code": "def prio : Category := {}", "start": [ 64, 1 ], "end": [ 70, 26 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Category.prec", "code": "def prec : Category := {}", "start": [ 72, 1 ], "end": [ 81, 26 ], "kind": "commanddeclaration" } ]
.lake/packages/lean4/src/lean/Init/Tactics.lean
[ ".lake/packages/lean4/src/lean/Init/Notation.lean" ]
[ { "full_name": "Lean.Parser.Tactic.simpArg", "code": "def simpArg := simpStar.binary `orelse (simpErase.binary `orelse simpLemma)", "start": [ 588, 1 ], "end": [ 592, 76 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Parser.Tactic.dsimpArg", "code": "def dsimpArg := simpErase.binary `orelse simpLemma", "start": [ 597, 1 ], "end": [ 601, 51 ], "kind": "commanddeclaration" }, { "full_name": "autoParam", "code": "abbrev autoParam.{u} (α : Sort u) (tactic : Lean.Syntax) : Sort u := α", "start": [ 1609, 1 ], "end": [ 1614, 71 ], "kind": "commanddeclaration" } ]
.lake/packages/lean4/src/lean/Init/SizeOf.lean
[ ".lake/packages/lean4/src/lean/Init/Tactics.lean" ]
[ { "full_name": "SizeOf", "code": "class SizeOf (α : Sort u) where\n \n sizeOf : α → Nat", "start": [ 12, 1 ], "end": [ 28, 19 ], "kind": "commanddeclaration" }, { "full_name": "default.sizeOf", "code": "protected def default.sizeOf (α : Sort u) : α → Nat\n | _ => 0", "start": [ 37, 1 ], "end": [ 42, 11 ], "kind": "commanddeclaration" }, { "full_name": "sizeOf_default", "code": "@[simp] theorem sizeOf_default (n : α) : sizeOf n = 0", "start": [ 47, 1 ], "end": [ 47, 61 ], "kind": "commanddeclaration" }, { "full_name": "sizeOf_nat", "code": "@[simp] theorem sizeOf_nat (n : Nat) : sizeOf n = n", "start": [ 52, 1 ], "end": [ 52, 59 ], "kind": "commanddeclaration" }, { "full_name": "sizeOf_thunk", "code": "@[simp] theorem sizeOf_thunk [SizeOf α] (f : Unit → α) : sizeOf f = sizeOf (f ())", "start": [ 57, 1 ], "end": [ 58, 6 ], "kind": "commanddeclaration" }, { "full_name": "Unit.sizeOf", "code": "@[simp] theorem Unit.sizeOf (u : Unit) : sizeOf u = 1", "start": [ 85, 1 ], "end": [ 85, 61 ], "kind": "commanddeclaration" }, { "full_name": "Bool.sizeOf_eq_one", "code": "@[simp] theorem Bool.sizeOf_eq_one (b : Bool) : sizeOf b = 1", "start": [ 86, 1 ], "end": [ 86, 83 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.sizeOf", "code": "protected noncomputable def Name.sizeOf : Name → Nat\n | anonymous => 1\n | str p s => 1 + Name.sizeOf p + sizeOf s\n | num p n => 1 + Name.sizeOf p + sizeOf n", "start": [ 90, 1 ], "end": [ 97, 46 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.anonymous.sizeOf_spec", "code": "@[simp] theorem Name.anonymous.sizeOf_spec : sizeOf anonymous = 1", "start": [ 102, 1 ], "end": [ 103, 6 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.str.sizeOf_spec", "code": "@[simp] theorem Name.str.sizeOf_spec (p : Name) (s : String) : sizeOf (str p s) = 1 + sizeOf p + sizeOf s", "start": [ 104, 1 ], "end": [ 105, 6 ], "kind": "commanddeclaration" }, { "full_name": "Lean.Name.num.sizeOf_spec", "code": "@[simp] theorem Name.num.sizeOf_spec (p : Name) (n : Nat) : sizeOf (num p n) = 1 + sizeOf p + sizeOf n", "start": [ 106, 1 ], "end": [ 107, 6 ], "kind": "commanddeclaration" } ]
.lake/packages/lean4/src/lean/Init/Core.lean
[ ".lake/packages/lean4/src/lean/Init/Prelude.lean", ".lake/packages/lean4/src/lean/Init/SizeOf.lean" ]
[ { "full_name": "inline", "code": "@[simp] def inline {α : Sort u} (a : α) : α := a", "start": [ 15, 1 ], "end": [ 20, 49 ], "kind": "commanddeclaration" }, { "full_name": "id_def", "code": "theorem id_def {α : Sort u} (a : α) : id a = a", "start": [ 22, 1 ], "end": [ 22, 54 ], "kind": "commanddeclaration" }, { "full_name": "flip", "code": "@[inline] def flip {α : Sort u} {β : Sort v} {φ : Sort w} (f : α → β → φ) : β → α → φ :=\n fun b a => f a b", "start": [ 24, 1 ], "end": [ 31, 19 ], "kind": "commanddeclaration" }, { "full_name": "Function.const_apply", "code": "@[simp] theorem Function.const_apply {y : β} {x : α} : const α y x = y", "start": [ 33, 1 ], "end": [ 33, 78 ], "kind": "commanddeclaration" }, { "full_name": "Function.comp_apply", "code": "@[simp] theorem Function.comp_apply {f : β → δ} {g : α → β} {x : α} : comp f g x = f (g x)", "start": [ 35, 1 ], "end": [ 35, 98 ], "kind": "commanddeclaration" }, { "full_name": "Function.comp_def", "code": "theorem Function.comp_def {α β δ} (f : β → δ) (g : α → β) : f ∘ g = fun x => f (g x)", "start": [ 37, 1 ], "end": [ 37, 92 ], "kind": "commanddeclaration" }, { "full_name": "Empty.elim", "code": "@[macro_inline] def Empty.elim {C : Sort u} : Empty → C := Empty.rec", "start": [ 41, 1 ], "end": [ 47, 69 ], "kind": "commanddeclaration" }, { "full_name": "PEmpty.elim", "code": "@[macro_inline] def PEmpty.elim {C : Sort _} : PEmpty → C := fun a => nomatch a", "start": [ 52, 1 ], "end": [ 58, 80 ], "kind": "commanddeclaration" }, { "full_name": "Thunk", "code": "structure Thunk (α : Type u) : Type u where\n \n mk ::\n \n private fn : Unit → α", "start": [ 63, 1 ], "end": [ 72, 24 ], "kind": "commanddeclaration" }, { "full_name": "Thunk.pure", "code": "@[extern \"lean_thunk_pure\"] protected def Thunk.pure (a : α) : Thunk α :=\n ⟨fun _ => a⟩", "start": [ 76, 1 ], "end": [ 78, 15 ], "kind": "commanddeclaration" }, { "full_name": "Thunk.get", "code": "@[extern \"lean_thunk_get_own\"] protected def Thunk.get (x : @& Thunk α) : α :=\n x.fn ()", "start": [ 80, 1 ], "end": [ 87, 10 ], "kind": "commanddeclaration" }, { "full_name": "Thunk.map", "code": "@[inline] protected def Thunk.map (f : α → β) (x : Thunk α) : Thunk β :=\n ⟨fun _ => f x.get⟩", "start": [ 89, 1 ], "end": [ 91, 21 ], "kind": "commanddeclaration" }, { "full_name": "Thunk.bind", "code": "@[inline] protected def Thunk.bind (x : Thunk α) (f : α → Thunk β) : Thunk β :=\n ⟨fun _ => (f x.get).get⟩", "start": [ 92, 1 ], "end": [ 94, 27 ], "kind": "commanddeclaration" }, { "full_name": "Thunk.sizeOf_eq", "code": "@[simp] theorem Thunk.sizeOf_eq [SizeOf α] (a : Thunk α) : sizeOf a = 1 + sizeOf a.get", "start": [ 96, 1 ], "end": [ 97, 16 ], "kind": "commanddeclaration" }, { "full_name": "thunkCoe", "code": "instance thunkCoe : CoeTail α (Thunk α) where\n coe a := ⟨fun _ => a⟩", "start": [ 99, 1 ], "end": [ 101, 24 ], "kind": "commanddeclaration" }, { "full_name": "Eq.ndrecOn", "code": "abbrev Eq.ndrecOn.{u1, u2} {α : Sort u2} {a : α} {motive : α → Sort u1} {b : α} (h : a = b) (m : motive a) : motive b :=\n Eq.ndrec m h", "start": [ 103, 1 ], "end": [ 105, 15 ], "kind": "commanddeclaration" }, { "full_name": "Iff", "code": "structure Iff (a b : Prop) : Prop where\n \n intro ::\n \n mp : a → b\n \n mpr : b → a", "start": [ 109, 1 ], "end": [ 120, 14 ], "kind": "commanddeclaration" }, { "full_name": "Sum", "code": "inductive Sum (α : Type u) (β : Type v) where\n \n | inl (val : α) : Sum α β\n \n | inr (val : β) : Sum α β", "start": [ 125, 1 ], "end": [ 134, 28 ], "kind": "commanddeclaration" }, { "full_name": "PSum", "code": "inductive PSum (α : Sort u) (β : Sort v) where\n \n | inl (val : α) : PSum α β\n \n | inr (val : β) : PSum α β", "start": [ 138, 1 ], "end": [ 153, 29 ], "kind": "commanddeclaration" }, { "full_name": "Sigma", "code": "@[pp_using_anonymous_constructor]\nstructure Sigma {α : Type u} (β : α → Type v) where\n \n mk ::\n \n fst : α\n \n snd : β fst", "start": [ 161, 1 ], "end": [ 177, 14 ], "kind": "commanddeclaration" }, { "full_name": "PSigma", "code": "@[pp_using_anonymous_constructor]\nstructure PSigma {α : Sort u} (β : α → Sort v) where\n \n mk ::\n \n fst : α\n \n snd : β fst", "start": [ 181, 1 ], "end": [ 203, 14 ], "kind": "commanddeclaration" }, { "full_name": "Exists", "code": "inductive Exists {α : Sort u} (p : α → Prop) : Prop where\n \n | intro (w : α) (h : p w) : Exists p", "start": [ 205, 1 ], "end": [ 233, 39 ], "kind": "commanddeclaration" }, { "full_name": "ForInStep", "code": "inductive ForInStep (α : Type u) where\n \n | done : α → ForInStep α\n \n | yield : α → ForInStep α\n deriving Inhabited", "start": [ 235, 1 ], "end": [ 253, 21 ], "kind": "commanddeclaration" }, { "full_name": "ForIn", "code": "class ForIn (m : Type u₁ → Type u₂) (ρ : Type u) (α : outParam (Type v)) where\n \n forIn {β} [Monad m] (x : ρ) (b : β) (f : α → β → m (ForInStep β)) : m β", "start": [ 255, 1 ], "end": [ 282, 74 ], "kind": "commanddeclaration" }, { "full_name": "ForIn'", "code": "class ForIn' (m : Type u₁ → Type u₂) (ρ : Type u) (α : outParam (Type v)) (d : outParam $ Membership α ρ) where\n \n forIn' {β} [Monad m] (x : ρ) (b : β) (f : (a : α) → a ∈ x → β → m (ForInStep β)) : m β", "start": [ 286, 1 ], "end": [ 298, 89 ], "kind": "commanddeclaration" }, { "full_name": "DoResultPRBC", "code": "inductive DoResultPRBC (α β σ : Type u) where\n \n | pure : α → σ → DoResultPRBC α β σ\n \n | return : β → σ → DoResultPRBC α β σ\n \n | break : σ → DoResultPRBC α β σ\n \n | continue : σ → DoResultPRBC α β σ", "start": [ 303, 1 ], "end": [ 326, 38 ], "kind": "commanddeclaration" }, { "full_name": "DoResultPR", "code": "inductive DoResultPR (α β σ : Type u) where\n \n | pure : α → σ → DoResultPR α β σ\n \n | return : β → σ → DoResultPR α β σ", "start": [ 328, 1 ], "end": [ 337, 38 ], "kind": "commanddeclaration" }, { "full_name": "DoResultBC", "code": "inductive DoResultBC (σ : Type u) where\n \n | break : σ → DoResultBC σ\n \n | continue : σ → DoResultBC σ", "start": [ 339, 1 ], "end": [ 350, 32 ], "kind": "commanddeclaration" }, { "full_name": "DoResultSBC", "code": "inductive DoResultSBC (α σ : Type u) where\n \n | pureReturn : α → σ → DoResultSBC α σ\n \n | break : σ → DoResultSBC α σ\n \n | continue : σ → DoResultSBC α σ", "start": [ 352, 1 ], "end": [ 369, 37 ], "kind": "commanddeclaration" }, { "full_name": "HasEquiv", "code": "class HasEquiv (α : Sort u) where\n \n Equiv : α → α → Sort v", "start": [ 371, 1 ], "end": [ 375, 25 ], "kind": "commanddeclaration" }, { "full_name": "HasSubset", "code": "class HasSubset (α : Type u) where\n \n Subset : α → α → Prop", "start": [ 381, 1 ], "end": [ 384, 24 ], "kind": "commanddeclaration" }, { "full_name": "HasSSubset", "code": "class HasSSubset (α : Type u) where\n \n SSubset : α → α → Prop", "start": [ 387, 1 ], "end": [ 390, 25 ], "kind": "commanddeclaration" }, { "full_name": "Superset", "code": "abbrev Superset [HasSubset α] (a b : α) := Subset b a", "start": [ 393, 1 ], "end": [ 394, 54 ], "kind": "commanddeclaration" }, { "full_name": "SSuperset", "code": "abbrev SSuperset [HasSSubset α] (a b : α) := SSubset b a", "start": [ 396, 1 ], "end": [ 397, 57 ], "kind": "commanddeclaration" }, { "full_name": "Union", "code": "class Union (α : Type u) where\n \n union : α → α → α", "start": [ 399, 1 ], "end": [ 402, 20 ], "kind": "commanddeclaration" }, { "full_name": "Inter", "code": "class Inter (α : Type u) where\n \n inter : α → α → α", "start": [ 404, 1 ], "end": [ 407, 20 ], "kind": "commanddeclaration" }, { "full_name": "SDiff", "code": "class SDiff (α : Type u) where\n \n sdiff : α → α → α", "start": [ 409, 1 ], "end": [ 415, 20 ], "kind": "commanddeclaration" }, { "full_name": "EmptyCollection", "code": "class EmptyCollection (α : Type u) where\n \n emptyCollection : α", "start": [ 443, 1 ], "end": [ 447, 22 ], "kind": "commanddeclaration" }, { "full_name": "Insert", "code": "class Insert (α : outParam <| Type u) (γ : Type v) where\n \n insert : α → γ → γ", "start": [ 452, 1 ], "end": [ 458, 21 ], "kind": "commanddeclaration" }, { "full_name": "Singleton", "code": "class Singleton (α : outParam <| Type u) (β : Type v) where\n \n singleton : α → β", "start": [ 461, 1 ], "end": [ 467, 20 ], "kind": "commanddeclaration" }, { "full_name": "LawfulSingleton", "code": "class LawfulSingleton (α : Type u) (β : Type v) [EmptyCollection β] [Insert α β] [Singleton α β] :\n Prop where\n \n insert_emptyc_eq (x : α) : (insert x ∅ : β) = singleton x", "start": [ 470, 1 ], "end": [ 474, 60 ], "kind": "commanddeclaration" }, { "full_name": "Sep", "code": "class Sep (α : outParam <| Type u) (γ : Type v) where\n \n sep : (α → Prop) → γ → γ", "start": [ 477, 1 ], "end": [ 480, 27 ], "kind": "commanddeclaration" }, { "full_name": "Task", "code": "structure Task (α : Type u) : Type u where\n \n pure ::\n \n get : α\n deriving Inhabited, Nonempty", "start": [ 482, 1 ], "end": [ 496, 31 ], "kind": "commanddeclaration" }, { "full_name": "Task.Priority", "code": "abbrev Priority := Nat", "start": [ 502, 1 ], "end": [ 503, 23 ], "kind": "commanddeclaration" }, { "full_name": "Task.Priority.default", "code": "def Priority.default : Priority := 0", "start": [ 505, 1 ], "end": [ 506, 37 ], "kind": "commanddeclaration" }, { "full_name": "Task.Priority.max", "code": "def Priority.max : Priority := 8", "start": [ 507, 1 ], "end": [ 515, 33 ], "kind": "commanddeclaration" }, { "full_name": "Task.Priority.dedicated", "code": "def Priority.dedicated : Priority := 9", "start": [ 516, 1 ], "end": [ 522, 39 ], "kind": "commanddeclaration" }, { "full_name": "Task.spawn", "code": "@[noinline, extern \"lean_task_spawn\"]\nprotected def spawn {α : Type u} (fn : Unit → α) (prio := Priority.default) : Task α :=\n ⟨fn ()⟩", "start": [ 525, 1 ], "end": [ 533, 10 ], "kind": "commanddeclaration" }, { "full_name": "Task.map", "code": "@[noinline, extern \"lean_task_map\"]\nprotected def map (f : α → β) (x : Task α) (prio := Priority.default) (sync := false) : Task β :=\n ⟨f x.get⟩", "start": [ 536, 1 ], "end": [ 546, 12 ], "kind": "commanddeclaration" }, { "full_name": "Task.bind", "code": "@[noinline, extern \"lean_task_bind\"]\nprotected def bind (x : Task α) (f : α → Task β) (prio := Priority.default) (sync := false) :\n Task β :=\n ⟨(f x.get).get⟩", "start": [ 549, 1 ], "end": [ 561, 18 ], "kind": "commanddeclaration" }, { "full_name": "NonScalar", "code": "structure NonScalar where\n mk ::\n val : Nat", "start": [ 565, 1 ], "end": [ 573, 52 ], "kind": "commanddeclaration" }, { "full_name": "PNonScalar", "code": "inductive PNonScalar : Type u where\n \n | mk (v : Nat) : PNonScalar", "start": [ 575, 1 ], "end": [ 586, 30 ], "kind": "commanddeclaration" }, { "full_name": "Nat.add_zero", "code": "@[simp] protected theorem Nat.add_zero (n : Nat) : n + 0 = n", "start": [ 588, 1 ], "end": [ 588, 68 ], "kind": "commanddeclaration" }, { "full_name": "optParam_eq", "code": "theorem optParam_eq (α : Sort u) (default : α) : optParam α default = α", "start": [ 590, 1 ], "end": [ 590, 79 ], "kind": "commanddeclaration" }, { "full_name": "strictOr", "code": "@[extern \"lean_strict_or\"] def strictOr (b₁ b₂ : Bool) := b₁ || b₂", "start": [ 594, 1 ], "end": [ 598, 68 ], "kind": "commanddeclaration" }, { "full_name": "strictAnd", "code": "@[extern \"lean_strict_and\"] def strictAnd (b₁ b₂ : Bool) := b₁ && b₂", "start": [ 600, 1 ], "end": [ 604, 69 ], "kind": "commanddeclaration" }, { "full_name": "bne", "code": "@[inline] def bne {α : Type u} [BEq α] (a b : α) : Bool :=\n !(a == b)", "start": [ 606, 1 ], "end": [ 614, 12 ], "kind": "commanddeclaration" }, { "full_name": "LawfulBEq", "code": "class LawfulBEq (α : Type u) [BEq α] : Prop where\n \n eq_of_beq : {a b : α} → a == b → a = b\n \n protected rfl : {a : α} → a == a", "start": [ 618, 1 ], "end": [ 627, 35 ], "kind": "commanddeclaration" }, { "full_name": "trivial", "code": "@[inherit_doc True.intro] theorem trivial : True", "start": [ 645, 1 ], "end": [ 645, 55 ], "kind": "commanddeclaration" }, { "full_name": "mt", "code": "theorem mt {a b : Prop} (h₁ : a → b) (h₂ : ¬b) : ¬a", "start": [ 647, 1 ], "end": [ 648, 23 ], "kind": "commanddeclaration" }, { "full_name": "not_false", "code": "theorem not_false : ¬False", "start": [ 650, 1 ], "end": [ 650, 33 ], "kind": "commanddeclaration" }, { "full_name": "not_not_intro", "code": "theorem not_not_intro {p : Prop} (h : p) : ¬ ¬ p", "start": [ 652, 1 ], "end": [ 653, 23 ], "kind": "commanddeclaration" }, { "full_name": "proof_irrel", "code": "theorem proof_irrel {a : Prop} (h₁ h₂ : a) : h₁ = h₂", "start": [ 656, 1 ], "end": [ 656, 60 ], "kind": "commanddeclaration" }, { "full_name": "Eq.mp", "code": "@[macro_inline] def Eq.mp {α β : Sort u} (h : α = β) (a : α) : β :=\n h ▸ a", "start": [ 658, 1 ], "end": [ 666, 8 ], "kind": "commanddeclaration" }, { "full_name": "Eq.mpr", "code": "@[macro_inline] def Eq.mpr {α β : Sort u} (h : α = β) (b : β) : α :=\n h ▸ b", "start": [ 668, 1 ], "end": [ 676, 8 ], "kind": "commanddeclaration" }, { "full_name": "Eq.substr", "code": "@[elab_as_elim]\ntheorem Eq.substr {α : Sort u} {p : α → Prop} {a b : α} (h₁ : b = a) (h₂ : p a) : p b", "start": [ 678, 1 ], "end": [ 680, 10 ], "kind": "commanddeclaration" }, { "full_name": "cast_eq", "code": "@[simp] theorem cast_eq {α : Sort u} (h : α = α) (a : α) : cast h a = a", "start": [ 682, 1 ], "end": [ 683, 6 ], "kind": "commanddeclaration" }, { "full_name": "Ne", "code": "@[reducible] def Ne {α : Sort u} (a b : α) :=\n ¬(a = b)", "start": [ 685, 1 ], "end": [ 690, 11 ], "kind": "commanddeclaration" }, { "full_name": "Ne.intro", "code": "theorem Ne.intro (h : a = b → False) : a ≠ b", "start": [ 698, 1 ], "end": [ 698, 50 ], "kind": "commanddeclaration" }, { "full_name": "Ne.elim", "code": "theorem Ne.elim (h : a ≠ b) : a = b → False", "start": [ 700, 1 ], "end": [ 700, 49 ], "kind": "commanddeclaration" }, { "full_name": "Ne.irrefl", "code": "theorem Ne.irrefl (h : a ≠ a) : False", "start": [ 702, 1 ], "end": [ 702, 47 ], "kind": "commanddeclaration" }, { "full_name": "Ne.symm", "code": "theorem Ne.symm (h : a ≠ b) : b ≠ a", "start": [ 704, 1 ], "end": [ 704, 61 ], "kind": "commanddeclaration" }, { "full_name": "ne_comm", "code": "theorem ne_comm {α} {a b : α} : a ≠ b ↔ b ≠ a", "start": [ 706, 1 ], "end": [ 706, 68 ], "kind": "commanddeclaration" }, { "full_name": "false_of_ne", "code": "theorem false_of_ne : a ≠ a → False", "start": [ 708, 1 ], "end": [ 708, 49 ], "kind": "commanddeclaration" }, { "full_name": "ne_false_of_self", "code": "theorem ne_false_of_self : p → p ≠ False", "start": [ 710, 1 ], "end": [ 711, 41 ], "kind": "commanddeclaration" }, { "full_name": "ne_true_of_not", "code": "theorem ne_true_of_not : ¬p → p ≠ True", "start": [ 713, 1 ], "end": [ 716, 17 ], "kind": "commanddeclaration" }, { "full_name": "true_ne_false", "code": "theorem true_ne_false : ¬True = False", "start": [ 718, 1 ], "end": [ 718, 66 ], "kind": "commanddeclaration" }, { "full_name": "false_ne_true", "code": "theorem false_ne_true : False ≠ True", "start": [ 719, 1 ], "end": [ 719, 66 ], "kind": "commanddeclaration" }, { "full_name": "Bool.of_not_eq_true", "code": "theorem Bool.of_not_eq_true : {b : Bool} → ¬ (b = true) → b = false", "start": [ 723, 1 ], "end": [ 725, 20 ], "kind": "commanddeclaration" }, { "full_name": "Bool.of_not_eq_false", "code": "theorem Bool.of_not_eq_false : {b : Bool} → ¬ (b = false) → b = true", "start": [ 727, 1 ], "end": [ 729, 29 ], "kind": "commanddeclaration" }, { "full_name": "ne_of_beq_false", "code": "theorem ne_of_beq_false [BEq α] [LawfulBEq α] {a b : α} (h : (a == b) = false) : a ≠ b", "start": [ 731, 1 ], "end": [ 732, 90 ], "kind": "commanddeclaration" }, { "full_name": "beq_false_of_ne", "code": "theorem beq_false_of_ne [BEq α] [LawfulBEq α] {a b : α} (h : a ≠ b) : (a == b) = false", "start": [ 734, 1 ], "end": [ 737, 27 ], "kind": "commanddeclaration" }, { "full_name": "HEq.ndrec", "code": "noncomputable def HEq.ndrec.{u1, u2} {α : Sort u2} {a : α} {motive : {β : Sort u2} → β → Sort u1} (m : motive a) {β : Sort u2} {b : β} (h : HEq a b) : motive b :=\n h.rec m", "start": [ 742, 1 ], "end": [ 744, 10 ], "kind": "commanddeclaration" }, { "full_name": "HEq.ndrecOn", "code": "noncomputable def HEq.ndrecOn.{u1, u2} {α : Sort u2} {a : α} {motive : {β : Sort u2} → β → Sort u1} {β : Sort u2} {b : β} (h : HEq a b) (m : motive a) : motive b :=\n h.rec m", "start": [ 746, 1 ], "end": [ 748, 10 ], "kind": "commanddeclaration" }, { "full_name": "HEq.elim", "code": "noncomputable def HEq.elim {α : Sort u} {a : α} {p : α → Sort v} {b : α} (h₁ : HEq a b) (h₂ : p a) : p b :=\n eq_of_heq h₁ ▸ h₂", "start": [ 750, 1 ], "end": [ 752, 20 ], "kind": "commanddeclaration" }, { "full_name": "HEq.subst", "code": "theorem HEq.subst {p : (T : Sort u) → T → Prop} (h₁ : HEq a b) (h₂ : p α a) : p β b", "start": [ 754, 1 ], "end": [ 755, 20 ], "kind": "commanddeclaration" }, { "full_name": "HEq.symm", "code": "theorem HEq.symm (h : HEq a b) : HEq b a", "start": [ 757, 1 ], "end": [ 758, 21 ], "kind": "commanddeclaration" }, { "full_name": "heq_of_eq", "code": "theorem heq_of_eq (h : a = a') : HEq a a'", "start": [ 760, 1 ], "end": [ 761, 26 ], "kind": "commanddeclaration" }, { "full_name": "HEq.trans", "code": "theorem HEq.trans (h₁ : HEq a b) (h₂ : HEq b c) : HEq a c", "start": [ 763, 1 ], "end": [ 764, 18 ], "kind": "commanddeclaration" }, { "full_name": "heq_of_heq_of_eq", "code": "theorem heq_of_heq_of_eq (h₁ : HEq a b) (h₂ : b = b') : HEq a b'", "start": [ 766, 1 ], "end": [ 767, 30 ], "kind": "commanddeclaration" }, { "full_name": "heq_of_eq_of_heq", "code": "theorem heq_of_eq_of_heq (h₁ : a = a') (h₂ : HEq a' b) : HEq a b", "start": [ 769, 1 ], "end": [ 770, 30 ], "kind": "commanddeclaration" }, { "full_name": "type_eq_of_heq", "code": "theorem type_eq_of_heq (h : HEq a b) : α = β", "start": [ 772, 1 ], "end": [ 773, 20 ], "kind": "commanddeclaration" }, { "full_name": "eqRec_heq", "code": "theorem eqRec_heq {α : Sort u} {φ : α → Sort v} {a a' : α} : (h : a = a') → (p : φ a) → HEq (Eq.recOn (motive := fun x _ => φ x) h p) p", "start": [ 777, 1 ], "end": [ 778, 25 ], "kind": "commanddeclaration" }, { "full_name": "heq_of_eqRec_eq", "code": "theorem heq_of_eqRec_eq {α β : Sort u} {a : α} {b : β} (h₁ : α = β) (h₂ : Eq.rec (motive := fun α _ => α) a h₁ = b) : HEq a b", "start": [ 780, 1 ], "end": [ 783, 11 ], "kind": "commanddeclaration" }, { "full_name": "cast_heq", "code": "theorem cast_heq {α β : Sort u} : (h : α = β) → (a : α) → HEq (cast h a) a", "start": [ 785, 1 ], "end": [ 786, 25 ], "kind": "commanddeclaration" }, { "full_name": "iff_iff_implies_and_implies", "code": "theorem iff_iff_implies_and_implies (a b : Prop) : (a ↔ b) ↔ (a → b) ∧ (b → a)", "start": [ 790, 1 ], "end": [ 791, 80 ], "kind": "commanddeclaration" }, { "full_name": "Iff.refl", "code": "theorem Iff.refl (a : Prop) : a ↔ a", "start": [ 793, 1 ], "end": [ 794, 38 ], "kind": "commanddeclaration" }, { "full_name": "Iff.rfl", "code": "protected theorem Iff.rfl {a : Prop} : a ↔ a", "start": [ 796, 1 ], "end": [ 797, 13 ], "kind": "commanddeclaration" }, { "full_name": "Iff.of_eq", "code": "theorem Iff.of_eq (h : a = b) : a ↔ b", "start": [ 801, 1 ], "end": [ 801, 53 ], "kind": "commanddeclaration" }, { "full_name": "Iff.trans", "code": "theorem Iff.trans (h₁ : a ↔ b) (h₂ : b ↔ c) : a ↔ c", "start": [ 803, 1 ], "end": [ 804, 46 ], "kind": "commanddeclaration" }, { "full_name": "Eq.comm", "code": "theorem Eq.comm {a b : α} : a = b ↔ b = a", "start": [ 810, 1 ], "end": [ 810, 71 ], "kind": "commanddeclaration" }, { "full_name": "eq_comm", "code": "theorem eq_comm {a b : α} : a = b ↔ b = a", "start": [ 811, 1 ], "end": [ 811, 53 ], "kind": "commanddeclaration" }, { "full_name": "Iff.symm", "code": "theorem Iff.symm (h : a ↔ b) : b ↔ a", "start": [ 813, 1 ], "end": [ 813, 61 ], "kind": "commanddeclaration" }, { "full_name": "Iff.comm", "code": "theorem Iff.comm: (a ↔ b) ↔ (b ↔ a)", "start": [ 814, 1 ], "end": [ 814, 67 ], "kind": "commanddeclaration" }, { "full_name": "iff_comm", "code": "theorem iff_comm : (a ↔ b) ↔ (b ↔ a)", "start": [ 815, 1 ], "end": [ 815, 49 ], "kind": "commanddeclaration" }, { "full_name": "And.symm", "code": "theorem And.symm : a ∧ b → b ∧ a", "start": [ 817, 1 ], "end": [ 817, 61 ], "kind": "commanddeclaration" }, { "full_name": "And.comm", "code": "theorem And.comm : a ∧ b ↔ b ∧ a", "start": [ 818, 1 ], "end": [ 818, 64 ], "kind": "commanddeclaration" }, { "full_name": "and_comm", "code": "theorem and_comm : a ∧ b ↔ b ∧ a", "start": [ 819, 1 ], "end": [ 819, 45 ], "kind": "commanddeclaration" }, { "full_name": "Or.symm", "code": "theorem Or.symm : a ∨ b → b ∨ a", "start": [ 821, 1 ], "end": [ 821, 50 ], "kind": "commanddeclaration" }, { "full_name": "Or.comm", "code": "theorem Or.comm : a ∨ b ↔ b ∨ a", "start": [ 822, 1 ], "end": [ 822, 61 ], "kind": "commanddeclaration" }, { "full_name": "or_comm", "code": "theorem or_comm : a ∨ b ↔ b ∨ a", "start": [ 823, 1 ], "end": [ 823, 43 ], "kind": "commanddeclaration" }, { "full_name": "Exists.elim", "code": "theorem Exists.elim {α : Sort u} {p : α → Prop} {b : Prop}\n (h₁ : Exists (fun x => p x)) (h₂ : ∀ (a : α), p a → b) : b", "start": [ 827, 1 ], "end": [ 830, 24 ], "kind": "commanddeclaration" }, { "full_name": "decide_true_eq_true", "code": "theorem decide_true_eq_true (h : Decidable True) : @decide True h = true", "start": [ 834, 1 ], "end": [ 837, 36 ], "kind": "commanddeclaration" }, { "full_name": "decide_false_eq_false", "code": "theorem decide_false_eq_false (h : Decidable False) : @decide False h = false", "start": [ 839, 1 ], "end": [ 842, 30 ], "kind": "commanddeclaration" }, { "full_name": "toBoolUsing", "code": "@[inline] def toBoolUsing {p : Prop} (d : Decidable p) : Bool :=\n decide (h := d)", "start": [ 844, 1 ], "end": [ 846, 18 ], "kind": "commanddeclaration" }, { "full_name": "toBoolUsing_eq_true", "code": "theorem toBoolUsing_eq_true {p : Prop} (d : Decidable p) (h : p) : toBoolUsing d = true", "start": [ 848, 1 ], "end": [ 849, 31 ], "kind": "commanddeclaration" }, { "full_name": "ofBoolUsing_eq_true", "code": "theorem ofBoolUsing_eq_true {p : Prop} {d : Decidable p} (h : toBoolUsing d = true) : p", "start": [ 851, 1 ], "end": [ 852, 34 ], "kind": "commanddeclaration" }, { "full_name": "ofBoolUsing_eq_false", "code": "theorem ofBoolUsing_eq_false {p : Prop} {d : Decidable p} (h : toBoolUsing d = false) : ¬ p", "start": [ 854, 1 ], "end": [ 855, 35 ], "kind": "commanddeclaration" }, { "full_name": "Decidable.byCases", "code": "@[macro_inline] def byCases {q : Sort u} [dec : Decidable p] (h1 : p → q) (h2 : ¬p → q) : q :=\n match dec with\n | isTrue h => h1 h\n | isFalse h => h2 h", "start": [ 866, 1 ], "end": [ 874, 22 ], "kind": "commanddeclaration" }, { "full_name": "Decidable.em", "code": "theorem em (p : Prop) [Decidable p] : p ∨ ¬p", "start": [ 876, 1 ], "end": [ 877, 24 ], "kind": "commanddeclaration" }, { "full_name": "Decidable.byContradiction", "code": "theorem byContradiction [dec : Decidable p] (h : ¬p → False) : p", "start": [ 880, 1 ], "end": [ 881, 43 ], "kind": "commanddeclaration" }, { "full_name": "Decidable.of_not_not", "code": "theorem of_not_not [Decidable p] : ¬ ¬ p → p", "start": [ 883, 1 ], "end": [ 884, 55 ], "kind": "commanddeclaration" }, { "full_name": "Decidable.not_and_iff_or_not", "code": "theorem not_and_iff_or_not (p q : Prop) [d₁ : Decidable p] [d₂ : Decidable q] : ¬ (p ∧ q) ↔ ¬ p ∨ ¬ q", "start": [ 886, 1 ], "end": [ 894, 26 ], "kind": "commanddeclaration" }, { "full_name": "decidable_of_decidable_of_iff", "code": "@[inline] def decidable_of_decidable_of_iff [Decidable p] (h : p ↔ q) : Decidable q :=\n if hp : p then\n isTrue (Iff.mp h hp)\n else\n isFalse fun hq => absurd (Iff.mpr h hq) hp", "start": [ 900, 1 ], "end": [ 905, 47 ], "kind": "commanddeclaration" }, { "full_name": "decidable_of_decidable_of_eq", "code": "@[inline] def decidable_of_decidable_of_eq [Decidable p] (h : p = q) : Decidable q :=\n decidable_of_decidable_of_iff (p := p) (h ▸ Iff.rfl)", "start": [ 907, 1 ], "end": [ 909, 55 ], "kind": "commanddeclaration" }, { "full_name": "if_pos", "code": "theorem if_pos {c : Prop} {h : Decidable c} (hc : c) {α : Sort u} {t e : α} : (ite c t e) = t", "start": [ 932, 1 ], "end": [ 935, 33 ], "kind": "commanddeclaration" }, { "full_name": "if_neg", "code": "theorem if_neg {c : Prop} {h : Decidable c} (hnc : ¬c) {α : Sort u} {t e : α} : (ite c t e) = e", "start": [ 937, 1 ], "end": [ 940, 23 ], "kind": "commanddeclaration" }, { "full_name": "iteInduction", "code": "def iteInduction {c} [inst : Decidable c] {motive : α → Sort _} {t e : α}\n (hpos : c → motive t) (hneg : ¬c → motive e) : motive (ite c t e) :=\n match inst with\n | isTrue h => hpos h\n | isFalse h => hneg h", "start": [ 942, 1 ], "end": [ 947, 24 ], "kind": "commanddeclaration" }, { "full_name": "dif_pos", "code": "theorem dif_pos {c : Prop} {h : Decidable c} (hc : c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = t hc", "start": [ 949, 1 ], "end": [ 952, 33 ], "kind": "commanddeclaration" }, { "full_name": "dif_neg", "code": "theorem dif_neg {c : Prop} {h : Decidable c} (hnc : ¬c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = e hnc", "start": [ 954, 1 ], "end": [ 957, 23 ], "kind": "commanddeclaration" }, { "full_name": "dif_eq_if", "code": "theorem dif_eq_if (c : Prop) {h : Decidable c} {α : Sort u} (t : α) (e : α) : dite c (fun _ => t) (fun _ => e) = ite c t e", "start": [ 960, 1 ], "end": [ 963, 23 ], "kind": "commanddeclaration" }, { "full_name": "noConfusionTypeEnum", "code": "abbrev noConfusionTypeEnum {α : Sort u} {β : Sort v} [inst : DecidableEq β] (f : α → β) (P : Sort w) (x y : α) : Sort w :=\n (inst (f x) (f y)).casesOn\n (fun _ => P)\n (fun _ => P → P)", "start": [ 975, 1 ], "end": [ 979, 21 ], "kind": "commanddeclaration" }, { "full_name": "noConfusionEnum", "code": "abbrev noConfusionEnum {α : Sort u} {β : Sort v} [inst : DecidableEq β] (f : α → β) {P : Sort w} {x y : α} (h : x = y) : noConfusionTypeEnum f P x y :=\n Decidable.casesOn\n (motive := fun (inst : Decidable (f x = f y)) => Decidable.casesOn (motive := fun _ => Sort w) inst (fun _ => P) (fun _ => P → P))\n (inst (f x) (f y))\n (fun h' => False.elim (h' (congrArg f h)))\n (fun _ => fun x => x)", "start": [ 981, 1 ], "end": [ 987, 26 ], "kind": "commanddeclaration" }, { "full_name": "nonempty_of_exists", "code": "theorem nonempty_of_exists {α : Sort u} {p : α → Prop} : Exists (fun x => p x) → Nonempty α", "start": [ 996, 1 ], "end": [ 997, 18 ], "kind": "commanddeclaration" }, { "full_name": "Subsingleton", "code": "class Subsingleton (α : Sort u) : Prop where\n \n intro ::\n \n allEq : (a b : α) → a = b", "start": [ 1001, 1 ], "end": [ 1013, 28 ], "kind": "commanddeclaration" }, { "full_name": "Subsingleton.elim", "code": "protected theorem Subsingleton.elim {α : Sort u} [h : Subsingleton α] : (a b : α) → a = b", "start": [ 1015, 1 ], "end": [ 1016, 10 ], "kind": "commanddeclaration" }, { "full_name": "Subsingleton.helim", "code": "protected theorem Subsingleton.helim {α β : Sort u} [h₁ : Subsingleton α] (h₂ : α = β) (a : α) (b : β) : HEq a b", "start": [ 1018, 1 ], "end": [ 1021, 26 ], "kind": "commanddeclaration" }, { "full_name": "recSubsingleton", "code": "theorem recSubsingleton\n {p : Prop} [h : Decidable p]\n {h₁ : p → Sort u}\n {h₂ : ¬p → Sort u}\n [h₃ : ∀ (h : p), Subsingleton (h₁ h)]\n [h₄ : ∀ (h : ¬p), Subsingleton (h₂ h)]\n : Subsingleton (h.casesOn h₂ h₁)", "start": [ 1043, 1 ], "end": [ 1052, 22 ], "kind": "commanddeclaration" }, { "full_name": "Equivalence", "code": "structure Equivalence {α : Sort u} (r : α → α → Prop) : Prop where\n \n refl : ∀ x, r x x\n \n symm : ∀ {x y}, r x y → r y x\n \n trans : ∀ {x y z}, r x y → r y z → r x z", "start": [ 1054, 1 ], "end": [ 1071, 43 ], "kind": "commanddeclaration" }, { "full_name": "emptyRelation", "code": "def emptyRelation {α : Sort u} (_ _ : α) : Prop :=\n False", "start": [ 1073, 1 ], "end": [ 1075, 8 ], "kind": "commanddeclaration" }, { "full_name": "Subrelation", "code": "def Subrelation {α : Sort u} (q r : α → α → Prop) :=\n ∀ {x y}, q x y → r x y", "start": [ 1077, 1 ], "end": [ 1082, 25 ], "kind": "commanddeclaration" }, { "full_name": "InvImage", "code": "def InvImage {α : Sort u} {β : Sort v} (r : β → β → Prop) (f : α → β) : α → α → Prop :=\n fun a₁ a₂ => r (f a₁) (f a₂)", "start": [ 1084, 1 ], "end": [ 1089, 31 ], "kind": "commanddeclaration" }, { "full_name": "TC", "code": "inductive TC {α : Sort u} (r : α → α → Prop) : α → α → Prop where\n \n | base : ∀ a b, r a b → TC r a b\n \n | trans : ∀ a b c, TC r a b → TC r b c → TC r a c", "start": [ 1091, 1 ], "end": [ 1100, 52 ], "kind": "commanddeclaration" }, { "full_name": "Subtype.existsOfSubtype", "code": "theorem existsOfSubtype {α : Type u} {p : α → Prop} : { x // p x } → Exists (fun x => p x)", "start": [ 1105, 1 ], "end": [ 1106, 21 ], "kind": "commanddeclaration" }, { "full_name": "Subtype.eq", "code": "protected theorem eq : ∀ {a1 a2 : {x // p x}}, val a1 = val a2 → a1 = a2", "start": [ 1110, 1 ], "end": [ 1111, 31 ], "kind": "commanddeclaration" }, { "full_name": "Subtype.eta", "code": "theorem eta (a : {x // p x}) (h : p (val a)) : mk (val a) h = a", "start": [ 1113, 1 ], "end": [ 1115, 12 ], "kind": "commanddeclaration" }, { "full_name": "Sum.inhabitedLeft", "code": "instance Sum.inhabitedLeft [Inhabited α] : Inhabited (Sum α β) where\n default := Sum.inl default", "start": [ 1129, 1 ], "end": [ 1130, 29 ], "kind": "commanddeclaration" }, { "full_name": "Sum.inhabitedRight", "code": "instance Sum.inhabitedRight [Inhabited β] : Inhabited (Sum α β) where\n default := Sum.inr default", "start": [ 1132, 1 ], "end": [ 1133, 29 ], "kind": "commanddeclaration" }, { "full_name": "Prod.lexLt", "code": "def Prod.lexLt [LT α] [LT β] (s : α × β) (t : α × β) : Prop :=\n s.1 < t.1 ∨ (s.1 = t.1 ∧ s.2 < t.2)", "start": [ 1171, 1 ], "end": [ 1173, 38 ], "kind": "commanddeclaration" }, { "full_name": "Prod.lexLtDec", "code": "instance Prod.lexLtDec\n [LT α] [LT β] [DecidableEq α]\n [(a b : α) → Decidable (a < b)] [(a b : β) → Decidable (a < b)]\n : (s t : α × β) → Decidable (Prod.lexLt s t) :=\n fun _ _ => inferInstanceAs (Decidable (_ ∨ _))", "start": [ 1175, 1 ], "end": [ 1179, 49 ], "kind": "commanddeclaration" }, { "full_name": "Prod.lexLt_def", "code": "theorem Prod.lexLt_def [LT α] [LT β] (s t : α × β) : (Prod.lexLt s t) = (s.1 < t.1 ∨ (s.1 = t.1 ∧ s.2 < t.2))", "start": [ 1181, 1 ], "end": [ 1182, 6 ], "kind": "commanddeclaration" }, { "full_name": "Prod.eta", "code": "theorem Prod.eta (p : α × β) : (p.1, p.2) = p", "start": [ 1184, 1 ], "end": [ 1184, 53 ], "kind": "commanddeclaration" }, { "full_name": "Prod.map", "code": "def Prod.map {α₁ : Type u₁} {α₂ : Type u₂} {β₁ : Type v₁} {β₂ : Type v₂}\n (f : α₁ → α₂) (g : β₁ → β₂) : α₁ × β₁ → α₂ × β₂\n | (a, b) => (f a, g b)", "start": [ 1186, 1 ], "end": [ 1192, 25 ], "kind": "commanddeclaration" }, { "full_name": "Prod.map_apply", "code": "@[simp] theorem Prod.map_apply (f : α → β) (g : γ → δ) (x) (y) :\n Prod.map f g (x, y) = (f x, g y)", "start": [ 1194, 1 ], "end": [ 1195, 44 ], "kind": "commanddeclaration" }, { "full_name": "Prod.map_fst", "code": "@[simp] theorem Prod.map_fst (f : α → β) (g : γ → δ) (x) : (Prod.map f g x).1 = f x.1", "start": [ 1196, 1 ], "end": [ 1196, 93 ], "kind": "commanddeclaration" }, { "full_name": "Prod.map_snd", "code": "@[simp] theorem Prod.map_snd (f : α → β) (g : γ → δ) (x) : (Prod.map f g x).2 = g x.2", "start": [ 1197, 1 ], "end": [ 1197, 93 ], "kind": "commanddeclaration" }, { "full_name": "ex_of_PSigma", "code": "theorem ex_of_PSigma {α : Type u} {p : α → Prop} : (PSigma (fun x => p x)) → Exists (fun x => p x)", "start": [ 1201, 1 ], "end": [ 1202, 23 ], "kind": "commanddeclaration" }, { "full_name": "PSigma.eta", "code": "protected theorem PSigma.eta {α : Sort u} {β : α → Sort v} {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂}\n (h₁ : a₁ = a₂) (h₂ : Eq.ndrec b₁ h₁ = b₂) : PSigma.mk a₁ b₁ = PSigma.mk a₂ b₂", "start": [ 1204, 1 ], "end": [ 1208, 12 ], "kind": "commanddeclaration" }, { "full_name": "PUnit.subsingleton", "code": "theorem PUnit.subsingleton (a b : PUnit) : a = b", "start": [ 1212, 1 ], "end": [ 1213, 30 ], "kind": "commanddeclaration" }, { "full_name": "PUnit.eq_punit", "code": "theorem PUnit.eq_punit (a : PUnit) : a = ⟨⟩", "start": [ 1215, 1 ], "end": [ 1216, 26 ], "kind": "commanddeclaration" }, { "full_name": "Setoid", "code": "class Setoid (α : Sort u) where\n \n r : α → α → Prop\n \n iseqv : Equivalence r", "start": [ 1229, 1 ], "end": [ 1237, 24 ], "kind": "commanddeclaration" }, { "full_name": "Setoid.refl", "code": "theorem refl (a : α) : a ≈ a", "start": [ 1246, 1 ], "end": [ 1247, 15 ], "kind": "commanddeclaration" }, { "full_name": "Setoid.symm", "code": "theorem symm {a b : α} (hab : a ≈ b) : b ≈ a", "start": [ 1249, 1 ], "end": [ 1250, 17 ], "kind": "commanddeclaration" }, { "full_name": "Setoid.trans", "code": "theorem trans {a b c : α} (hab : a ≈ b) (hbc : b ≈ c) : a ≈ c", "start": [ 1252, 1 ], "end": [ 1253, 22 ], "kind": "commanddeclaration" }, { "full_name": "propext", "code": "axiom propext {a b : Prop} : (a ↔ b) → a = b", "start": [ 1260, 1 ], "end": [ 1294, 45 ], "kind": "commanddeclaration" }, { "full_name": "Eq.propIntro", "code": "theorem Eq.propIntro {a b : Prop} (h₁ : a → b) (h₂ : b → a) : a = b", "start": [ 1296, 1 ], "end": [ 1297, 29 ], "kind": "commanddeclaration" }, { "full_name": "Nat.succ.inj", "code": "theorem Nat.succ.inj {m n : Nat} : m.succ = n.succ → m = n", "start": [ 1320, 1 ], "end": [ 1321, 32 ], "kind": "commanddeclaration" }, { "full_name": "Nat.succ.injEq", "code": "theorem Nat.succ.injEq (u v : Nat) : (u.succ = v.succ) = (u = v)", "start": [ 1323, 1 ], "end": [ 1324, 48 ], "kind": "commanddeclaration" }, { "full_name": "beq_iff_eq", "code": "@[simp] theorem beq_iff_eq [BEq α] [LawfulBEq α] (a b : α) : a == b ↔ a = b", "start": [ 1326, 1 ], "end": [ 1327, 56 ], "kind": "commanddeclaration" }, { "full_name": "Not.elim", "code": "def Not.elim {α : Sort _} (H1 : ¬a) (H2 : a) : α := absurd H2 H1", "start": [ 1331, 1 ], "end": [ 1333, 65 ], "kind": "commanddeclaration" }, { "full_name": "And.elim", "code": "abbrev And.elim (f : a → b → α) (h : a ∧ b) : α := f h.left h.right", "start": [ 1335, 1 ], "end": [ 1336, 68 ], "kind": "commanddeclaration" }, { "full_name": "Iff.elim", "code": "def Iff.elim (f : (a → b) → (b → a) → α) (h : a ↔ b) : α := f h.mp h.mpr", "start": [ 1338, 1 ], "end": [ 1339, 73 ], "kind": "commanddeclaration" }, { "full_name": "Iff.subst", "code": "theorem Iff.subst {a b : Prop} {p : Prop → Prop} (h₁ : a ↔ b) (h₂ : p a) : p b", "start": [ 1341, 1 ], "end": [ 1343, 27 ], "kind": "commanddeclaration" }, { "full_name": "Not.intro", "code": "theorem Not.intro {a : Prop} (h : a → False) : ¬a", "start": [ 1345, 1 ], "end": [ 1345, 55 ], "kind": "commanddeclaration" }, { "full_name": "Not.imp", "code": "theorem Not.imp {a b : Prop} (H2 : ¬b) (H1 : a → b) : ¬a", "start": [ 1347, 1 ], "end": [ 1347, 69 ], "kind": "commanddeclaration" }, { "full_name": "not_congr", "code": "theorem not_congr (h : a ↔ b) : ¬a ↔ ¬b", "start": [ 1349, 1 ], "end": [ 1349, 60 ], "kind": "commanddeclaration" }, { "full_name": "not_not_not", "code": "theorem not_not_not : ¬¬¬a ↔ ¬a", "start": [ 1351, 1 ], "end": [ 1351, 69 ], "kind": "commanddeclaration" }, { "full_name": "iff_of_true", "code": "theorem iff_of_true (ha : a) (hb : b) : a ↔ b", "start": [ 1353, 1 ], "end": [ 1353, 87 ], "kind": "commanddeclaration" }, { "full_name": "iff_of_false", "code": "theorem iff_of_false (ha : ¬a) (hb : ¬b) : a ↔ b", "start": [ 1354, 1 ], "end": [ 1354, 78 ], "kind": "commanddeclaration" }, { "full_name": "iff_true_left", "code": "theorem iff_true_left (ha : a) : (a ↔ b) ↔ b", "start": [ 1356, 1 ], "end": [ 1356, 86 ], "kind": "commanddeclaration" }, { "full_name": "iff_true_right", "code": "theorem iff_true_right (ha : a) : (b ↔ a) ↔ b", "start": [ 1357, 1 ], "end": [ 1357, 83 ], "kind": "commanddeclaration" }, { "full_name": "iff_false_left", "code": "theorem iff_false_left (ha : ¬a) : (a ↔ b) ↔ ¬b", "start": [ 1359, 1 ], "end": [ 1359, 94 ], "kind": "commanddeclaration" }, { "full_name": "iff_false_right", "code": "theorem iff_false_right (ha : ¬a) : (b ↔ a) ↔ ¬b", "start": [ 1360, 1 ], "end": [ 1360, 87 ], "kind": "commanddeclaration" }, { "full_name": "of_iff_true", "code": "theorem of_iff_true (h : a ↔ True) : a", "start": [ 1362, 1 ], "end": [ 1362, 59 ], "kind": "commanddeclaration" }, { "full_name": "iff_true_intro", "code": "theorem iff_true_intro (h : a) : a ↔ True", "start": [ 1363, 1 ], "end": [ 1363, 67 ], "kind": "commanddeclaration" }, { "full_name": "not_of_iff_false", "code": "theorem not_of_iff_false : (p ↔ False) → ¬p", "start": [ 1365, 1 ], "end": [ 1365, 54 ], "kind": "commanddeclaration" }, { "full_name": "iff_false_intro", "code": "theorem iff_false_intro (h : ¬a) : a ↔ False", "start": [ 1366, 1 ], "end": [ 1366, 66 ], "kind": "commanddeclaration" }, { "full_name": "not_iff_false_intro", "code": "theorem not_iff_false_intro (h : a) : ¬a ↔ False", "start": [ 1368, 1 ], "end": [ 1368, 86 ], "kind": "commanddeclaration" }, { "full_name": "not_true", "code": "theorem not_true : (¬True) ↔ False", "start": [ 1369, 1 ], "end": [ 1369, 78 ], "kind": "commanddeclaration" }, { "full_name": "not_false_iff", "code": "theorem not_false_iff : (¬False) ↔ True", "start": [ 1371, 1 ], "end": [ 1371, 68 ], "kind": "commanddeclaration" }, { "full_name": "Eq.to_iff", "code": "theorem Eq.to_iff : a = b → (a ↔ b)", "start": [ 1373, 1 ], "end": [ 1373, 49 ], "kind": "commanddeclaration" }, { "full_name": "iff_of_eq", "code": "theorem iff_of_eq : a = b → (a ↔ b)", "start": [ 1374, 1 ], "end": [ 1374, 49 ], "kind": "commanddeclaration" }, { "full_name": "neq_of_not_iff", "code": "theorem neq_of_not_iff : ¬(a ↔ b) → a ≠ b", "start": [ 1375, 1 ], "end": [ 1375, 58 ], "kind": "commanddeclaration" }, { "full_name": "iff_iff_eq", "code": "theorem iff_iff_eq : (a ↔ b) ↔ a = b", "start": [ 1377, 1 ], "end": [ 1377, 68 ], "kind": "commanddeclaration" }, { "full_name": "eq_iff_iff", "code": "@[simp] theorem eq_iff_iff : (a = b) ↔ (a ↔ b)", "start": [ 1378, 1 ], "end": [ 1378, 66 ], "kind": "commanddeclaration" }, { "full_name": "eq_self_iff_true", "code": "theorem eq_self_iff_true (a : α) : a = a ↔ True", "start": [ 1380, 1 ], "end": [ 1380, 72 ], "kind": "commanddeclaration" }, { "full_name": "ne_self_iff_false", "code": "theorem ne_self_iff_false (a : α) : a ≠ a ↔ False", "start": [ 1381, 1 ], "end": [ 1381, 77 ], "kind": "commanddeclaration" }, { "full_name": "false_of_true_iff_false", "code": "theorem false_of_true_iff_false (h : True ↔ False) : False", "start": [ 1383, 1 ], "end": [ 1383, 75 ], "kind": "commanddeclaration" }, { "full_name": "false_of_true_eq_false", "code": "theorem false_of_true_eq_false (h : True = False) : False", "start": [ 1384, 1 ], "end": [ 1384, 100 ], "kind": "commanddeclaration" }, { "full_name": "true_eq_false_of_false", "code": "theorem true_eq_false_of_false : False → (True = False)", "start": [ 1386, 1 ], "end": [ 1386, 70 ], "kind": "commanddeclaration" }, { "full_name": "iff_def", "code": "theorem iff_def : (a ↔ b) ↔ (a → b) ∧ (b → a)", "start": [ 1388, 1 ], "end": [ 1388, 82 ], "kind": "commanddeclaration" }, { "full_name": "iff_def'", "code": "theorem iff_def' : (a ↔ b) ↔ (b → a) ∧ (a → b)", "start": [ 1389, 1 ], "end": [ 1389, 77 ], "kind": "commanddeclaration" }, { "full_name": "true_iff_false", "code": "theorem true_iff_false : (True ↔ False) ↔ False", "start": [ 1391, 1 ], "end": [ 1391, 86 ], "kind": "commanddeclaration" }, { "full_name": "false_iff_true", "code": "theorem false_iff_true : (False ↔ True) ↔ False", "start": [ 1392, 1 ], "end": [ 1392, 86 ], "kind": "commanddeclaration" }, { "full_name": "iff_not_self", "code": "theorem iff_not_self : ¬(a ↔ ¬a)", "start": [ 1394, 1 ], "end": [ 1394, 70 ], "kind": "commanddeclaration" }, { "full_name": "heq_self_iff_true", "code": "theorem heq_self_iff_true (a : α) : HEq a a ↔ True", "start": [ 1395, 1 ], "end": [ 1395, 77 ], "kind": "commanddeclaration" }, { "full_name": "not_not_of_not_imp", "code": "theorem not_not_of_not_imp : ¬(a → b) → ¬¬a", "start": [ 1399, 1 ], "end": [ 1399, 59 ], "kind": "commanddeclaration" }, { "full_name": "not_of_not_imp", "code": "theorem not_of_not_imp {a : Prop} : ¬(a → b) → ¬b", "start": [ 1401, 1 ], "end": [ 1401, 69 ], "kind": "commanddeclaration" }, { "full_name": "imp_not_self", "code": "@[simp] theorem imp_not_self : (a → ¬a) ↔ ¬a", "start": [ 1403, 1 ], "end": [ 1403, 95 ], "kind": "commanddeclaration" }, { "full_name": "imp_intro", "code": "theorem imp_intro {α β : Prop} (h : α) : β → α", "start": [ 1405, 1 ], "end": [ 1405, 61 ], "kind": "commanddeclaration" }, { "full_name": "imp_imp_imp", "code": "theorem imp_imp_imp {a b c d : Prop} (h₀ : c → a) (h₁ : b → d) : (a → b) → (c → d)", "start": [ 1407, 1 ], "end": [ 1407, 100 ], "kind": "commanddeclaration" }, { "full_name": "imp_iff_right", "code": "theorem imp_iff_right {a : Prop} (ha : a) : (a → b) ↔ b", "start": [ 1409, 1 ], "end": [ 1409, 91 ], "kind": "commanddeclaration" }, { "full_name": "imp_true_iff", "code": "theorem imp_true_iff (α : Sort u) : (α → True) ↔ True", "start": [ 1412, 1 ], "end": [ 1412, 91 ], "kind": "commanddeclaration" }, { "full_name": "false_imp_iff", "code": "theorem false_imp_iff (a : Prop) : (False → a) ↔ True", "start": [ 1414, 1 ], "end": [ 1414, 83 ], "kind": "commanddeclaration" }, { "full_name": "true_imp_iff", "code": "theorem true_imp_iff (α : Prop) : (True → α) ↔ α", "start": [ 1416, 1 ], "end": [ 1416, 77 ], "kind": "commanddeclaration" }, { "full_name": "imp_self", "code": "@[simp high] theorem imp_self : (a → a) ↔ True", "start": [ 1418, 1 ], "end": [ 1418, 68 ], "kind": "commanddeclaration" }, { "full_name": "imp_false", "code": "@[simp] theorem imp_false : (a → False) ↔ ¬a", "start": [ 1420, 1 ], "end": [ 1420, 56 ], "kind": "commanddeclaration" }, { "full_name": "imp.swap", "code": "theorem imp.swap : (a → b → c) ↔ (b → a → c)", "start": [ 1422, 1 ], "end": [ 1422, 68 ], "kind": "commanddeclaration" }, { "full_name": "imp_not_comm", "code": "theorem imp_not_comm : (a → ¬b) ↔ (b → ¬a)", "start": [ 1424, 1 ], "end": [ 1424, 55 ], "kind": "commanddeclaration" }, { "full_name": "imp_congr_left", "code": "theorem imp_congr_left (h : a ↔ b) : (a → c) ↔ (b → c)", "start": [ 1426, 1 ], "end": [ 1426, 91 ], "kind": "commanddeclaration" }, { "full_name": "imp_congr_right", "code": "theorem imp_congr_right (h : a → (b ↔ c)) : (a → b) ↔ (a → c)", "start": [ 1428, 1 ], "end": [ 1429, 83 ], "kind": "commanddeclaration" }, { "full_name": "imp_congr_ctx", "code": "theorem imp_congr_ctx (h₁ : a ↔ c) (h₂ : c → (b ↔ d)) : (a → b) ↔ (c → d)", "start": [ 1431, 1 ], "end": [ 1432, 53 ], "kind": "commanddeclaration" }, { "full_name": "imp_congr", "code": "theorem imp_congr (h₁ : a ↔ c) (h₂ : b ↔ d) : (a → b) ↔ (c → d)", "start": [ 1434, 1 ], "end": [ 1434, 96 ], "kind": "commanddeclaration" }, { "full_name": "imp_iff_not", "code": "theorem imp_iff_not (hb : ¬b) : a → b ↔ ¬a", "start": [ 1436, 1 ], "end": [ 1436, 90 ], "kind": "commanddeclaration" }, { "full_name": "Quot.sound", "code": "axiom sound : ∀ {α : Sort u} {r : α → α → Prop} {a b : α}, r a b → Quot.mk r a = Quot.mk r b", "start": [ 1441, 1 ], "end": [ 1471, 93 ], "kind": "commanddeclaration" }, { "full_name": "Quot.liftBeta", "code": "protected theorem liftBeta {α : Sort u} {r : α → α → Prop} {β : Sort v}\n (f : α → β)\n (c : (a b : α) → r a b → f a = f b)\n (a : α)\n : lift f c (Quot.mk r a) = f a", "start": [ 1473, 1 ], "end": [ 1478, 6 ], "kind": "commanddeclaration" }, { "full_name": "Quot.indBeta", "code": "protected theorem indBeta {α : Sort u} {r : α → α → Prop} {motive : Quot r → Prop}\n (p : (a : α) → motive (Quot.mk r a))\n (a : α)\n : (ind p (Quot.mk r a) : motive (Quot.mk r a)) = p a", "start": [ 1480, 1 ], "end": [ 1484, 6 ], "kind": "commanddeclaration" }, { "full_name": "Quot.liftOn", "code": "protected abbrev liftOn {α : Sort u} {β : Sort v} {r : α → α → Prop}\n (q : Quot r) (f : α → β) (c : (a b : α) → r a b → f a = f b) : β :=\n lift f c q", "start": [ 1486, 1 ], "end": [ 1492, 13 ], "kind": "commanddeclaration" }, { "full_name": "Quot.inductionOn", "code": "@[elab_as_elim]\nprotected theorem inductionOn {α : Sort u} {r : α → α → Prop} {motive : Quot r → Prop}\n (q : Quot r)\n (h : (a : α) → motive (Quot.mk r a))\n : motive q", "start": [ 1494, 1 ], "end": [ 1499, 10 ], "kind": "commanddeclaration" }, { "full_name": "Quot.exists_rep", "code": "theorem exists_rep {α : Sort u} {r : α → α → Prop} (q : Quot r) : Exists (fun a => (Quot.mk r a) = q)", "start": [ 1501, 1 ], "end": [ 1502, 36 ], "kind": "commanddeclaration" }, { "full_name": "Quot.indep", "code": "@[reducible, macro_inline]\nprotected def indep (f : (a : α) → motive (Quot.mk r a)) (a : α) : PSigma motive :=\n ⟨Quot.mk r a, f a⟩", "start": [ 1509, 1 ], "end": [ 1512, 21 ], "kind": "commanddeclaration" }, { "full_name": "Quot.indepCoherent", "code": "protected theorem indepCoherent\n (f : (a : α) → motive (Quot.mk r a))\n (h : (a b : α) → (p : r a b) → Eq.ndrec (f a) (sound p) = f b)\n : (a b : α) → r a b → Quot.indep f a = Quot.indep f b", "start": [ 1514, 1 ], "end": [ 1518, 46 ], "kind": "commanddeclaration" }, { "full_name": "Quot.liftIndepPr1", "code": "protected theorem liftIndepPr1\n (f : (a : α) → motive (Quot.mk r a))\n (h : ∀ (a b : α) (p : r a b), Eq.ndrec (f a) (sound p) = f b)\n (q : Quot r)\n : (lift (Quot.indep f) (Quot.indepCoherent f h) q).1 = q", "start": [ 1520, 1 ], "end": [ 1526, 11 ], "kind": "commanddeclaration" }, { "full_name": "Quot.rec", "code": "protected abbrev rec\n (f : (a : α) → motive (Quot.mk r a))\n (h : (a b : α) → (p : r a b) → Eq.ndrec (f a) (sound p) = f b)\n (q : Quot r) : motive q :=\n Eq.ndrecOn (Quot.liftIndepPr1 f h q) ((lift (Quot.indep f) (Quot.indepCoherent f h) q).2)", "start": [ 1528, 1 ], "end": [ 1540, 92 ], "kind": "commanddeclaration" }, { "full_name": "Quot.recOn", "code": "@[inherit_doc Quot.rec] protected abbrev recOn\n (q : Quot r)\n (f : (a : α) → motive (Quot.mk r a))\n (h : (a b : α) → (p : r a b) → Eq.ndrec (f a) (sound p) = f b)\n : motive q :=\n q.rec f h", "start": [ 1542, 1 ], "end": [ 1547, 11 ], "kind": "commanddeclaration" }, { "full_name": "Quot.recOnSubsingleton", "code": "protected abbrev recOnSubsingleton\n [h : (a : α) → Subsingleton (motive (Quot.mk r a))]\n (q : Quot r)\n (f : (a : α) → motive (Quot.mk r a))\n : motive q := by\n induction q using Quot.rec\n apply f\n apply Subsingleton.elim", "start": [ 1549, 1 ], "end": [ 1560, 26 ], "kind": "commanddeclaration" }, { "full_name": "Quot.hrecOn", "code": "protected abbrev hrecOn\n (q : Quot r)\n (f : (a : α) → motive (Quot.mk r a))\n (c : (a b : α) → (p : r a b) → HEq (f a) (f b))\n : motive q :=\n Quot.recOn q f fun a b p => eq_of_heq <|\n have p₁ : HEq (Eq.ndrec (f a) (sound p)) (f a) := eqRec_heq (sound p) (f a)\n HEq.trans p₁ (c a b p)", "start": [ 1562, 1 ], "end": [ 1574, 27 ], "kind": "commanddeclaration" }, { "full_name": "Quotient", "code": "def Quotient {α : Sort u} (s : Setoid α) :=\n @Quot α Setoid.r", "start": [ 1580, 1 ], "end": [ 1586, 19 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.mk", "code": "@[inline]\nprotected def mk {α : Sort u} (s : Setoid α) (a : α) : Quotient s :=\n Quot.mk Setoid.r a", "start": [ 1590, 1 ], "end": [ 1593, 21 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.mk'", "code": "protected def mk' {α : Sort u} [s : Setoid α] (a : α) : Quotient s :=\n Quotient.mk s a", "start": [ 1595, 1 ], "end": [ 1600, 18 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.sound", "code": "theorem sound {α : Sort u} {s : Setoid α} {a b : α} : a ≈ b → Quotient.mk s a = Quotient.mk s b", "start": [ 1602, 1 ], "end": [ 1607, 13 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.lift", "code": "protected abbrev lift {α : Sort u} {β : Sort v} {s : Setoid α} (f : α → β) : ((a b : α) → a ≈ b → f a = f b) → Quotient s → β :=\n Quot.lift f", "start": [ 1609, 1 ], "end": [ 1614, 14 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.ind", "code": "protected theorem ind {α : Sort u} {s : Setoid α} {motive : Quotient s → Prop} : ((a : α) → motive (Quotient.mk s a)) → (q : Quotient s) → motive q", "start": [ 1616, 1 ], "end": [ 1618, 11 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.liftOn", "code": "protected abbrev liftOn {α : Sort u} {β : Sort v} {s : Setoid α} (q : Quotient s) (f : α → β) (c : (a b : α) → a ≈ b → f a = f b) : β :=\n Quot.liftOn q f c", "start": [ 1620, 1 ], "end": [ 1625, 20 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.inductionOn", "code": "@[elab_as_elim]\nprotected theorem inductionOn {α : Sort u} {s : Setoid α} {motive : Quotient s → Prop}\n (q : Quotient s)\n (h : (a : α) → motive (Quotient.mk s a))\n : motive q", "start": [ 1627, 1 ], "end": [ 1633, 23 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.exists_rep", "code": "theorem exists_rep {α : Sort u} {s : Setoid α} (q : Quotient s) : Exists (fun (a : α) => Quotient.mk s a = q)", "start": [ 1635, 1 ], "end": [ 1636, 20 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.rec", "code": "@[inline, elab_as_elim]\nprotected def rec\n (f : (a : α) → motive (Quotient.mk s a))\n (h : (a b : α) → (p : a ≈ b) → Eq.ndrec (f a) (Quotient.sound p) = f b)\n (q : Quotient s)\n : motive q :=\n Quot.rec f h q", "start": [ 1643, 1 ], "end": [ 1650, 17 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.recOn", "code": "@[elab_as_elim]\nprotected abbrev recOn\n (q : Quotient s)\n (f : (a : α) → motive (Quotient.mk s a))\n (h : (a b : α) → (p : a ≈ b) → Eq.ndrec (f a) (Quotient.sound p) = f b)\n : motive q :=\n Quot.recOn q f h", "start": [ 1652, 1 ], "end": [ 1659, 19 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.recOnSubsingleton", "code": "@[elab_as_elim]\nprotected abbrev recOnSubsingleton\n [h : (a : α) → Subsingleton (motive (Quotient.mk s a))]\n (q : Quotient s)\n (f : (a : α) → motive (Quotient.mk s a))\n : motive q :=\n Quot.recOnSubsingleton (h := h) q f", "start": [ 1661, 1 ], "end": [ 1668, 38 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.hrecOn", "code": "@[elab_as_elim]\nprotected abbrev hrecOn\n (q : Quotient s)\n (f : (a : α) → motive (Quotient.mk s a))\n (c : (a b : α) → (p : a ≈ b) → HEq (f a) (f b))\n : motive q :=\n Quot.hrecOn q f c", "start": [ 1670, 1 ], "end": [ 1677, 20 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.lift₂", "code": "protected abbrev lift₂\n (f : α → β → φ)\n (c : (a₁ : α) → (b₁ : β) → (a₂ : α) → (b₂ : β) → a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂)\n (q₁ : Quotient s₁) (q₂ : Quotient s₂)\n : φ := by\n apply Quotient.lift (fun (a₁ : α) => Quotient.lift (f a₁) (fun (a b : β) => c a₁ a a₁ b (Setoid.refl a₁)) q₂) _ q₁\n intros\n induction q₂ using Quotient.ind\n apply c; assumption; apply Setoid.refl", "start": [ 1685, 1 ], "end": [ 1694, 41 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.liftOn₂", "code": "protected abbrev liftOn₂\n (q₁ : Quotient s₁)\n (q₂ : Quotient s₂)\n (f : α → β → φ)\n (c : (a₁ : α) → (b₁ : β) → (a₂ : α) → (b₂ : β) → a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂)\n : φ :=\n Quotient.lift₂ f c q₁ q₂", "start": [ 1696, 1 ], "end": [ 1703, 27 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.ind₂", "code": "@[elab_as_elim]\nprotected theorem ind₂\n {motive : Quotient s₁ → Quotient s₂ → Prop}\n (h : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))\n (q₁ : Quotient s₁)\n (q₂ : Quotient s₂)\n : motive q₁ q₂", "start": [ 1705, 1 ], "end": [ 1714, 10 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.inductionOn₂", "code": "@[elab_as_elim]\nprotected theorem inductionOn₂\n {motive : Quotient s₁ → Quotient s₂ → Prop}\n (q₁ : Quotient s₁)\n (q₂ : Quotient s₂)\n (h : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))\n : motive q₁ q₂", "start": [ 1716, 1 ], "end": [ 1725, 10 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.inductionOn₃", "code": "@[elab_as_elim]\nprotected theorem inductionOn₃\n {s₃ : Setoid φ}\n {motive : Quotient s₁ → Quotient s₂ → Quotient s₃ → Prop}\n (q₁ : Quotient s₁)\n (q₂ : Quotient s₂)\n (q₃ : Quotient s₃)\n (h : (a : α) → (b : β) → (c : φ) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b) (Quotient.mk s₃ c))\n : motive q₁ q₂ q₃", "start": [ 1727, 1 ], "end": [ 1739, 10 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.rel", "code": "private def rel {s : Setoid α} (q₁ q₂ : Quotient s) : Prop :=\n Quotient.liftOn₂ q₁ q₂\n (fun a₁ a₂ => a₁ ≈ a₂)\n (fun _ _ _ _ a₁b₁ a₂b₂ =>\n propext (Iff.intro\n (fun a₁a₂ => Setoid.trans (Setoid.symm a₁b₁) (Setoid.trans a₁a₂ a₂b₂))\n (fun b₁b₂ => Setoid.trans a₁b₁ (Setoid.trans b₁b₂ (Setoid.symm a₂b₂)))))", "start": [ 1747, 1 ], "end": [ 1753, 81 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.rel.refl", "code": "private theorem rel.refl {s : Setoid α} (q : Quotient s) : rel q q", "start": [ 1755, 1 ], "end": [ 1756, 28 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.rel_of_eq", "code": "private theorem rel_of_eq {s : Setoid α} {q₁ q₂ : Quotient s} : q₁ = q₂ → rel q₁ q₂", "start": [ 1758, 1 ], "end": [ 1759, 38 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.exact", "code": "theorem exact {s : Setoid α} {a b : α} : Quotient.mk s a = Quotient.mk s b → a ≈ b", "start": [ 1761, 1 ], "end": [ 1762, 23 ], "kind": "commanddeclaration" }, { "full_name": "Quotient.recOnSubsingleton₂", "code": "@[elab_as_elim]\nprotected abbrev recOnSubsingleton₂\n {motive : Quotient s₁ → Quotient s₂ → Sort uC}\n [s : (a : α) → (b : β) → Subsingleton (motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))]\n (q₁ : Quotient s₁)\n (q₂ : Quotient s₂)\n (g : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))\n : motive q₁ q₂ := by\n induction q₁ using Quot.recOnSubsingleton\n induction q₂ using Quot.recOnSubsingleton\n apply g\n intro a; apply s\n induction q₂ using Quot.recOnSubsingleton\n intro a; apply s\n infer_instance", "start": [ 1771, 1 ], "end": [ 1786, 17 ], "kind": "commanddeclaration" }, { "full_name": "funext", "code": "theorem funext {α : Sort u} {β : α → Sort v} {f g : (x : α) → β x}\n (h : ∀ x, f x = g x) : f = g", "start": [ 1805, 1 ], "end": [ 1825, 42 ], "kind": "commanddeclaration" }, { "full_name": "Squash", "code": "def Squash (α : Type u) := Quot (fun (_ _ : α) => True)", "start": [ 1832, 1 ], "end": [ 1846, 56 ], "kind": "commanddeclaration" }, { "full_name": "Squash.mk", "code": "def Squash.mk {α : Type u} (x : α) : Squash α := Quot.mk _ x", "start": [ 1848, 1 ], "end": [ 1849, 61 ], "kind": "commanddeclaration" }, { "full_name": "Squash.ind", "code": "theorem Squash.ind {α : Type u} {motive : Squash α → Prop} (h : ∀ (a : α), motive (Squash.mk a)) : ∀ (q : Squash α), motive q", "start": [ 1851, 1 ], "end": [ 1852, 13 ], "kind": "commanddeclaration" }, { "full_name": "Squash.lift", "code": "@[inline] def Squash.lift {α β} [Subsingleton β] (s : Squash α) (f : α → β) : β :=\n Quot.lift f (fun _ _ _ => Subsingleton.elim _ _) s", "start": [ 1854, 1 ], "end": [ 1856, 53 ], "kind": "commanddeclaration" }, { "full_name": "Antisymm", "code": "class Antisymm {α : Sort u} (r : α → α → Prop) where\n \n antisymm {a b : α} : r a b → r b a → a = b", "start": [ 1867, 1 ], "end": [ 1872, 45 ], "kind": "commanddeclaration" }, { "full_name": "Lean.trustCompiler", "code": "axiom trustCompiler : True", "start": [ 1877, 1 ], "end": [ 1880, 27 ], "kind": "commanddeclaration" }, { "full_name": "Lean.reduceBool", "code": "opaque reduceBool (b : Bool) : Bool :=\n have := trustCompiler\n b", "start": [ 1882, 1 ], "end": [ 1904, 4 ], "kind": "commanddeclaration" }, { "full_name": "Lean.reduceNat", "code": "opaque reduceNat (n : Nat) : Nat :=\n have := trustCompiler\n n", "start": [ 1906, 1 ], "end": [ 1916, 4 ], "kind": "commanddeclaration" }, { "full_name": "Lean.ofReduceBool", "code": "axiom ofReduceBool (a b : Bool) (h : reduceBool a = b) : a = b", "start": [ 1919, 1 ], "end": [ 1932, 63 ], "kind": "commanddeclaration" }, { "full_name": "Lean.ofReduceNat", "code": "axiom ofReduceNat (a b : Nat) (h : reduceNat a = b) : a = b", "start": [ 1934, 1 ], "end": [ 1943, 60 ], "kind": "commanddeclaration" }, { "full_name": "ge_iff_le", "code": "@[simp] theorem ge_iff_le [LE α] {x y : α} : x ≥ y ↔ y ≤ x", "start": [ 1947, 1 ], "end": [ 1947, 70 ], "kind": "commanddeclaration" }, { "full_name": "gt_iff_lt", "code": "@[simp] theorem gt_iff_lt [LT α] {x y : α} : x > y ↔ y < x", "start": [ 1949, 1 ], "end": [ 1949, 70 ], "kind": "commanddeclaration" }, { "full_name": "le_of_eq_of_le", "code": "theorem le_of_eq_of_le {a b c : α} [LE α] (h₁ : a = b) (h₂ : b ≤ c) : a ≤ c", "start": [ 1951, 1 ], "end": [ 1951, 87 ], "kind": "commanddeclaration" }, { "full_name": "le_of_le_of_eq", "code": "theorem le_of_le_of_eq {a b c : α} [LE α] (h₁ : a ≤ b) (h₂ : b = c) : a ≤ c", "start": [ 1953, 1 ], "end": [ 1953, 87 ], "kind": "commanddeclaration" }, { "full_name": "lt_of_eq_of_lt", "code": "theorem lt_of_eq_of_lt {a b c : α} [LT α] (h₁ : a = b) (h₂ : b < c) : a < c", "start": [ 1955, 1 ], "end": [ 1955, 87 ], "kind": "commanddeclaration" }, { "full_name": "lt_of_lt_of_eq", "code": "theorem lt_of_lt_of_eq {a b c : α} [LT α] (h₁ : a < b) (h₂ : b = c) : a < c", "start": [ 1957, 1 ], "end": [ 1957, 87 ], "kind": "commanddeclaration" }, { "full_name": "Std.Associative", "code": "class Associative (op : α → α → α) : Prop where\n \n assoc : (a b c : α) → op (op a b) c = op a (op b c)", "start": [ 1962, 1 ], "end": [ 1968, 54 ], "kind": "commanddeclaration" }, { "full_name": "Std.Commutative", "code": "class Commutative (op : α → α → α) : Prop where\n \n comm : (a b : α) → op a b = op b a", "start": [ 1970, 1 ], "end": [ 1976, 37 ], "kind": "commanddeclaration" }, { "full_name": "Std.IdempotentOp", "code": "class IdempotentOp (op : α → α → α) : Prop where\n \n idempotent : (x : α) → op x x = x", "start": [ 1978, 1 ], "end": [ 1984, 36 ], "kind": "commanddeclaration" }, { "full_name": "Std.LeftIdentity", "code": "class LeftIdentity (op : α → β → β) (o : outParam α) : Prop", "start": [ 1986, 1 ], "end": [ 1992, 60 ], "kind": "commanddeclaration" }, { "full_name": "Std.LawfulLeftIdentity", "code": "class LawfulLeftIdentity (op : α → β → β) (o : outParam α) extends LeftIdentity op o : Prop where\n \n left_id : ∀ a, op o a = a", "start": [ 1994, 1 ], "end": [ 2000, 28 ], "kind": "commanddeclaration" }, { "full_name": "Std.RightIdentity", "code": "class RightIdentity (op : α → β → α) (o : outParam β) : Prop", "start": [ 2002, 1 ], "end": [ 2008, 61 ], "kind": "commanddeclaration" }, { "full_name": "Std.LawfulRightIdentity", "code": "class LawfulRightIdentity (op : α → β → α) (o : outParam β) extends RightIdentity op o : Prop where\n \n right_id : ∀ a, op a o = a", "start": [ 2010, 1 ], "end": [ 2016, 29 ], "kind": "commanddeclaration" }, { "full_name": "Std.Identity", "code": "class Identity (op : α → α → α) (o : outParam α) extends LeftIdentity op o, RightIdentity op o : Prop", "start": [ 2018, 1 ], "end": [ 2024, 102 ], "kind": "commanddeclaration" }, { "full_name": "Std.LawfulIdentity", "code": "class LawfulIdentity (op : α → α → α) (o : outParam α) extends Identity op o, LawfulLeftIdentity op o, LawfulRightIdentity op o : Prop", "start": [ 2026, 1 ], "end": [ 2030, 135 ], "kind": "commanddeclaration" }, { "full_name": "Std.LawfulCommIdentity", "code": "class LawfulCommIdentity (op : α → α → α) (o : outParam α) [hc : Commutative op] extends LawfulIdentity op o : Prop where\n left_id a := Eq.trans (hc.comm o a) (right_id a)\n right_id a := Eq.trans (hc.comm a o) (left_id a)", "start": [ 2032, 1 ], "end": [ 2043, 51 ], "kind": "commanddeclaration" } ]
.lake/packages/lean4/src/lean/Init/SimpLemmas.lean
[ ".lake/packages/lean4/src/lean/Init/Core.lean" ]
[ { "full_name": "of_eq_true", "code": "theorem of_eq_true (h : p = True) : p", "start": [ 12, 1 ], "end": [ 12, 53 ], "kind": "commanddeclaration" }, { "full_name": "of_eq_false", "code": "theorem of_eq_false (h : p = False) : ¬ p", "start": [ 13, 1 ], "end": [ 13, 76 ], "kind": "commanddeclaration" }, { "full_name": "eq_true", "code": "theorem eq_true (h : p) : p = True", "start": [ 15, 1 ], "end": [ 16, 41 ], "kind": "commanddeclaration" }, { "full_name": "eq_false", "code": "theorem eq_false (h : ¬ p) : p = False", "start": [ 21, 1 ], "end": [ 22, 59 ], "kind": "commanddeclaration" }, { "full_name": "eq_false'", "code": "theorem eq_false' (h : p → False) : p = False", "start": [ 24, 1 ], "end": [ 24, 60 ], "kind": "commanddeclaration" }, { "full_name": "eq_true_of_decide", "code": "theorem eq_true_of_decide {p : Prop} [Decidable p] (h : decide p = true) : p = True", "start": [ 26, 1 ], "end": [ 27, 32 ], "kind": "commanddeclaration" }, { "full_name": "eq_false_of_decide", "code": "theorem eq_false_of_decide {p : Prop} {_ : Decidable p} (h : decide p = false) : p = False", "start": [ 29, 1 ], "end": [ 30, 34 ], "kind": "commanddeclaration" }, { "full_name": "eq_self", "code": "@[simp] theorem eq_self (a : α) : (a = a) = True", "start": [ 32, 1 ], "end": [ 32, 64 ], "kind": "commanddeclaration" }, { "full_name": "implies_congr", "code": "theorem implies_congr {p₁ p₂ : Sort u} {q₁ q₂ : Sort v} (h₁ : p₁ = p₂) (h₂ : q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂)", "start": [ 34, 1 ], "end": [ 35, 16 ], "kind": "commanddeclaration" }, { "full_name": "iff_congr", "code": "theorem iff_congr {p₁ p₂ q₁ q₂ : Prop} (h₁ : p₁ ↔ p₂) (h₂ : q₁ ↔ q₂) : (p₁ ↔ q₁) ↔ (p₂ ↔ q₂)", "start": [ 37, 1 ], "end": [ 38, 44 ], "kind": "commanddeclaration" }, { "full_name": "implies_dep_congr_ctx", "code": "theorem implies_dep_congr_ctx {p₁ p₂ q₁ : Prop} (h₁ : p₁ = p₂) {q₂ : p₂ → Prop} (h₂ : (h : p₂) → q₁ = q₂ h) : (p₁ → q₁) = ((h : p₂) → q₂ h)", "start": [ 40, 1 ], "end": [ 43, 57 ], "kind": "commanddeclaration" }, { "full_name": "implies_congr_ctx", "code": "theorem implies_congr_ctx {p₁ p₂ q₁ q₂ : Prop} (h₁ : p₁ = p₂) (h₂ : p₂ → q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂)", "start": [ 45, 1 ], "end": [ 46, 30 ], "kind": "commanddeclaration" }, { "full_name": "forall_congr", "code": "theorem forall_congr {α : Sort u} {p q : α → Prop} (h : ∀ a, p a = q a) : (∀ a, p a) = (∀ a, q a)", "start": [ 48, 1 ], "end": [ 49, 27 ], "kind": "commanddeclaration" }, { "full_name": "forall_prop_domain_congr", "code": "theorem forall_prop_domain_congr {p₁ p₂ : Prop} {q₁ : p₁ → Prop} {q₂ : p₂ → Prop}\n (h₁ : p₁ = p₂)\n (h₂ : ∀ a : p₂, q₁ (h₁.substr a) = q₂ a)\n : (∀ a : p₁, q₁ a) = (∀ a : p₂, q₂ a)", "start": [ 51, 1 ], "end": [ 55, 24 ], "kind": "commanddeclaration" }, { "full_name": "let_congr", "code": "theorem let_congr {α : Sort u} {β : Sort v} {a a' : α} {b b' : α → β}\n (h₁ : a = a') (h₂ : ∀ x, b x = b' x) : (let x := a; b x) = (let x := a'; b' x)", "start": [ 57, 1 ], "end": [ 59, 34 ], "kind": "commanddeclaration" }, { "full_name": "let_val_congr", "code": "theorem let_val_congr {α : Sort u} {β : Sort v} {a a' : α}\n (b : α → β) (h : a = a') : (let x := a; b x) = (let x := a'; b x)", "start": [ 61, 1 ], "end": [ 62, 81 ], "kind": "commanddeclaration" }, { "full_name": "let_body_congr", "code": "theorem let_body_congr {α : Sort u} {β : α → Sort v} {b b' : (a : α) → β a}\n (a : α) (h : ∀ x, b x = b' x) : (let x := a; b x) = (let x := a; b' x)", "start": [ 64, 1 ], "end": [ 66, 28 ], "kind": "commanddeclaration" }, { "full_name": "ite_congr", "code": "@[congr]\ntheorem ite_congr {x y u v : α} {s : Decidable b} [Decidable c]\n (h₁ : b = c) (h₂ : c → x = u) (h₃ : ¬ c → y = v) : ite b x y = ite c u v", "start": [ 68, 1 ], "end": [ 73, 63 ], "kind": "commanddeclaration" }, { "full_name": "Eq.mpr_prop", "code": "theorem Eq.mpr_prop {p q : Prop} (h₁ : p = q) (h₂ : q) : p", "start": [ 75, 1 ], "end": [ 75, 72 ], "kind": "commanddeclaration" }, { "full_name": "Eq.mpr_not", "code": "theorem Eq.mpr_not {p q : Prop} (h₁ : p = q) (h₂ : ¬q) : ¬p", "start": [ 76, 1 ], "end": [ 76, 72 ], "kind": "commanddeclaration" }, { "full_name": "dite_congr", "code": "@[congr]\ntheorem dite_congr {_ : Decidable b} [Decidable c]\n {x : b → α} {u : c → α} {y : ¬b → α} {v : ¬c → α}\n (h₁ : b = c)\n (h₂ : (h : c) → x (h₁.mpr_prop h) = u h)\n (h₃ : (h : ¬c) → y (h₁.mpr_not h) = v h) :\n dite b x y = dite c u v", "start": [ 78, 1 ], "end": [ 87, 65 ], "kind": "commanddeclaration" }, { "full_name": "ne_eq", "code": "@[simp] theorem ne_eq (a b : α) : (a ≠ b) = ¬(a = b)", "start": [ 89, 1 ], "end": [ 89, 60 ], "kind": "commanddeclaration" }, { "full_name": "ite_true", "code": "@[simp] theorem ite_true (a b : α) : (if True then a else b) = a", "start": [ 91, 1 ], "end": [ 91, 72 ], "kind": "commanddeclaration" }, { "full_name": "ite_false", "code": "@[simp] theorem ite_false (a b : α) : (if False then a else b) = b", "start": [ 92, 1 ], "end": [ 92, 74 ], "kind": "commanddeclaration" }, { "full_name": "dite_true", "code": "@[simp] theorem dite_true {α : Sort u} {t : True → α} {e : ¬ True → α} : (dite True t e) = t True.intro", "start": [ 93, 1 ], "end": [ 93, 111 ], "kind": "commanddeclaration" }, { "full_name": "dite_false", "code": "@[simp] theorem dite_false {α : Sort u} {t : False → α} {e : ¬ False → α} : (dite False t e) = e not_false", "start": [ 94, 1 ], "end": [ 94, 114 ], "kind": "commanddeclaration" }, { "full_name": "ite_cond_eq_true", "code": "theorem ite_cond_eq_true {α : Sort u} {c : Prop} {_ : Decidable c} (a b : α) (h : c = True) : (if c then a else b) = a", "start": [ 97, 1 ], "end": [ 97, 134 ], "kind": "commanddeclaration" }, { "full_name": "ite_cond_eq_false", "code": "theorem ite_cond_eq_false {α : Sort u} {c : Prop} {_ : Decidable c} (a b : α) (h : c = False) : (if c then a else b) = b", "start": [ 98, 1 ], "end": [ 98, 136 ], "kind": "commanddeclaration" }, { "full_name": "dite_cond_eq_true", "code": "theorem dite_cond_eq_true {α : Sort u} {c : Prop} {_ : Decidable c} {t : c → α} {e : ¬ c → α} (h : c = True) : (dite c t e) = t (of_eq_true h)", "start": [ 99, 1 ], "end": [ 99, 158 ], "kind": "commanddeclaration" }, { "full_name": "dite_cond_eq_false", "code": "theorem dite_cond_eq_false {α : Sort u} {c : Prop} {_ : Decidable c} {t : c → α} {e : ¬ c → α} (h : c = False) : (dite c t e) = e (of_eq_false h)", "start": [ 100, 1 ], "end": [ 100, 161 ], "kind": "commanddeclaration" }, { "full_name": "ite_self", "code": "@[simp] theorem ite_self {α : Sort u} {c : Prop} {d : Decidable c} (a : α) : ite c a a = a", "start": [ 102, 1 ], "end": [ 102, 113 ], "kind": "commanddeclaration" }, { "full_name": "and_true", "code": "@[simp] theorem and_true (p : Prop) : (p ∧ True) = p", "start": [ 104, 1 ], "end": [ 104, 88 ], "kind": "commanddeclaration" }, { "full_name": "true_and", "code": "@[simp] theorem true_and (p : Prop) : (True ∧ p) = p", "start": [ 105, 1 ], "end": [ 105, 88 ], "kind": "commanddeclaration" }, { "full_name": "and_false", "code": "@[simp] theorem and_false (p : Prop) : (p ∧ False) = False", "start": [ 109, 1 ], "end": [ 109, 77 ], "kind": "commanddeclaration" }, { "full_name": "false_and", "code": "@[simp] theorem false_and (p : Prop) : (False ∧ p) = False", "start": [ 110, 1 ], "end": [ 110, 77 ], "kind": "commanddeclaration" }, { "full_name": "and_self", "code": "@[simp] theorem and_self (p : Prop) : (p ∧ p) = p", "start": [ 111, 1 ], "end": [ 111, 89 ], "kind": "commanddeclaration" }, { "full_name": "and_not_self", "code": "@[simp] theorem and_not_self : ¬(a ∧ ¬a)", "start": [ 113, 1 ], "end": [ 113, 68 ], "kind": "commanddeclaration" }, { "full_name": "not_and_self", "code": "@[simp] theorem not_and_self : ¬(¬a ∧ a)", "start": [ 114, 1 ], "end": [ 114, 68 ], "kind": "commanddeclaration" }, { "full_name": "and_imp", "code": "@[simp] theorem and_imp : (a ∧ b → c) ↔ (a → b → c)", "start": [ 115, 1 ], "end": [ 115, 110 ], "kind": "commanddeclaration" }, { "full_name": "not_and", "code": "@[simp] theorem not_and : ¬(a ∧ b) ↔ (a → ¬b)", "start": [ 116, 1 ], "end": [ 116, 57 ], "kind": "commanddeclaration" }, { "full_name": "or_self", "code": "@[simp] theorem or_self (p : Prop) : (p ∨ p) = p", "start": [ 117, 1 ], "end": [ 117, 95 ], "kind": "commanddeclaration" }, { "full_name": "or_true", "code": "@[simp] theorem or_true (p : Prop) : (p ∨ True) = True", "start": [ 119, 1 ], "end": [ 119, 81 ], "kind": "commanddeclaration" }, { "full_name": "true_or", "code": "@[simp] theorem true_or (p : Prop) : (True ∨ p) = True", "start": [ 120, 1 ], "end": [ 120, 81 ], "kind": "commanddeclaration" }, { "full_name": "or_false", "code": "@[simp] theorem or_false (p : Prop) : (p ∨ False) = p", "start": [ 121, 1 ], "end": [ 121, 91 ], "kind": "commanddeclaration" }, { "full_name": "false_or", "code": "@[simp] theorem false_or (p : Prop) : (False ∨ p) = p", "start": [ 122, 1 ], "end": [ 122, 91 ], "kind": "commanddeclaration" }, { "full_name": "iff_self", "code": "@[simp] theorem iff_self (p : Prop) : (p ↔ p) = True", "start": [ 126, 1 ], "end": [ 126, 69 ], "kind": "commanddeclaration" }, { "full_name": "iff_true", "code": "@[simp] theorem iff_true (p : Prop) : (p ↔ True) = p", "start": [ 127, 1 ], "end": [ 127, 121 ], "kind": "commanddeclaration" }, { "full_name": "true_iff", "code": "@[simp] theorem true_iff (p : Prop) : (True ↔ p) = p", "start": [ 128, 1 ], "end": [ 128, 121 ], "kind": "commanddeclaration" }, { "full_name": "iff_false", "code": "@[simp] theorem iff_false (p : Prop) : (p ↔ False) = ¬p", "start": [ 129, 1 ], "end": [ 129, 94 ], "kind": "commanddeclaration" }, { "full_name": "false_iff", "code": "@[simp] theorem false_iff (p : Prop) : (False ↔ p) = ¬p", "start": [ 130, 1 ], "end": [ 130, 94 ], "kind": "commanddeclaration" }, { "full_name": "false_implies", "code": "@[simp] theorem false_implies (p : Prop) : (False → p) = True", "start": [ 131, 1 ], "end": [ 131, 84 ], "kind": "commanddeclaration" }, { "full_name": "implies_true", "code": "@[simp] theorem implies_true (α : Sort u) : (α → True) = True", "start": [ 132, 1 ], "end": [ 132, 90 ], "kind": "commanddeclaration" }, { "full_name": "true_implies", "code": "@[simp] theorem true_implies (p : Prop) : (True → p) = p", "start": [ 133, 1 ], "end": [ 133, 96 ], "kind": "commanddeclaration" }, { "full_name": "not_false_eq_true", "code": "@[simp] theorem not_false_eq_true : (¬ False) = True", "start": [ 134, 1 ], "end": [ 134, 75 ], "kind": "commanddeclaration" }, { "full_name": "not_true_eq_false", "code": "@[simp] theorem not_true_eq_false : (¬ True) = False", "start": [ 135, 1 ], "end": [ 135, 66 ], "kind": "commanddeclaration" }, { "full_name": "not_iff_self", "code": "@[simp] theorem not_iff_self : ¬(¬a ↔ a)", "start": [ 137, 1 ], "end": [ 137, 68 ], "kind": "commanddeclaration" }, { "full_name": "and_congr_right", "code": "theorem and_congr_right (h : a → (b ↔ c)) : a ∧ b ↔ a ∧ c", "start": [ 142, 1 ], "end": [ 144, 59 ], "kind": "commanddeclaration" }, { "full_name": "and_congr_left", "code": "theorem and_congr_left (h : c → (a ↔ b)) : a ∧ c ↔ b ∧ c", "start": [ 145, 1 ], "end": [ 146, 62 ], "kind": "commanddeclaration" }, { "full_name": "and_assoc", "code": "theorem and_assoc : (a ∧ b) ∧ c ↔ a ∧ (b ∧ c)", "start": [ 148, 1 ], "end": [ 150, 49 ], "kind": "commanddeclaration" }, { "full_name": "and_self_left", "code": "@[simp] theorem and_self_left : a ∧ (a ∧ b) ↔ a ∧ b", "start": [ 153, 1 ], "end": [ 153, 93 ], "kind": "commanddeclaration" }, { "full_name": "and_self_right", "code": "@[simp] theorem and_self_right : (a ∧ b) ∧ b ↔ a ∧ b", "start": [ 154, 1 ], "end": [ 154, 93 ], "kind": "commanddeclaration" }, { "full_name": "and_congr_right_iff", "code": "@[simp] theorem and_congr_right_iff : (a ∧ b ↔ a ∧ c) ↔ (a → (b ↔ c))", "start": [ 156, 1 ], "end": [ 157, 69 ], "kind": "commanddeclaration" }, { "full_name": "and_congr_left_iff", "code": "@[simp] theorem and_congr_left_iff : (a ∧ c ↔ b ∧ c) ↔ c → (a ↔ b)", "start": [ 158, 1 ], "end": [ 159, 59 ], "kind": "commanddeclaration" }, { "full_name": "and_iff_left_of_imp", "code": "theorem and_iff_left_of_imp (h : a → b) : (a ∧ b) ↔ a", "start": [ 161, 1 ], "end": [ 161, 109 ], "kind": "commanddeclaration" }, { "full_name": "and_iff_right_of_imp", "code": "theorem and_iff_right_of_imp (h : b → a) : (a ∧ b) ↔ b", "start": [ 162, 1 ], "end": [ 162, 101 ], "kind": "commanddeclaration" }, { "full_name": "and_iff_left_iff_imp", "code": "@[simp] theorem and_iff_left_iff_imp : ((a ∧ b) ↔ a) ↔ (a → b)", "start": [ 164, 1 ], "end": [ 164, 117 ], "kind": "commanddeclaration" }, { "full_name": "and_iff_right_iff_imp", "code": "@[simp] theorem and_iff_right_iff_imp : ((a ∧ b) ↔ b) ↔ (b → a)", "start": [ 165, 1 ], "end": [ 165, 117 ], "kind": "commanddeclaration" }, { "full_name": "iff_self_and", "code": "@[simp] theorem iff_self_and : (p ↔ p ∧ q) ↔ (p → q)", "start": [ 167, 1 ], "end": [ 167, 98 ], "kind": "commanddeclaration" }, { "full_name": "iff_and_self", "code": "@[simp] theorem iff_and_self : (p ↔ q ∧ p) ↔ (p → q)", "start": [ 168, 1 ], "end": [ 168, 87 ], "kind": "commanddeclaration" }, { "full_name": "Or.imp", "code": "theorem Or.imp (f : a → c) (g : b → d) (h : a ∨ b) : c ∨ d", "start": [ 172, 1 ], "end": [ 172, 89 ], "kind": "commanddeclaration" }, { "full_name": "Or.imp_left", "code": "theorem Or.imp_left (f : a → b) : a ∨ c → b ∨ c", "start": [ 173, 1 ], "end": [ 173, 61 ], "kind": "commanddeclaration" }, { "full_name": "Or.imp_right", "code": "theorem Or.imp_right (f : b → c) : a ∨ b → a ∨ c", "start": [ 174, 1 ], "end": [ 174, 62 ], "kind": "commanddeclaration" }, { "full_name": "or_assoc", "code": "theorem or_assoc : (a ∨ b) ∨ c ↔ a ∨ (b ∨ c)", "start": [ 176, 1 ], "end": [ 178, 50 ], "kind": "commanddeclaration" }, { "full_name": "or_self_left", "code": "@[simp] theorem or_self_left : a ∨ (a ∨ b) ↔ a ∨ b", "start": [ 181, 1 ], "end": [ 181, 90 ], "kind": "commanddeclaration" }, { "full_name": "or_self_right", "code": "@[simp] theorem or_self_right : (a ∨ b) ∨ b ↔ a ∨ b", "start": [ 182, 1 ], "end": [ 182, 90 ], "kind": "commanddeclaration" }, { "full_name": "or_iff_right_of_imp", "code": "theorem or_iff_right_of_imp (ha : a → b) : (a ∨ b) ↔ b", "start": [ 184, 1 ], "end": [ 184, 88 ], "kind": "commanddeclaration" }, { "full_name": "or_iff_left_of_imp", "code": "theorem or_iff_left_of_imp (hb : b → a) : (a ∨ b) ↔ a", "start": [ 185, 1 ], "end": [ 185, 89 ], "kind": "commanddeclaration" }, { "full_name": "or_iff_left_iff_imp", "code": "@[simp] theorem or_iff_left_iff_imp : (a ∨ b ↔ a) ↔ (b → a)", "start": [ 187, 1 ], "end": [ 187, 109 ], "kind": "commanddeclaration" }, { "full_name": "or_iff_right_iff_imp", "code": "@[simp] theorem or_iff_right_iff_imp : (a ∨ b ↔ b) ↔ (a → b)", "start": [ 188, 1 ], "end": [ 188, 101 ], "kind": "commanddeclaration" }, { "full_name": "iff_self_or", "code": "@[simp] theorem iff_self_or (a b : Prop) : (a ↔ a ∨ b) ↔ (b → a)", "start": [ 190, 1 ], "end": [ 191, 53 ], "kind": "commanddeclaration" }, { "full_name": "iff_or_self", "code": "@[simp] theorem iff_or_self (a b : Prop) : (b ↔ a ∨ b) ↔ (a → b)", "start": [ 192, 1 ], "end": [ 193, 54 ], "kind": "commanddeclaration" }, { "full_name": "Bool.or_false", "code": "@[simp] theorem Bool.or_false (b : Bool) : (b || false) = b", "start": [ 197, 1 ], "end": [ 197, 83 ], "kind": "commanddeclaration" }, { "full_name": "Bool.or_true", "code": "@[simp] theorem Bool.or_true (b : Bool) : (b || true) = true", "start": [ 198, 1 ], "end": [ 198, 83 ], "kind": "commanddeclaration" }, { "full_name": "Bool.false_or", "code": "@[simp] theorem Bool.false_or (b : Bool) : (false || b) = b", "start": [ 199, 1 ], "end": [ 199, 83 ], "kind": "commanddeclaration" }, { "full_name": "Bool.true_or", "code": "@[simp] theorem Bool.true_or (b : Bool) : (true || b) = true", "start": [ 203, 1 ], "end": [ 203, 83 ], "kind": "commanddeclaration" }, { "full_name": "Bool.or_self", "code": "@[simp] theorem Bool.or_self (b : Bool) : (b || b) = b", "start": [ 204, 1 ], "end": [ 204, 83 ], "kind": "commanddeclaration" }, { "full_name": "Bool.or_eq_true", "code": "@[simp] theorem Bool.or_eq_true (a b : Bool) : ((a || b) = true) = (a = true ∨ b = true)", "start": [ 206, 1 ], "end": [ 207, 33 ], "kind": "commanddeclaration" }, { "full_name": "Bool.and_false", "code": "@[simp] theorem Bool.and_false (b : Bool) : (b && false) = false", "start": [ 209, 1 ], "end": [ 209, 87 ], "kind": "commanddeclaration" }, { "full_name": "Bool.and_true", "code": "@[simp] theorem Bool.and_true (b : Bool) : (b && true) = b", "start": [ 210, 1 ], "end": [ 210, 87 ], "kind": "commanddeclaration" }, { "full_name": "Bool.false_and", "code": "@[simp] theorem Bool.false_and (b : Bool) : (false && b) = false", "start": [ 211, 1 ], "end": [ 211, 87 ], "kind": "commanddeclaration" }, { "full_name": "Bool.true_and", "code": "@[simp] theorem Bool.true_and (b : Bool) : (true && b) = b", "start": [ 212, 1 ], "end": [ 212, 87 ], "kind": "commanddeclaration" }, { "full_name": "Bool.and_self", "code": "@[simp] theorem Bool.and_self (b : Bool) : (b && b) = b", "start": [ 216, 1 ], "end": [ 216, 87 ], "kind": "commanddeclaration" }, { "full_name": "Bool.and_eq_true", "code": "@[simp] theorem Bool.and_eq_true (a b : Bool) : ((a && b) = true) = (a = true ∧ b = true)", "start": [ 218, 1 ], "end": [ 219, 33 ], "kind": "commanddeclaration" }, { "full_name": "Bool.and_assoc", "code": "theorem Bool.and_assoc (a b c : Bool) : (a && b && c) = (a && (b && c))", "start": [ 221, 1 ], "end": [ 222, 45 ], "kind": "commanddeclaration" }, { "full_name": "Bool.or_assoc", "code": "theorem Bool.or_assoc (a b c : Bool) : (a || b || c) = (a || (b || c))", "start": [ 224, 1 ], "end": [ 225, 45 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_not", "code": "@[simp] theorem Bool.not_not (b : Bool) : (!!b) = b", "start": [ 228, 1 ], "end": [ 228, 74 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_true", "code": "@[simp] theorem Bool.not_true : (!true) = false", "start": [ 229, 1 ], "end": [ 229, 62 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_false", "code": "@[simp] theorem Bool.not_false : (!false) = true", "start": [ 230, 1 ], "end": [ 230, 62 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_beq_true", "code": "@[simp] theorem Bool.not_beq_true (b : Bool) : (!(b == true)) = (b == false)", "start": [ 231, 1 ], "end": [ 231, 100 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_beq_false", "code": "@[simp] theorem Bool.not_beq_false (b : Bool) : (!(b == false)) = (b == true)", "start": [ 232, 1 ], "end": [ 232, 100 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_eq_true'", "code": "@[simp] theorem Bool.not_eq_true' (b : Bool) : ((!b) = true) = (b = false)", "start": [ 233, 1 ], "end": [ 233, 99 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_eq_false'", "code": "@[simp] theorem Bool.not_eq_false' (b : Bool) : ((!b) = false) = (b = true)", "start": [ 234, 1 ], "end": [ 234, 99 ], "kind": "commanddeclaration" }, { "full_name": "Bool.beq_to_eq", "code": "@[simp] theorem Bool.beq_to_eq (a b : Bool) :\n (a == b) = (a = b)", "start": [ 236, 1 ], "end": [ 237, 58 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_beq_to_not_eq", "code": "@[simp] theorem Bool.not_beq_to_not_eq (a b : Bool) :\n (!(a == b)) = ¬(a = b)", "start": [ 238, 1 ], "end": [ 239, 62 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_eq_true", "code": "@[simp] theorem Bool.not_eq_true (b : Bool) : (¬(b = true)) = (b = false)", "start": [ 241, 1 ], "end": [ 241, 99 ], "kind": "commanddeclaration" }, { "full_name": "Bool.not_eq_false", "code": "@[simp] theorem Bool.not_eq_false (b : Bool) : (¬(b = false)) = (b = true)", "start": [ 242, 1 ], "end": [ 242, 100 ], "kind": "commanddeclaration" }, { "full_name": "decide_eq_true_eq", "code": "@[simp] theorem decide_eq_true_eq [Decidable p] : (decide p = true) = p", "start": [ 244, 1 ], "end": [ 245, 56 ], "kind": "commanddeclaration" }, { "full_name": "decide_not", "code": "@[simp] theorem decide_not [g : Decidable p] [h : Decidable (Not p)] : decide (Not p) = !(decide p)", "start": [ 246, 1 ], "end": [ 247, 44 ], "kind": "commanddeclaration" }, { "full_name": "not_decide_eq_true", "code": "@[simp] theorem not_decide_eq_true [h : Decidable p] : ((!decide p) = true) = ¬ p", "start": [ 248, 1 ], "end": [ 249, 47 ], "kind": "commanddeclaration" }, { "full_name": "heq_eq_eq", "code": "@[simp] theorem heq_eq_eq (a b : α) : HEq a b = (a = b)", "start": [ 251, 1 ], "end": [ 251, 100 ], "kind": "commanddeclaration" }, { "full_name": "cond_true", "code": "@[simp] theorem cond_true (a b : α) : cond true a b = a", "start": [ 253, 1 ], "end": [ 253, 63 ], "kind": "commanddeclaration" }, { "full_name": "cond_false", "code": "@[simp] theorem cond_false (a b : α) : cond false a b = b", "start": [ 254, 1 ], "end": [ 254, 65 ], "kind": "commanddeclaration" }, { "full_name": "beq_self_eq_true", "code": "@[simp] theorem beq_self_eq_true [BEq α] [LawfulBEq α] (a : α) : (a == a) = true", "start": [ 256, 1 ], "end": [ 256, 98 ], "kind": "commanddeclaration" }, { "full_name": "beq_self_eq_true'", "code": "@[simp] theorem beq_self_eq_true' [DecidableEq α] (a : α) : (a == a) = true", "start": [ 257, 1 ], "end": [ 257, 97 ], "kind": "commanddeclaration" }, { "full_name": "bne_self_eq_false", "code": "@[simp] theorem bne_self_eq_false [BEq α] [LawfulBEq α] (a : α) : (a != a) = false", "start": [ 259, 1 ], "end": [ 259, 100 ], "kind": "commanddeclaration" }, { "full_name": "bne_self_eq_false'", "code": "@[simp] theorem bne_self_eq_false' [DecidableEq α] (a : α) : (a != a) = false", "start": [ 260, 1 ], "end": [ 260, 95 ], "kind": "commanddeclaration" }, { "full_name": "decide_False", "code": "@[simp] theorem decide_False : decide False = false", "start": [ 262, 1 ], "end": [ 262, 59 ], "kind": "commanddeclaration" }, { "full_name": "decide_True", "code": "@[simp] theorem decide_True : decide True = true", "start": [ 263, 1 ], "end": [ 263, 58 ], "kind": "commanddeclaration" }, { "full_name": "bne_iff_ne", "code": "@[simp] theorem bne_iff_ne [BEq α] [LawfulBEq α] (a b : α) : a != b ↔ a ≠ b", "start": [ 265, 1 ], "end": [ 266, 56 ], "kind": "commanddeclaration" }, { "full_name": "beq_eq_false_iff_ne", "code": "@[simp] theorem beq_eq_false_iff_ne [BEq α] [LawfulBEq α]\n (a b : α) : (a == b) = false ↔ a ≠ b", "start": [ 276, 1 ], "end": [ 279, 26 ], "kind": "commanddeclaration" }, { "full_name": "bne_eq_false_iff_eq", "code": "@[simp] theorem bne_eq_false_iff_eq [BEq α] [LawfulBEq α] (a b : α) :\n (a != b) = false ↔ a = b", "start": [ 281, 1 ], "end": [ 284, 26 ], "kind": "commanddeclaration" }, { "full_name": "Nat.le_zero_eq", "code": "@[simp] theorem Nat.le_zero_eq (a : Nat) : (a ≤ 0) = (a = 0)", "start": [ 288, 1 ], "end": [ 289, 84 ], "kind": "commanddeclaration" } ]
.lake/packages/lean4/src/lean/Init/Data/Nat/Basic.lean
[ ".lake/packages/lean4/src/lean/Init/SimpLemmas.lean" ]
[{"full_name":"Nat.recCompiled","code":"private def recCompiled {motive : Nat → Sort u} (zero : mo(...TRUNCATED)
.lake/packages/lean4/src/lean/Init/MetaTypes.lean
[ ".lake/packages/lean4/src/lean/Init/Core.lean" ]
[{"full_name":"Lean.NameGenerator","code":"structure NameGenerator where\n namePrefix : Name := `_u(...TRUNCATED)
.lake/packages/lean4/src/lean/Init/WF.lean
[".lake/packages/lean4/src/lean/Init/Data/Nat/Basic.lean",".lake/packages/lean4/src/lean/Init/SizeOf(...TRUNCATED)
[{"full_name":"Acc","code":"inductive Acc {α : Sort u} (r : α → α → Prop) : α → Prop where(...TRUNCATED)

No dataset card yet

Downloads last month
0