Skip to content

Commit

Permalink
chore: remove theorem
Browse files Browse the repository at this point in the history
I moved the theorem to another pull request:
leanprover-community#994.
  • Loading branch information
chabulhwi committed Oct 16, 2024
1 parent 1d57ce4 commit 7c5ef34
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions Batteries/Data/List/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -500,25 +500,6 @@ theorem ne_nil_of_not_prefix (h : ¬l₁ <+: l₂) : l₁ ≠ [] := by
intro heq
simp [heq, nil_prefix] at h

theorem not_prefix_and_not_prefix_symm_iff_exists [BEq α] [LawfulBEq α] [DecidableEq α]
{l₁ l₂ : List α} : ¬l₁ <+: l₂ ∧ ¬l₂ <+: l₁ ↔ ∃ c₁ c₂ pre suf₁ suf₂, c₁ ≠ c₂ ∧
l₁ = pre ++ c₁ :: suf₁ ∧ l₂ = pre ++ c₂ :: suf₂ := by
constructor <;> intro h
· obtain ⟨c₁, l₁, rfl⟩ := l₁.exists_cons_of_ne_nil (ne_nil_of_not_prefix h.1)
obtain ⟨c₂, l₂, rfl⟩ := l₂.exists_cons_of_ne_nil (ne_nil_of_not_prefix h.2)
simp only [cons_prefix_cons, not_and] at h
cases Decidable.em (c₁ = c₂)
· subst c₂
simp only [forall_const] at h
let ⟨c₁', c₂', pre, suf₁, suf₂, hc, heq₁, heq₂⟩ :=
not_prefix_and_not_prefix_symm_iff_exists.mp h
exact ⟨c₁', c₂', c₁::pre, suf₁, suf₂, hc, by simp [heq₁], by simp [heq₂]⟩
· next hc =>
exact ⟨c₁, c₂, [], l₁, l₂, hc, nil_append .., nil_append ..⟩
· let ⟨c₁, c₂, pre, suf₁, suf₂, hc, heq₁, heq₂⟩ := h
rw [heq₁, heq₂]
simp [prefix_append_right_inj, cons_prefix_cons, hc, hc.symm]

/-! ### drop -/

theorem disjoint_take_drop : ∀ {l : List α}, l.Nodup → m ≤ n → Disjoint (l.take m) (l.drop n)
Expand Down

0 comments on commit 7c5ef34

Please sign in to comment.