Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Mathlib/Algebra/FreeMonoid/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ theorem length_eq_zero : length a = 0 ↔ a = 1 := List.length_eq_zero_iff
@[to_additive (attr := simp)]
theorem length_of (m : α) : length (of m) = 1 := rfl

@[to_additive]
theorem length_surjective [hα : Nonempty α] : (@length α).Surjective :=
hα.elim fun a n => ⟨FreeMonoid.ofList (List.replicate n a), by simp [length]⟩

@[to_additive FreeAddMonoid.length_eq_one]
theorem length_eq_one : length a = 1 ↔ ∃ m, a = FreeMonoid.of m :=
List.length_eq_one_iff
Expand Down
Loading