Equations
- Lean.instCoeStringName = { coe := Lean.Name.mkSimple }
@[export lean_name_hash_exported]
Equations
Instances For
Equations
- Lean.Name.getPrefix x = match x with | Lean.Name.anonymous => Lean.Name.anonymous | Lean.Name.str p str => p | Lean.Name.num p i => p
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.Name.eqStr x x = match x, x with | Lean.Name.str Lean.Name.anonymous s, s' => s == s' | x, x_1 => false
Instances For
Equations
- Lean.Name.isPrefixOf x Lean.Name.anonymous = (x == Lean.Name.anonymous)
- Lean.Name.isPrefixOf x (Lean.Name.num p' i) = (x == Lean.Name.num p' i || Lean.Name.isPrefixOf x p')
- Lean.Name.isPrefixOf x (Lean.Name.str p' str) = (x == Lean.Name.str p' str || Lean.Name.isPrefixOf x p')
Instances For
Equations
- Lean.Name.isSuffixOf Lean.Name.anonymous x = true
- Lean.Name.isSuffixOf (Lean.Name.str p₁ s₁) (Lean.Name.str p₂ s₂) = (s₁ == s₂ && Lean.Name.isSuffixOf p₁ p₂)
- Lean.Name.isSuffixOf (Lean.Name.num p₁ n₁) (Lean.Name.num p₂ n₂) = (n₁ == n₂ && Lean.Name.isSuffixOf p₁ p₂)
- Lean.Name.isSuffixOf x x = false
Instances For
Equations
- Lean.Name.cmp Lean.Name.anonymous Lean.Name.anonymous = Ordering.eq
- Lean.Name.cmp Lean.Name.anonymous x = Ordering.lt
- Lean.Name.cmp x Lean.Name.anonymous = Ordering.gt
- Lean.Name.cmp (Lean.Name.num p₁ i₁) (Lean.Name.num p₂ i₂) = match Lean.Name.cmp p₁ p₂ with | Ordering.eq => compare i₁ i₂ | ord => ord
- Lean.Name.cmp (Lean.Name.num pre i) (Lean.Name.str pre_1 str) = Ordering.lt
- Lean.Name.cmp (Lean.Name.str pre str) (Lean.Name.num pre_1 i) = Ordering.gt
- Lean.Name.cmp (Lean.Name.str p₁ n₁) (Lean.Name.str p₂ n₂) = match Lean.Name.cmp p₁ p₂ with | Ordering.eq => compare n₁ n₂ | ord => ord
Instances For
Equations
- Lean.Name.lt x y = (Lean.Name.cmp x y == Ordering.lt)
Instances For
Equations
- Lean.Name.quickCmpAux Lean.Name.anonymous Lean.Name.anonymous = Ordering.eq
- Lean.Name.quickCmpAux Lean.Name.anonymous x = Ordering.lt
- Lean.Name.quickCmpAux x Lean.Name.anonymous = Ordering.gt
- Lean.Name.quickCmpAux (Lean.Name.num p₁ i₁) (Lean.Name.num p₂ i₂) = match compare i₁ i₂ with | Ordering.eq => Lean.Name.quickCmpAux p₁ p₂ | ord => ord
- Lean.Name.quickCmpAux (Lean.Name.num pre i) (Lean.Name.str pre_1 str) = Ordering.lt
- Lean.Name.quickCmpAux (Lean.Name.str pre str) (Lean.Name.num pre_1 i) = Ordering.gt
- Lean.Name.quickCmpAux (Lean.Name.str p₁ n₁) (Lean.Name.str p₂ n₂) = match compare n₁ n₂ with | Ordering.eq => Lean.Name.quickCmpAux p₁ p₂ | ord => ord
Instances For
Equations
- Lean.Name.quickCmp n₁ n₂ = match compare (Lean.Name.hash n₁) (Lean.Name.hash n₂) with | Ordering.eq => Lean.Name.quickCmpAux n₁ n₂ | ord => ord
Instances For
Equations
- Lean.Name.quickLt n₁ n₂ = (Lean.Name.quickCmp n₁ n₂ == Ordering.lt)
Instances For
The frontend does not allow user declarations to start with _
in any of its parts.
We use name parts starting with _
internally to create auxiliary names (e.g., _private
).
Equations
Instances For
Checks whether the name is an implementation-detail hypothesis name.
Implementation-detail hypothesis names start with a double underscore.
Equations
- Lean.Name.isImplementationDetail (Lean.Name.str Lean.Name.anonymous s) = String.startsWith s "__"
- Lean.Name.isImplementationDetail (Lean.Name.num p i) = Lean.Name.isImplementationDetail p
- Lean.Name.isImplementationDetail (Lean.Name.str p str) = Lean.Name.isImplementationDetail p
- Lean.Name.isImplementationDetail Lean.Name.anonymous = false
Instances For
Equations
- Lean.Name.isAtomic x = match x with | Lean.Name.anonymous => true | Lean.Name.str Lean.Name.anonymous str => true | Lean.Name.num Lean.Name.anonymous i => true | x => false
Instances For
Equations
- Lean.Name.isAnonymous x = match x with | Lean.Name.anonymous => true | x => false
Instances For
Equations
- Lean.Name.isStr x = match x with | Lean.Name.str pre str => true | x => false
Instances For
Equations
- Lean.Name.isNum x = match x with | Lean.Name.num pre i => true | x => false
Instances For
Return true
if n
contains a string part s
that satifies f
.
Examples:
#eval (`foo.bla).anyS (·.startsWith "fo") -- true
#eval (`foo.bla).anyS (·.startsWith "boo") -- false
Equations
- Lean.Name.anyS (Lean.Name.str p s) f = (f s || Lean.Name.anyS p f)
- Lean.Name.anyS (Lean.Name.num p i) f = Lean.Name.anyS p f
- Lean.Name.anyS n f = false