Skip to content

Commit 30608c5

Browse files
another simpler proof
1 parent a45871b commit 30608c5

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Mathlib/Data/List/Shortlex.lean

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,14 @@ theorem of_lex {s t : List α} (h : s.length = t.length) (h2 : List.Lex r s t) :
6464
right
6565
exact ⟨h, h2⟩
6666

67+
theorem _root_.List.shortlex_def {s t : List α} : Shortlex r s t ↔
68+
s.length < t.length ∨ s.length = t.length ∧ List.Lex r s t := Prod.lex_def
69+
6770
/-- If two lists `s` and `t` have the same length, `s` is smaller than `t` under the shortlex order
6871
over a relation `r` exactly when `s` is smaller than `t` under the lexicographic order over `r`.-/
6972
theorem _root_.List.shortlex_iff_lex {s t : List α} (h : s.length = t.length) :
7073
Shortlex r s t ↔ List.Lex r s t := by
71-
constructor
72-
· intro h2
73-
rw [Shortlex, InvImage, Prod.lex_def, h, lt_self_iff_false, false_or] at h2
74-
simp only [true_and] at h2
75-
exact h2
76-
exact fun h1 => of_lex h h1
77-
78-
theorem _root_.List.shortlex_def {s t : List α} : Shortlex r s t ↔
79-
s.length < t.length ∨ s.length = t.length ∧ List.Lex r s t := Prod.lex_def
74+
simp [shortlex_def, h]
8075

8176
theorem cons_iff [IsIrrefl α r] {a : α} {s t : List α} : Shortlex r (a :: s) (a :: t) ↔
8277
Shortlex r s t := by

0 commit comments

Comments
 (0)