Equations
Instances For
Equations
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.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
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
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