Loogle!
Result
Found 3 declarations mentioning List.get and GetElem.getElem.
- List.get_eq_getElem π Init.Data.List.Lemmas
{Ξ± : Type u_1} {l : List Ξ±} {i : Fin l.length} : l.get i = l[βi] - Std.Tactic.BVDecide.LRAT.Internal.DefaultFormula.DerivedLitsInvariant.eq_1 π Std.Tactic.BVDecide.LRAT.Internal.Formula.RupAddResult
{n : β} (f : Std.Tactic.BVDecide.LRAT.Internal.DefaultFormula n) (fassignments_size : f.assignments.size = n) (assignments : Array Std.Tactic.BVDecide.LRAT.Internal.Assignment) (assignments_size : assignments.size = n) (derivedLits : Std.Sat.CNF.Clause (Std.Tactic.BVDecide.LRAT.Internal.PosFin n)) : f.DerivedLitsInvariant fassignments_size assignments assignments_size derivedLits = β (i : Fin n), have i_lt_assignments_size := β―; have i_lt_f_assignments_size := β―; have assignments_i := assignments[βi]; have fassignments_i := f.assignments[βi]; (assignments_i = fassignments_i β§ β l β derivedLits, βl.1 β βi) β¨ (β j, β(List.get derivedLits j).1 = βi β§ assignments_i = Std.Tactic.BVDecide.LRAT.Internal.Assignment.addAssignment (List.get derivedLits j).2 fassignments_i β§ Β¬Std.Tactic.BVDecide.LRAT.Internal.Assignment.hasAssignment (List.get derivedLits j).2 fassignments_i = true β§ β (k : Fin (List.length derivedLits)), k β j β β(List.get derivedLits k).1 β βi) β¨ β j1 j2, β(List.get derivedLits j1).1 = βi β§ β(List.get derivedLits j2).1 = βi β§ (List.get derivedLits j1).2 = true β§ (List.get derivedLits j2).2 = false β§ assignments_i = Std.Tactic.BVDecide.LRAT.Internal.Assignment.both β§ fassignments_i = Std.Tactic.BVDecide.LRAT.Internal.Assignment.unassigned β§ β (k : Fin (List.length derivedLits)), k β j1 β k β j2 β β(List.get derivedLits k).1 β βi - List.get_eq_getElem? π Mathlib.Data.List.Basic
{Ξ± : Type u} (l : List Ξ±) (i : Fin l.length) : l.get i = l[i]?.get β―
About
Loogle searches Lean and Mathlib definitions and theorems.
You can use Loogle from within the Lean4 VSCode language extension
using (by default) Ctrl-K Ctrl-S. You can also try the
#loogle command from LeanSearchClient,
the CLI version, the Loogle
VS Code extension, the lean.nvim
integration or the Zulip bot.
Usage
Loogle finds definitions and lemmas in various ways:
By constant:
πReal.sin
finds all lemmas whose statement somehow mentions the sine function.By lemma name substring:
π"differ"
finds all lemmas that have"differ"somewhere in their lemma name.By subexpression:
π_ * (_ ^ _)
finds all lemmas whose statements somewhere include a product where the second argument is raised to some power.The pattern can also be non-linear, as in
πReal.sqrt ?a * Real.sqrt ?aIf the pattern has parameters, they are matched in any order. Both of these will find
List.map:
π(?a -> ?b) -> List ?a -> List ?b
πList ?a -> (?a -> ?b) -> List ?bBy main conclusion:
π|- tsum _ = _ * tsum _
finds all lemmas where the conclusion (the subexpression to the right of allβandβ) has the given shape.As before, if the pattern has parameters, they are matched against the hypotheses of the lemma in any order; for example,
π|- _ < _ β tsum _ < tsum _
will findtsum_lt_tsumeven though the hypothesisf i < g iis not the last.
If you pass more than one such search filter, separated by commas
Loogle will return lemmas which match all of them. The
search
π Real.sin, "two", tsum, _ * _, _ ^ _, |- _ < _ β _
would find all lemmas which mention the constants Real.sin
and tsum, have "two" as a substring of the
lemma name, include a product and a power somewhere in the type,
and have a hypothesis of the form _ < _ (if
there were any such lemmas). Metavariables (?a) are
assigned independently in each filter.
The #lucky button will directly send you to the
documentation of the first hit.
Source code
You can find the source code for this service at https://github.com/nomeata/loogle. The https://loogle.lean-lang.org/ service is provided by the Lean FRO.
This is Loogle revision 187ba29 serving mathlib revision f4dee01