khanh2023 commited on
Commit
c95bd2a
·
verified ·
1 Parent(s): b80450d

Add files using upload-large-folder tool

Browse files
data_5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib.Algebra.Module.Opposite.elab.json ADDED
The diff for this file is too large to render. See raw diff
 
data_5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib.CategoryTheory.Monoidal.CommGrp_.decl.json ADDED
The diff for this file is too large to render. See raw diff
 
data_5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib.Data.Set.List.mod.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"docstring":["# Lemmas about `List`s and `Set.range`\n\nIn this file we prove lemmas about range of some operations on lists.\n"],"imports":[["Init"],["Mathlib","Data","Set","Image"],["Mathlib","Data","List","Defs"]]}
data_5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib.LinearAlgebra.Matrix.Integer.elab.json ADDED
The diff for this file is too large to render. See raw diff
 
data_5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib.Tactic.Linarith.Datatypes.decl.json ADDED
@@ -0,0 +1 @@
 
 
1
+ [{"id":{"original":false,"range":[557,596]},"kind":"definition","modifiers":{"attrs":[{"kind":"global","name":["init"],"stx":[557,596]}],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":[557,596],"visibility":"public"},"name":["initFn","_@","Mathlib","Tactic","Linarith","Datatypes",189509315,"_hygCtx","_hyg",2],"params":[],"ref":{"original":false,"pp":"@[init]\npublic def initFn✝ : IO✝ Unit✝ := do\n registerTraceClass `linarith","range":[557,596]},"scopeInfo":{"currNamespace":[],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"]],"varDecls":[]},"signature":{"original":false,"pp":" : IO✝ Unit✝","range":[557,596]},"type":{"original":false,"pp":"IO✝ Unit✝","range":[557,596]},"value":{"original":false,"pp":" := do\n registerTraceClass `linarith","range":[557,596]}},{"id":{"original":false,"range":[597,643]},"kind":"definition","modifiers":{"attrs":[{"kind":"global","name":["init"],"stx":[597,643]}],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":[597,643],"visibility":"public"},"name":["initFn","_@","Mathlib","Tactic","Linarith","Datatypes",3248332875,"_hygCtx","_hyg",2],"params":[],"ref":{"original":false,"pp":"@[init]\npublic def initFn✝ : IO✝ Unit✝ := do\n registerTraceClass `linarith.detail","range":[597,643]},"scopeInfo":{"currNamespace":[],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"]],"varDecls":[]},"signature":{"original":false,"pp":" : IO✝ Unit✝","range":[597,643]},"type":{"original":false,"pp":"IO✝ Unit✝","range":[597,643]},"value":{"original":false,"pp":" := do\n registerTraceClass `linarith.detail","range":[597,643]}},{"id":{"original":true,"range":[762,786]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["A shorthand for getting the types of a list of proofs terms, to trace. ",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[680,757],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","linarithGetProofsMessage"],"params":[{"bi":"default","id":[788,789],"ref":[788,789],"type":[792,801]}],"ref":{"original":true,"pp":"/-- A shorthand for getting the types of a list of proofs terms, to trace. -/\ndef linarithGetProofsMessage (l : List Expr) : MetaM MessageData := do\n return\n m!\"{←\n l.mapM fun e => do\n instantiateMVars (← inferType e)}\"","range":[680,901]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (l : List Expr) : MetaM MessageData","range":[787,822]},"type":{"original":true,"pp":"MetaM MessageData","range":[805,822]},"value":{"original":true,"pp":" := do\n return\n m!\"{←\n l.mapM fun e => do\n instantiateMVars (← inferType e)}\"","range":[823,901]}},{"id":{"original":true,"range":[1022,1041]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["A shorthand for tracing the types of a list of proof terms\nwhen the `trace.linarith` option is set to true.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[903,1017],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","linarithTraceProofs"],"params":[{"bi":"implicit","id":[1043,1045],"ref":[1043,1045],"type":[1043,1045]},{"bi":"instImplicit","id":null,"ref":null,"type":[1048,1064]},{"bi":"default","id":[1067,1068],"ref":[1067,1068],"type":[1071,1073]},{"bi":"default","id":[1076,1077],"ref":[1076,1077],"type":[1080,1089]}],"ref":{"original":true,"pp":"/-- A shorthand for tracing the types of a list of proof terms\nwhen the `trace.linarith` option is set to true.\n-/\ndef linarithTraceProofs {α} [ToMessageData α] (s : α) (l : List Expr) : MetaM Unit := do\n if ← isTracingEnabledFor `linarith then \n addRawTrace <| .trace { cls := `linarith } (toMessageData s) #[← linarithGetProofsMessage l]","range":[903,1252]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" {α} [ToMessageData α] (s : α) (l : List Expr) : MetaM Unit","range":[1042,1103]},"type":{"original":true,"pp":"MetaM Unit","range":[1093,1103]},"value":{"original":true,"pp":" := do\n if ← isTracingEnabledFor `linarith then \n addRawTrace <| .trace { cls := `linarith } (toMessageData s) #[← linarithGetProofsMessage l]","range":[1104,1252]}},{"id":{"original":true,"range":[1709,1715]},"kind":"abbrev","modifiers":{"attrs":[],"computeKind":"regular","docString":["A linear expression is a list of pairs of variable indices and coefficients,\nrepresenting the sum of the products of each coefficient with its corresponding variable.\n\nSome functions on `Linexp` assume that `n : Nat` occurs at most once as the first element of a pair,\nand that the list is sorted in decreasing order of the first argument.\nThis is not enforced by the type but the operations here preserve it.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[1285,1701],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp"],"params":[],"ref":{"original":true,"pp":"/-- A linear expression is a list of pairs of variable indices and coefficients,\nrepresenting the sum of the products of each coefficient with its corresponding variable.\n\nSome functions on `Linexp` assume that `n : Nat` occurs at most once as the first element of a pair,\nand that the list is sorted in decreasing order of the first argument.\nThis is not enforced by the type but the operations here preserve it.\n-/\nabbrev Linexp : Type :=\n List (Nat × Int)","range":[1285,1743]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Type","range":[1716,1722]},"type":{"original":true,"pp":"Type","range":[1718,1722]},"value":{"original":true,"pp":" :=\n List (Nat × Int)","range":[1723,1743]}},{"id":{"original":true,"range":[1879,1882]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["Add two `Linexp`s together componentwise.\nPreserves sorting and uniqueness of the first argument.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"partial","stx":[1762,1874],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp","add"],"params":[],"ref":{"original":true,"pp":"/-- Add two `Linexp`s together componentwise.\nPreserves sorting and uniqueness of the first argument.\n-/\npartial def add : Linexp → Linexp → Linexp\n | [], a => a\n | a, [] => a\n | (a@(n1, z1) :: t1), (b@(n2, z2) :: t2) =>\n if n1 < n2 then b :: add (a :: t1) t2\n else\n if n2 < n1 then a :: add t1 (b :: t2)\n else\n let sum := z1 + z2\n if sum = 0 then add t1 t2 else (n1, sum) :: add t1 t2","range":[1762,2140]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Linexp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Mathlib","Tactic","Linarith","Linexp"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Linexp → Linexp → Linexp","range":[1883,1913]},"type":{"original":true,"pp":"Linexp → Linexp → Linexp","range":[1885,1913]},"value":{"original":true,"pp":"\n | [], a => a\n | a, [] => a\n | (a@(n1, z1) :: t1), (b@(n2, z2) :: t2) =>\n if n1 < n2 then b :: add (a :: t1) t2\n else\n if n2 < n1 then a :: add t1 (b :: t2)\n else\n let sum := z1 + z2\n if sum = 0 then add t1 t2 else (n1, sum) :: add t1 t2","range":[1914,2140]}},{"id":{"original":true,"range":[2234,2239]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`l.scale c` scales the values in `l` by `c` without modifying the order or keys. ",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[2142,2229],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp","scale"],"params":[{"bi":"default","id":[2241,2242],"ref":[2241,2242],"type":[2245,2248]},{"bi":"default","id":[2251,2252],"ref":[2251,2252],"type":[2255,2261]}],"ref":{"original":true,"pp":"/-- `l.scale c` scales the values in `l` by `c` without modifying the order or keys. -/\ndef scale (c : Int) (l : Linexp) : Linexp :=\n if c = 0 then [] else if c = 1 then l else l.map fun ⟨n, z⟩ => (n, z * c)","range":[2142,2356]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Linexp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Mathlib","Tactic","Linarith","Linexp"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (c : Int) (l : Linexp) : Linexp","range":[2240,2271]},"type":{"original":true,"pp":"Linexp","range":[2265,2271]},"value":{"original":true,"pp":" :=\n if c = 0 then [] else if c = 1 then l else l.map fun ⟨n, z⟩ => (n, z * c)","range":[2272,2356]}},{"id":{"original":true,"range":[2624,2627]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`l.get n` returns the value in `l` associated with key `n`, if it exists, and `none` otherwise.\nThis function assumes that `l` is sorted in decreasing order of the first argument,\nthat is, it will return `none` as soon as it finds a key smaller than `n`.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[2358,2619],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp","get"],"params":[{"bi":"default","id":[2629,2630],"ref":[2629,2630],"type":[2633,2636]}],"ref":{"original":true,"pp":"/-- `l.get n` returns the value in `l` associated with key `n`, if it exists, and `none` otherwise.\nThis function assumes that `l` is sorted in decreasing order of the first argument,\nthat is, it will return `none` as soon as it finds a key smaller than `n`.\n-/\ndef get (n : Nat) : Linexp → Option Int\n | [] => none\n | ((a, b) :: t) => if a < n then none else if a = n then some b else get n t","range":[2358,2765]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Linexp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Mathlib","Tactic","Linarith","Linexp"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (n : Nat) : Linexp → Option Int","range":[2628,2661]},"type":{"original":true,"pp":"Linexp → Option Int","range":[2640,2661]},"value":{"original":true,"pp":"\n | [] => none\n | ((a, b) :: t) => if a < n then none else if a = n then some b else get n t","range":[2664,2765]}},{"id":{"original":true,"range":[2848,2856]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`l.contains n` is true iff `n` is the first element of a pair in `l`.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[2767,2843],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp","contains"],"params":[{"bi":"default","id":[2858,2859],"ref":[2858,2859],"type":[2862,2865]}],"ref":{"original":true,"pp":"/-- `l.contains n` is true iff `n` is the first element of a pair in `l`.\n-/\ndef contains (n : Nat) : Linexp → Bool :=\n Option.isSome ∘ get n","range":[2767,2911]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Linexp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Mathlib","Tactic","Linarith","Linexp"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (n : Nat) : Linexp → Bool","range":[2857,2884]},"type":{"original":true,"pp":"Linexp → Bool","range":[2869,2884]},"value":{"original":true,"pp":" :=\n Option.isSome ∘ get n","range":[2885,2911]}},{"id":{"original":true,"range":[3012,3017]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`l.zfind n` returns the value associated with key `n` if there is one, and 0 otherwise.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[2913,3007],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp","zfind"],"params":[{"bi":"default","id":[3019,3020],"ref":[3019,3020],"type":[3023,3026]},{"bi":"default","id":[3029,3030],"ref":[3029,3030],"type":[3033,3039]}],"ref":{"original":true,"pp":"/-- `l.zfind n` returns the value associated with key `n` if there is one, and 0 otherwise.\n-/\ndef zfind (n : Nat) (l : Linexp) : Int :=\n match l.get n with\n | none => 0\n | some v => v","range":[2913,3100]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Linexp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Mathlib","Tactic","Linarith","Linexp"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (n : Nat) (l : Linexp) : Int","range":[3018,3046]},"type":{"original":true,"pp":"Int","range":[3043,3046]},"value":{"original":true,"pp":" :=\n match l.get n with\n | none => 0\n | some v => v","range":[3047,3100]}},{"id":{"original":true,"range":[3171,3175]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`l.vars` returns the list of variables that occur in `l`. ",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[3102,3166],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp","vars"],"params":[{"bi":"default","id":[3177,3178],"ref":[3177,3178],"type":[3181,3187]}],"ref":{"original":true,"pp":"/-- `l.vars` returns the list of variables that occur in `l`. -/\ndef vars (l : Linexp) : List Nat :=\n l.map Prod.fst","range":[3102,3219]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Linexp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Mathlib","Tactic","Linarith","Linexp"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (l : Linexp) : List Nat","range":[3176,3199]},"type":{"original":true,"pp":"List Nat","range":[3191,3199]},"value":{"original":true,"pp":" :=\n l.map Prod.fst","range":[3200,3219]}},{"id":{"original":true,"range":[3307,3310]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["Defines a lex ordering on `Linexp`. This function is performance critical.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[3221,3302],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Linexp","cmp"],"params":[],"ref":{"original":true,"pp":"/-- Defines a lex ordering on `Linexp`. This function is performance critical.\n-/\ndef cmp : Linexp → Linexp → Ordering\n | [], [] => Ordering.eq\n | [], _ => Ordering.lt\n | _, [] => Ordering.gt\n | ((n1, z1) :: t1), ((n2, z2) :: t2) =>\n if n1 < n2 then Ordering.lt\n else if n2 < n1 then Ordering.gt else if z1 < z2 then Ordering.lt else if z2 < z1 then Ordering.gt else cmp t1 t2","range":[3221,3617]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Linexp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Mathlib","Tactic","Linarith","Linexp"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Linexp → Linexp → Ordering","range":[3311,3343]},"type":{"original":true,"pp":"Linexp → Linexp → Ordering","range":[3313,3343]},"value":{"original":true,"pp":"\n | [], [] => Ordering.eq\n | [], _ => Ordering.lt\n | _, [] => Ordering.gt\n | ((n1, z1) :: t1), ((n2, z2) :: t2) =>\n if n1 < n2 then Ordering.lt\n else if n2 < n1 then Ordering.gt else if z1 < z2 then Ordering.lt else if z2 < z1 then Ordering.gt else cmp t1 t2","range":[3346,3617]}},{"id":{"original":false,"range":[4302,4311]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":[4302,4311],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","instInhabitedComp","default"],"params":[],"ref":{"original":false,"pp":"def default : @Mathlib.Tactic.Linarith.Comp✝ :=\n @Mathlib.Tactic.Linarith.Comp.mk Inhabited.default✝ Inhabited.default✝","range":[4302,4311]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","instInhabitedComp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith","instInhabitedComp"],["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":false,"pp":" : @Mathlib.Tactic.Linarith.Comp✝","range":[4302,4311]},"type":{"original":false,"pp":"@Mathlib.Tactic.Linarith.Comp✝","range":[4302,4311]},"value":{"original":false,"pp":" :=\n @Mathlib.Tactic.Linarith.Comp.mk Inhabited.default✝ Inhabited.default✝","range":[4302,4311]}},{"id":{"original":false,"range":[4302,4311]},"kind":"instance","modifiers":{"attrs":[],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":[4302,4311],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","instInhabitedComp"],"params":[],"ref":{"original":false,"pp":"instance instInhabitedComp : Inhabited✝ (@Mathlib.Tactic.Linarith.Comp✝) :=\n ⟨instInhabitedComp.default⟩","range":[4302,4311]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":false,"pp":" : Inhabited✝ (@Mathlib.Tactic.Linarith.Comp✝)","range":[4302,4311]},"type":{"original":false,"pp":"Inhabited✝ (@Mathlib.Tactic.Linarith.Comp✝)","range":[4302,4311]},"value":{"original":false,"pp":" :=\n ⟨instInhabitedComp.default⟩","range":[4302,4311]}},{"id":{"original":false,"range":[4313,4317]},"kind":"instance","modifiers":{"attrs":[],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":[4313,4317],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","instReprComp"],"params":[],"ref":{"original":false,"pp":"instance instReprComp : Repr✝ (@Mathlib.Tactic.Linarith.Comp✝) :=\n ⟨instReprComp.repr⟩","range":[4313,4317]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":false,"pp":" : Repr✝ (@Mathlib.Tactic.Linarith.Comp✝)","range":[4313,4317]},"type":{"original":false,"pp":"Repr✝ (@Mathlib.Tactic.Linarith.Comp✝)","range":[4313,4317]},"value":{"original":false,"pp":" :=\n ⟨instReprComp.repr⟩","range":[4313,4317]}},{"id":{"original":true,"range":[4558,4567]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`c.vars` returns the list of variables that appear in the linear expression contained in `c`. ",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[4453,4553],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Comp","vars"],"params":[],"ref":{"original":true,"pp":"/-- `c.vars` returns the list of variables that appear in the linear expression contained in `c`. -/\ndef vars : Comp → List Nat :=\n Linexp.vars ∘ Comp.coeffs","range":[4453,4618]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Comp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","Comp"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Comp → List Nat","range":[4568,4587]},"type":{"original":true,"pp":"Comp → List Nat","range":[4570,4587]},"value":{"original":true,"pp":" :=\n Linexp.vars ∘ Comp.coeffs","range":[4588,4618]}},{"id":{"original":true,"range":[4698,4710]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`c.coeffOf a` projects the coefficient of variable `a` out of `c`. ",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[4620,4693],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Comp","coeffOf"],"params":[{"bi":"default","id":[4712,4713],"ref":[4712,4713],"type":[4716,4720]},{"bi":"default","id":[4723,4724],"ref":[4723,4724],"type":[4727,4730]}],"ref":{"original":true,"pp":"/-- `c.coeffOf a` projects the coefficient of variable `a` out of `c`. -/\ndef coeffOf (c : Comp) (a : Nat) : Int :=\n c.coeffs.zfind a","range":[4620,4759]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Comp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","Comp"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (c : Comp) (a : Nat) : Int","range":[4711,4737]},"type":{"original":true,"pp":"Int","range":[4734,4737]},"value":{"original":true,"pp":" :=\n c.coeffs.zfind a","range":[4738,4759]}},{"id":{"original":true,"range":[4823,4833]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`c.scale n` scales the coefficients of `c` by `n`. ",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[4761,4818],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Comp","scale"],"params":[{"bi":"default","id":[4835,4836],"ref":[4835,4836],"type":[4839,4843]},{"bi":"default","id":[4846,4847],"ref":[4846,4847],"type":[4850,4853]}],"ref":{"original":true,"pp":"/-- `c.scale n` scales the coefficients of `c` by `n`. -/\ndef scale (c : Comp) (n : Nat) : Comp :=\n { c with coeffs := c.coeffs.scale n }","range":[4761,4904]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Comp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","Comp"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (c : Comp) (n : Nat) : Comp","range":[4834,4861]},"type":{"original":true,"pp":"Comp","range":[4857,4861]},"value":{"original":true,"pp":" :=\n { c with coeffs := c.coeffs.scale n }","range":[4862,4904]}},{"id":{"original":true,"range":[5088,5096]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`Comp.add c1 c2` adds the expressions represented by `c1` and `c2`.\nThe coefficient of variable `a` in `c1.add c2`\nis the sum of the coefficients of `a` in `c1` and `c2`.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[4906,5083],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Comp","add"],"params":[{"bi":"default","id":[5098,5100],"ref":[5098,5100],"type":[5106,5110]},{"bi":"default","id":[5101,5103],"ref":[5101,5103],"type":[5106,5110]}],"ref":{"original":true,"pp":"/-- `Comp.add c1 c2` adds the expressions represented by `c1` and `c2`.\nThe coefficient of variable `a` in `c1.add c2`\nis the sum of the coefficients of `a` in `c1` and `c2`.\n-/\ndef add (c1 c2 : Comp) : Comp :=\n ⟨c1.str.max c2.str, c1.coeffs.add c2.coeffs⟩","range":[4906,5172]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Comp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","Comp"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (c1 c2 : Comp) : Comp","range":[5097,5118]},"type":{"original":true,"pp":"Comp","range":[5114,5118]},"value":{"original":true,"pp":" :=\n ⟨c1.str.max c2.str, c1.coeffs.add c2.coeffs⟩","range":[5119,5172]}},{"id":{"original":true,"range":[5260,5268]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`Comp` has a lex order. First the `ineq`s are compared, then the `coeff`s. ",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[5174,5255],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Comp","cmp"],"params":[],"ref":{"original":true,"pp":"/-- `Comp` has a lex order. First the `ineq`s are compared, then the `coeff`s. -/\ndef cmp : Comp → Comp → Ordering\n | ⟨str1, coeffs1⟩, ⟨str2, coeffs2⟩ =>\n match str1.cmp str2 with\n | Ordering.lt => Ordering.lt\n | Ordering.gt => Ordering.gt\n | Ordering.eq => coeffs1.cmp coeffs2","range":[5174,5481]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Comp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","Comp"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Comp → Comp → Ordering","range":[5269,5297]},"type":{"original":true,"pp":"Comp → Comp → Ordering","range":[5271,5297]},"value":{"original":true,"pp":"\n | ⟨str1, coeffs1⟩, ⟨str2, coeffs2⟩ =>\n match str1.cmp str2 with\n | Ordering.lt => Ordering.lt\n | Ordering.gt => Ordering.gt\n | Ordering.eq => coeffs1.cmp coeffs2","range":[5300,5481]}},{"id":{"original":true,"range":[5632,5644]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["A `Comp` represents a contradiction if its expression has no coefficients and its strength is <,\nthat is, it represents the fact `0 < 0`.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[5483,5627],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Comp","isContr"],"params":[{"bi":"default","id":[5646,5647],"ref":[5646,5647],"type":[5650,5654]}],"ref":{"original":true,"pp":"/-- A `Comp` represents a contradiction if its expression has no coefficients and its strength is <,\nthat is, it represents the fact `0 < 0`.\n-/\ndef isContr (c : Comp) : Bool :=\n c.coeffs.isEmpty && c.str = Ineq.lt","range":[5483,5701]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Comp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","Comp"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (c : Comp) : Bool","range":[5645,5662]},"type":{"original":true,"pp":"Bool","range":[5658,5662]},"value":{"original":true,"pp":" :=\n c.coeffs.isEmpty && c.str = Ineq.lt","range":[5663,5701]}},{"id":{"original":true,"range":[5712,5725]},"kind":"instance","modifiers":{"attrs":[],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":null,"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Comp","ToFormat"],"params":[],"ref":{"original":true,"pp":"instance ToFormat : ToFormat Comp :=\n ⟨fun p => format p.coeffs ++ toString p.str ++ \"0\"⟩","range":[5703,5802]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Comp"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","Comp"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : ToFormat Comp","range":[5726,5741]},"type":{"original":true,"pp":"ToFormat Comp","range":[5728,5741]},"value":{"original":true,"pp":" :=\n ⟨fun p => format p.coeffs ++ toString p.str ++ \"0\"⟩","range":[5742,5802]}},{"id":{"original":true,"range":[7423,7429]},"kind":"definition","modifiers":{"attrs":[{"kind":"global","name":["expose"],"stx":[7411,7417]}],"computeKind":"regular","docString":["Some preprocessors perform branching case splits. A `Branch` is used to track one of these case\nsplits. The first component, an `MVarId`, is the goal corresponding to this branch of the split,\ngiven as a metavariable. The `List Expr` component is the list of hypotheses for `linarith`\nin this branch.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[7101,7418],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Branch"],"params":[],"ref":{"original":true,"pp":"/-- Some preprocessors perform branching case splits. A `Branch` is used to track one of these case\nsplits. The first component, an `MVarId`, is the goal corresponding to this branch of the split,\ngiven as a metavariable. The `List Expr` component is the list of hypotheses for `linarith`\nin this branch.\n-/\n@[expose]\ndef Branch : Type :=\n MVarId × List Expr","range":[7101,7459]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Type","range":[7430,7436]},"type":{"original":true,"pp":"Type","range":[7432,7436]},"value":{"original":true,"pp":" :=\n MVarId × List Expr","range":[7437,7459]}},{"id":{"original":true,"range":[8141,8163]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["A `Preprocessor` lifts to a `GlobalPreprocessor` by folding it over the input list.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[8046,8136],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","Preprocessor","globalize"],"params":[{"bi":"default","id":[8165,8167],"ref":[8165,8167],"type":[8170,8182]}],"ref":{"original":true,"pp":"/-- A `Preprocessor` lifts to a `GlobalPreprocessor` by folding it over the input list.\n-/\ndef globalize (pp : Preprocessor) : GlobalPreprocessor\n where\n __ := pp\n transform :=\n List.foldrM\n (fun e ret => do\n return (← pp.transform e) ++ ret)\n []","range":[8046,8304]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","Preprocessor"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic","Linarith","Preprocessor"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (pp : Preprocessor) : GlobalPreprocessor","range":[8164,8204]},"type":{"original":true,"pp":"GlobalPreprocessor","range":[8186,8204]},"value":{"original":true,"pp":" where\n __ := pp\n transform :=\n List.foldrM\n (fun e ret => do\n return (← pp.transform e) ++ ret)\n []","range":[8205,8304]}},{"id":{"original":true,"range":[8411,8439]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["A `GlobalPreprocessor` lifts to a `GlobalBranchingPreprocessor` by producing only one branch.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[8306,8406],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","GlobalPreprocessor","branching"],"params":[{"bi":"default","id":[8441,8443],"ref":[8441,8443],"type":[8446,8464]}],"ref":{"original":true,"pp":"/-- A `GlobalPreprocessor` lifts to a `GlobalBranchingPreprocessor` by producing only one branch.\n-/\ndef branching (pp : GlobalPreprocessor) : GlobalBranchingPreprocessor\n where\n __ := pp\n transform := fun g l => do\n return [⟨g, ← pp.transform l⟩]","range":[8306,8578]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","GlobalPreprocessor"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Mathlib","Tactic","Linarith","GlobalPreprocessor"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (pp : GlobalPreprocessor) : GlobalBranchingPreprocessor","range":[8440,8495]},"type":{"original":true,"pp":"GlobalBranchingPreprocessor","range":[8468,8495]},"value":{"original":true,"pp":" where\n __ := pp\n transform := fun g l => do\n return [⟨g, ← pp.transform l⟩]","range":[8496,8578]}},{"id":{"original":true,"range":[8703,8738]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`process pp l` runs `pp.transform` on `l` and returns the result,\ntracing the result if `trace.linarith` is on.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[8580,8698],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","GlobalBranchingPreprocessor","process"],"params":[{"bi":"default","id":[8740,8742],"ref":[8740,8742],"type":[8745,8772]},{"bi":"default","id":[8779,8780],"ref":[8779,8780],"type":[8783,8789]},{"bi":"default","id":[8792,8793],"ref":[8792,8793],"type":[8796,8805]}],"ref":{"original":true,"range":[8580,9232]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith","GlobalBranchingPreprocessor"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith","GlobalBranchingPreprocessor"],["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (pp : GlobalBranchingPreprocessor) (g : MVarId) (l : List Expr) : MetaM (List Branch)","range":[8739,8828]},"type":{"original":true,"pp":"MetaM (List Branch)","range":[8809,8828]},"value":{"original":true,"range":[8829,9232]}},{"id":{"original":true,"range":[9243,9284]},"kind":"instance","modifiers":{"attrs":[],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":null,"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","PreprocessorToGlobalBranchingPreprocessor"],"params":[],"ref":{"original":true,"pp":"instance PreprocessorToGlobalBranchingPreprocessor : Coe Preprocessor GlobalBranchingPreprocessor :=\n ⟨GlobalPreprocessor.branching ∘ Preprocessor.globalize⟩","range":[9234,9402]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Coe Preprocessor GlobalBranchingPreprocessor","range":[9285,9335]},"type":{"original":true,"pp":"Coe Preprocessor GlobalBranchingPreprocessor","range":[9291,9335]},"value":{"original":true,"pp":" :=\n ⟨GlobalPreprocessor.branching ∘ Preprocessor.globalize⟩","range":[9336,9402]}},{"id":{"original":true,"range":[9413,9460]},"kind":"instance","modifiers":{"attrs":[],"computeKind":"regular","isProtected":false,"isUnsafe":false,"recKind":"default","stx":null,"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","GlobalPreprocessorToGlobalBranchingPreprocessor"],"params":[],"ref":{"original":true,"pp":"instance GlobalPreprocessorToGlobalBranchingPreprocessor : Coe GlobalPreprocessor GlobalBranchingPreprocessor :=\n ⟨GlobalPreprocessor.branching⟩","range":[9404,9557]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" : Coe GlobalPreprocessor GlobalBranchingPreprocessor","range":[9461,9517]},"type":{"original":true,"pp":"Coe GlobalPreprocessor GlobalBranchingPreprocessor","range":[9467,9517]},"value":{"original":true,"pp":" :=\n ⟨GlobalPreprocessor.branching⟩","range":[9518,9557]}},{"id":{"original":true,"range":[10672,10688]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`parseCompAndExpr e` checks if `e` is of the form `t < 0`, `t ≤ 0`, or `t = 0`.\nIf it is, it returns the comparison along with `t`.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[10527,10667],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","parseCompAndExpr"],"params":[{"bi":"default","id":[10690,10691],"ref":[10690,10691],"type":[10694,10698]}],"ref":{"original":true,"pp":"/-- `parseCompAndExpr e` checks if `e` is of the form `t < 0`, `t ≤ 0`, or `t = 0`.\nIf it is, it returns the comparison along with `t`.\n-/\ndef parseCompAndExpr (e : Expr) : MetaM (Ineq × Expr) := do\n let (rel, _, e, z) ← e.ineq?\n if z.zero? then \n return (rel, e)\n else\n throwError \"invalid comparison, rhs not zero: {z}\"","range":[10527,10851]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (e : Expr) : MetaM (Ineq × Expr)","range":[10689,10722]},"type":{"original":true,"pp":"MetaM (Ineq × Expr)","range":[10702,10722]},"value":{"original":true,"pp":" := do\n let (rel, _, e, z) ← e.ineq?\n if z.zero? then \n return (rel, e)\n else\n throwError \"invalid comparison, rhs not zero: {z}\"","range":[10723,10851]}},{"id":{"original":true,"range":[11183,11201]},"kind":"definition","modifiers":{"attrs":[],"computeKind":"regular","docString":["`mkSingleCompZeroOf c h` assumes that `h` is a proof of `t R 0`.\nIt produces a pair `(R', h')`, where `h'` is a proof of `c*t R' 0`.\nTypically `R` and `R'` will be the same, except when `c = 0`, in which case `R'` is `=`.\nIf `c = 1`, `h'` is the same as `h` -- specifically, it does *not* change the type to `1*t R 0`.\n",false],"isProtected":false,"isUnsafe":false,"recKind":"default","stx":[10853,11178],"visibility":"regular"},"name":["Mathlib","Tactic","Linarith","mkSingleCompZeroOf"],"params":[{"bi":"default","id":[11203,11204],"ref":[11203,11204],"type":[11207,11210]},{"bi":"default","id":[11213,11214],"ref":[11213,11214],"type":[11217,11221]}],"ref":{"original":true,"pp":"/-- `mkSingleCompZeroOf c h` assumes that `h` is a proof of `t R 0`.\nIt produces a pair `(R', h')`, where `h'` is a proof of `c*t R' 0`.\nTypically `R` and `R'` will be the same, except when `c = 0`, in which case `R'` is `=`.\nIf `c = 1`, `h'` is the same as `h` -- specifically, it does *not* change the type to `1*t R 0`.\n-/\ndef mkSingleCompZeroOf (c : Nat) (h : Expr) : MetaM (Ineq × Expr) := do\n let tp ← inferType h\n let (iq, e) ← parseCompAndExpr tp\n if c = 0 then \n do\n let e' ← mkAppM ``zero_mul #[e]\n return (Ineq.eq, e')\n else if c = 1 then\n return (iq, h)\n else\n do\n let (_, tp, _) ← tp.ineq?\n let cpos : Q(Prop) ← mkAppM ``GT.gt #[(← tp.ofNat c), (← tp.ofNat 0)]\n let ex ← synthesizeUsingTactic' cpos (← `(tactic| norm_num))\n let e' ← mkAppM iq.toConstMulName #[h, ex]\n return (iq, e')","range":[10853,11692]},"scopeInfo":{"currNamespace":["Mathlib","Tactic","Linarith"],"includeVars":[],"levelNames":[],"omitVars":[],"openDecl":[{"simple":{"except":[],"namespace":["Qq"]}},{"simple":{"except":[],"namespace":["Lean","Meta"]}},{"simple":{"except":[],"namespace":["Lean","Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab","Tactic"]}},{"simple":{"except":[],"namespace":["Tactic"]}},{"simple":{"except":[],"namespace":["Lean","Elab"]}},{"simple":{"except":[],"namespace":["Lean"]}}],"scopedOpenDecl":[["Mathlib","Tactic","Linarith"],["Tactic"],["Lean","Elab"],["Lean"],["Qq"],["Lean","Elab","Tactic"],["Lean","Meta"],["Lean","Tactic"],["Mathlib"],["Mathlib","Tactic"]],"varDecls":[]},"signature":{"original":true,"pp":" (c : Nat) (h : Expr) : MetaM (Ineq × Expr)","range":[11202,11245]},"type":{"original":true,"pp":"MetaM (Ineq × Expr)","range":[11225,11245]},"value":{"original":true,"pp":" := do\n let tp ← inferType h\n let (iq, e) ← parseCompAndExpr tp\n if c = 0 then \n do\n let e' ← mkAppM ``zero_mul #[e]\n return (Ineq.eq, e')\n else if c = 1 then\n return (iq, h)\n else\n do\n let (_, tp, _) ← tp.ineq?\n let cpos : Q(Prop) ← mkAppM ``GT.gt #[(← tp.ofNat c), (← tp.ofNat 0)]\n let ex ← synthesizeUsingTactic' cpos (← `(tactic| norm_num))\n let e' ← mkAppM iq.toConstMulName #[h, ex]\n return (iq, e')","range":[11246,11692]}}]