Theorem: List.perm_replicate_append_replicate
File: Mathlib/Data/List/Perm.lean

tactic: rw [perm_iff_count, ← Decidable.and_forall_ne a, ← Decidable.and_forall_ne b]
state_before: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ l ~ replicate m a ++ replicate n b ↔ count a l = m ∧ count b l = n ∧ l ⊆ [a, b]
state_after: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ (count a l = count a (replicate m a ++ replicate n b) ∧
      (b ≠ a → count b l = count b (replicate m a ++ replicate n b)) ∧
        ∀ (b_1 : α), b_1 ≠ b → b_1 ≠ a → count b_1 l = count b_1 (replicate m a ++ replicate n b)) ↔
    count a l = m ∧ count b l = n ∧ l ⊆ [a, b]

tactic: suffices l ⊆ [a, b] ↔ ∀ c, c ≠ b → c ≠ a → c ∉ l by
  simp (config := { contextual := true }) [count_replicate, h, h.symm, this, count_eq_zero]
state_before: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ (count a l = count a (replicate m a ++ replicate n b) ∧
      (b ≠ a → count b l = count b (replicate m a ++ replicate n b)) ∧
        ∀ (b_1 : α), b_1 ≠ b → b_1 ≠ a → count b_1 l = count b_1 (replicate m a ++ replicate n b)) ↔
    count a l = m ∧ count b l = n ∧ l ⊆ [a, b]
state_after: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ l ⊆ [a, b] ↔ ∀ (c : α), c ≠ b → c ≠ a → c ∉ l

tactic: trans ∀ c, c ∈ l → c = b ∨ c = a
state_before: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ l ⊆ [a, b] ↔ ∀ (c : α), c ≠ b → c ≠ a → c ∉ l
state_after: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ l ⊆ [a, b] ↔ ∀ c ∈ l, c = b ∨ c = a

α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ (∀ c ∈ l, c = b ∨ c = a) ↔ ∀ (c : α), c ≠ b → c ≠ a → c ∉ l

tactic: simp (config := { contextual := true }) [count_replicate, h, h.symm, this, count_eq_zero]
state_before: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
this : l ⊆ [a, b] ↔ ∀ (c : α), c ≠ b → c ≠ a → c ∉ l
⊢ (count a l = count a (replicate m a ++ replicate n b) ∧
      (b ≠ a → count b l = count b (replicate m a ++ replicate n b)) ∧
        ∀ (b_1 : α), b_1 ≠ b → b_1 ≠ a → count b_1 l = count b_1 (replicate m a ++ replicate n b)) ↔
    count a l = m ∧ count b l = n ∧ l ⊆ [a, b]
state_after: no goals

tactic: simp [subset_def, or_comm]
state_before: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ l ⊆ [a, b] ↔ ∀ c ∈ l, c = b ∨ c = a
state_after: no goals

tactic: exact forall_congr' fun _ => by rw [← and_imp, ← not_or, not_imp_not]
state_before: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
⊢ (∀ c ∈ l, c = b ∨ c = a) ↔ ∀ (c : α), c ≠ b → c ≠ a → c ∉ l
state_after: no goals

tactic: rw [← and_imp, ← not_or, not_imp_not]
state_before: α : Type u_1
β : Type u_2
l✝ l₁ l₂ : List α
a✝ : α
inst✝ : DecidableEq α
l : List α
a b : α
m n : ℕ
h : a ≠ b
x✝ : α
⊢ x✝ ∈ l → x✝ = b ∨ x✝ = a ↔ x✝ ≠ b → x✝ ≠ a → x✝ ∉ l
state_after: no goals