Documentation

Std.Data.String.ToNat

theorem String.Slice.isNat_of_isDigit {s : Slice} (hne : s.isEmpty = false) (hdigit : ∀ (c : Char), c s.copy.toListc.isDigit = true) :
theorem String.Slice.isNat_congr {s t : Slice} (h : s.copy = t.copy) :
theorem String.isNat_iff {s : String} :
s.isNat = true s "" (∀ (c : Char), c s.toListc.isDigit = true c = '_') ¬['_', '_'] <:+: s.toList s.toList.head? some '_' s.toList.getLast? some '_'
theorem String.isNat_of_isDigit {s : String} (hne : s "") (hdigit : ∀ (c : Char), c s.toListc.isDigit = true) :
theorem String.isNat_append_underscore_append {s t : String} (hs : s.isNat = true) (ht : t.isNat = true) :
(s ++ "_" ++ t).isNat = true
theorem String.toNat?_append_underscore_append_eq_some {s t : String} {n m : Nat} (hs : s.toNat? = some n) (ht : t.toNat? = some m) :
(s ++ "_" ++ t).toNat? = some (10 ^ (List.filter (fun (x : Char) => x != '_') t.toList).length * n + m)
@[simp]
theorem Nat.isNat_repr (n : Nat) :
@[simp]
theorem Nat.toNat?_repr (n : Nat) :
theorem Nat.repr_injective {m n : Nat} (h : m.repr = n.repr) :
m = n
@[simp]
theorem Nat.repr_inj {m n : Nat} :
m.repr = n.repr m = n