Skip to content

Commit d2084c0

Browse files
committed
Improve lemmas
1 parent 747073f commit d2084c0

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

TraceTheory/TraceTheory/Language.lean

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -857,20 +857,23 @@ lemma connectedComponents_of_connected (T : Set (Trace I)) (h : ∀ t ∈ T, isC
857857

858858

859859

860-
lemma empty_inj_emptyTrace (w : List α) (h : (⟦w⟧ : Trace I) = ⟦[]⟧) : w = [] := by
860+
lemma empty_iff {w : List α} : (⟦w⟧ : Trace I) = ⟦[]⟧ w = [] := by
861861
cases w with
862862
| nil => simp
863863
| cons a u =>
864-
have h_au := length_eq_of_equiv (Quotient.exact h)
865-
simp at h_au
864+
apply Iff.intro
865+
· intro h
866+
have h_au := length_eq_of_equiv (Quotient.exact h)
867+
simp at h_au
868+
· simp
866869

867870
def isEmpty : Trace I → Bool := Quotient.lift List.isEmpty (by
868871
intro u v huv
869872
cases u with
870-
| nil => rw [empty_inj_emptyTrace _ (Eq.symm (Quotient.sound huv))]
873+
| nil => rw [empty_iff.mp (Eq.symm (Quotient.sound huv))]
871874
| cons a u =>
872875
cases v with
873-
| nil => rw [empty_inj_emptyTrace _ (Quotient.sound huv)]
876+
| nil => rw [empty_iff.mp (Quotient.sound huv)]
874877
| cons b v => rfl
875878
)
876879

0 commit comments

Comments
 (0)