lean4-htt/tests/lean/run/1842.lean
Kim Morrison 1e02c08111
feat: basic material on List.Pairwise and Nodup (#4706)
Upstreaming of basic material on `List.Pairwise` and `List.Nodup`. More
complete API to follow later, this is just a first approximation of what
leansat will need.
2024-07-09 21:39:08 +00:00

10 lines
463 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

variable (R : αα → Prop)
inductive List.Pairwise' : List α → Prop
| nil : Pairwise' []
| cons : ∀ {a : α} {l : List α}, (∀ {a} (_ : a' ∈ l), R a a') → Pairwise' l → Pairwise' (a :: l)
theorem pairwise_append {l₁ l₂ : List α} :
(l₁ ++ l₂).Pairwise' R ↔ l₁.Pairwise' R ∧ l₂.Pairwise' R ∧ ∀ {a} (_ : a ∈ l₁), ∀ {b} (_ : b ∈ l₂), R a b := by
induction l₁ <;> simp [*, and_left_comm]
repeat sorry