2015-07-24 01:49:50 +00:00
|
|
|
theorem perm.perm_erase_dup_of_perm [congr] : ∀ {A : Type} [H : decidable_eq A] {l₁ l₂ : list A}, l₁ ~ l₂ → erase_dup l₁ ~ erase_dup l₂ :=
|
2016-06-01 02:14:42 +00:00
|
|
|
λ A H l₁ l₂ p,
|
2015-07-24 01:49:50 +00:00
|
|
|
perm_induction_on p nil
|
2016-06-01 02:14:42 +00:00
|
|
|
(λ x t₁ t₂ p r,
|
|
|
|
decidable.by_cases (λ xint₁, have xint₂ : x ∈ t₂, from mem_of_mem_erase_dup …, … …)
|
|
|
|
(λ nxint₁, have nxint₂ : x ∉ t₂, from λ xint₂, … nxint₁, eq.rec … (eq.symm …)))
|
|
|
|
(λ y x t₁ t₂ p r,
|
2015-07-24 01:49:50 +00:00
|
|
|
decidable.by_cases
|
2016-06-01 02:14:42 +00:00
|
|
|
(λ xinyt₁, decidable.by_cases (λ yint₁, …) (λ nyint₁, have nyint₂ : …, from …, …))
|
|
|
|
(λ nxinyt₁,
|
2015-07-24 01:49:50 +00:00
|
|
|
have xney : x ≠ y, from ne_of_not_mem_cons nxinyt₁,
|
|
|
|
have nxint₁ : x ∉ t₁, from not_mem_of_not_mem_cons nxinyt₁,
|
2016-06-01 02:14:42 +00:00
|
|
|
have nxint₂ : x ∉ t₂, from λ xint₂, …,
|
2015-07-24 01:49:50 +00:00
|
|
|
… …))
|
2016-06-01 02:14:42 +00:00
|
|
|
(λ t₁ t₂ t₃ p₁ p₂, trans)
|