chore: simplify Char.toString to String.singleton (#12449)
This PR marks `String.toString_eq_singleton` as a `simp` lemma.
This commit is contained in:
parent
9073ad37bb
commit
7b29425361
2 changed files with 4 additions and 2 deletions
|
|
@ -83,6 +83,7 @@ def notLTTotal : Std.Total (¬ · < · : Char → Char → Prop) where
|
|||
@[simp]
|
||||
theorem toUInt8_val {c : Char} : c.val.toUInt8 = c.toUInt8 := rfl
|
||||
|
||||
@[simp]
|
||||
theorem toString_eq_singleton {c : Char} : c.toString = String.singleton c := rfl
|
||||
|
||||
end Char
|
||||
|
|
|
|||
|
|
@ -3085,7 +3085,8 @@ end String
|
|||
|
||||
namespace Char
|
||||
|
||||
@[simp] theorem length_toString (c : Char) : c.toString.length = 1 := by
|
||||
simp [toString_eq_singleton]
|
||||
@[deprecated String.length_singleton (since := "2026-02-12")]
|
||||
theorem length_toString (c : Char) : c.toString.length = 1 := by
|
||||
simp
|
||||
|
||||
end Char
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue