l3lab/ntp-mathlib huggingface dataset:
theorem swap_eq_update (i j : α) : (Equiv.swap i j : α → α) = update (update id j i) i j :=
  funext fun x => by 

Proof state:
α : Sort u_1
inst✝ : DecidableEq α
i j x : α
⊢ (swap i j) x = update (update id j i) i j x

Next tactic:
rw [update_apply _ i j, update_apply _ j i, Equiv.swap_apply_def, id.def]
theorem comp_swap_eq_update (i j : α) (f : α → β) :
    f ∘ Equiv.swap i j = update (update f j (f i)) i (f j) := by
  

Proof state:
α : Sort u_2
inst✝ : DecidableEq α
β : Sort u_1
i j : α
f : α → β
⊢ f ∘ ⇑(swap i j) = update (update f j (f i)) i (f j)

Next tactic:
rw [swap_eq_update, comp_update, comp_update, comp.right_id]
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    

Proof state:
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a b : α
e : α ≃ β
x : β
⊢ ((e.symm.trans (swap a b)).trans e) x = (swap (e a) (e b)) x

Next tactic:
have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> simp_all
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      

Proof state:
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a✝ b : α
e : α ≃ β
x : β
a : α
⊢ e.symm x = a ↔ x = e a

Next tactic:
rw [@eq_comm _ (e.symm x)]
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      

Proof state:
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a✝ b : α
e : α ≃ β
x : β
a : α
⊢ a = e.symm x ↔ x = e a

Next tactic:
constructor
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> 

Proof state:
case mp
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a✝ b : α
e : α ≃ β
x : β
a : α
⊢ a = e.symm x → x = e a

Next tactic:
intros
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> 

Proof state:
case mpr
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a✝ b : α
e : α ≃ β
x : β
a : α
⊢ x = e a → a = e.symm x

Next tactic:
intros
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> 

Proof state:
case mp
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a✝¹ b : α
e : α ≃ β
x : β
a : α
a✝ : a = e.symm x
⊢ x = e a

Next tactic:
simp_all
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> 

Proof state:
case mpr
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a✝¹ b : α
e : α ≃ β
x : β
a : α
a✝ : x = e a
⊢ a = e.symm x

Next tactic:
simp_all
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> simp_all
    

Proof state:
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a b : α
e : α ≃ β
x : β
this : ∀ (a : α), e.symm x = a ↔ x = e a
⊢ ((e.symm.trans (swap a b)).trans e) x = (swap (e a) (e b)) x

Next tactic:
simp only [trans_apply, swap_apply_def, this]
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> simp_all
    simp only [trans_apply, swap_apply_def, this]
    

Proof state:
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a b : α
e : α ≃ β
x : β
this : ∀ (a : α), e.symm x = a ↔ x = e a
⊢ e (if x = e a then b else if x = e b then a else e.symm x) = if x = e a then e b else if x = e b then e a else x

Next tactic:
split_ifs
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> simp_all
    simp only [trans_apply, swap_apply_def, this]
    split_ifs <;> 

Proof state:
case pos
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a b : α
e : α ≃ β
x : β
this : ∀ (a : α), e.symm x = a ↔ x = e a
h✝ : x = e a
⊢ e b = e b

Next tactic:
simp
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> simp_all
    simp only [trans_apply, swap_apply_def, this]
    split_ifs <;> 

Proof state:
case pos
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a b : α
e : α ≃ β
x : β
this : ∀ (a : α), e.symm x = a ↔ x = e a
h✝¹ : ¬x = e a
h✝ : x = e b
⊢ e a = e a

Next tactic:
simp
@[simp]
theorem symm_trans_swap_trans [DecidableEq β] (a b : α) (e : α ≃ β) :
    (e.symm.trans (swap a b)).trans e = swap (e a) (e b) :=
  Equiv.ext fun x => by
    have : ∀ a, e.symm x = a ↔ x = e a := fun a => by
      rw [@eq_comm _ (e.symm x)]
      constructor <;> intros <;> simp_all
    simp only [trans_apply, swap_apply_def, this]
    split_ifs <;> 

Proof state:
case neg
α : Sort u_2
inst✝¹ : DecidableEq α
β : Sort u_1
inst✝ : DecidableEq β
a b : α
e : α ≃ β
x : β
this : ∀ (a : α), e.symm x = a ↔ x = e a
h✝¹ : ¬x = e a
h✝ : ¬x = e b
⊢ e (e.symm x) = x

Next tactic:
simp
@[simp]
theorem swap_apply_self (i j a : α) : swap i j (swap i j a) = a := by
  

Proof state:
α : Sort u_1
inst✝ : DecidableEq α
i j a : α
⊢ (swap i j) ((swap i j) a) = a

Next tactic:
rw [← Equiv.trans_apply, Equiv.swap_swap, Equiv.refl_apply]
/-- A function is invariant to a swap if it is equal at both elements -/
theorem apply_swap_eq_self {v : α → β} {i j : α} (hv : v i = v j) (k : α) :
    v (swap i j k) = v k := by
  

Proof state:
α : Sort u_2
inst✝ : DecidableEq α
β : Sort u_1
v : α → β
i j : α
hv : v i = v j
k : α
⊢ v ((swap i j) k) = v k

Next tactic:
by_cases hi : k = i
/-- A function is invariant to a swap if it is equal at both elements -/
theorem apply_swap_eq_self {v : α → β} {i j : α} (hv : v i = v j) (k : α) :
    v (swap i j k) = v k := by
  by_cases hi : k = i
  · 

Proof state:
case pos
α : Sort u_2
inst✝ : DecidableEq α
β : Sort u_1
v : α → β
i j : α
hv : v i = v j
k : α
hi : k = i
⊢ v ((swap i j) k) = v k

Next tactic:
rw [hi, swap_apply_left, hv]
/-- A function is invariant to a swap if it is equal at both elements -/
theorem apply_swap_eq_self {v : α → β} {i j : α} (hv : v i = v j) (k : α) :
    v (swap i j k) = v k := by
  by_cases hi : k = i
  · rw [hi, swap_apply_left, hv]

  

Proof state:
case neg
α : Sort u_2
inst✝ : DecidableEq α
β : Sort u_1
v : α → β
i j : α
hv : v i = v j
k : α
hi : ¬k = i
⊢ v ((swap i j) k) = v k

Next tactic:
by_cases hj : k = j
/-- A function is invariant to a swap if it is equal at both elements -/
theorem apply_swap_eq_self {v : α → β} {i j : α} (hv : v i = v j) (k : α) :
    v (swap i j k) = v k := by
  by_cases hi : k = i
  · rw [hi, swap_apply_left, hv]

  by_cases hj : k = j
  · 

Proof state:
case pos
α : Sort u_2
inst✝ : DecidableEq α
β : Sort u_1
v : α → β
i j : α
hv : v i = v j
k : α
hi : ¬k = i
hj : k = j
⊢ v ((swap i j) k) = v k

Next tactic:
rw [hj, swap_apply_right, hv]
/-- A function is invariant to a swap if it is equal at both elements -/
theorem apply_swap_eq_self {v : α → β} {i j : α} (hv : v i = v j) (k : α) :
    v (swap i j k) = v k := by
  by_cases hi : k = i
  · rw [hi, swap_apply_left, hv]

  by_cases hj : k = j
  · rw [hj, swap_apply_right, hv]

  

Proof state:
case neg
α : Sort u_2
inst✝ : DecidableEq α
β : Sort u_1
v : α → β
i j : α
hv : v i = v j
k : α
hi : ¬k = i
hj : ¬k = j
⊢ v ((swap i j) k) = v k

Next tactic:
rw [swap_apply_of_ne_of_ne hi hj]
theorem swap_apply_eq_iff {x y z w : α} : swap x y z = w ↔ z = swap x y w := by
  

Proof state:
α : Sort u_1
inst✝ : DecidableEq α
x y z w : α
⊢ (swap x y) z = w ↔ z = (swap x y) w

Next tactic:
rw [apply_eq_iff_eq_symm_apply, symm_swap]
theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
  

Proof state:
α : Sort u_1
inst✝ : DecidableEq α
a b x : α
⊢ (swap a b) x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b)

Next tactic:
by_cases hab : a = b
theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
  by_cases hab : a = b
  · 

Proof state:
case pos
α : Sort u_1
inst✝ : DecidableEq α
a b x : α
hab : a = b
⊢ (swap a b) x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b)

Next tactic:
simp [hab]
theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
  by_cases hab : a = b
  · simp [hab]

  

Proof state:
case neg
α : Sort u_1
inst✝ : DecidableEq α
a b x : α
hab : ¬a = b
⊢ (swap a b) x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b)

Next tactic:
by_cases hax : x = a
theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
  by_cases hab : a = b
  · simp [hab]

  by_cases hax : x = a
  · 

Proof state:
case pos
α : Sort u_1
inst✝ : DecidableEq α
a b x : α
hab : ¬a = b
hax : x = a
⊢ (swap a b) x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b)

Next tactic:
simp [hax, eq_comm]
theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
  by_cases hab : a = b
  · simp [hab]

  by_cases hax : x = a
  · simp [hax, eq_comm]

  

Proof state:
case neg
α : Sort u_1
inst✝ : DecidableEq α
a b x : α
hab : ¬a = b
hax : ¬x = a
⊢ (swap a b) x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b)

Next tactic:
by_cases hbx : x = b
theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
  by_cases hab : a = b
  · simp [hab]

  by_cases hax : x = a
  · simp [hax, eq_comm]

  by_cases hbx : x = b
  · 

Proof state:
case pos
α : Sort u_1
inst✝ : DecidableEq α
a b x : α
hab : ¬a = b
hax : ¬x = a
hbx : x = b
⊢ (swap a b) x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b)

Next tactic:
simp [hbx]
theorem swap_apply_ne_self_iff {a b x : α} : swap a b x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b) := by
  by_cases hab : a = b
  · simp [hab]

  by_cases hax : x = a
  · simp [hax, eq_comm]

  by_cases hbx : x = b
  · simp [hbx]

  

Proof state:
case neg
α : Sort u_1
inst✝ : DecidableEq α
a b x : α
hab : ¬a = b
hax : ¬x = a
hbx : ¬x = b
⊢ (swap a b) x ≠ x ↔ a ≠ b ∧ (x = a ∨ x = b)

Next tactic:
simp [hab, hax, hbx, swap_apply_of_ne_of_ne]
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  

Proof state:
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j : α
⊢ sumCongr (swap i j) (Equiv.refl β) = swap (Sum.inl i) (Sum.inl j)

Next tactic:
ext x
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  ext x
  

Proof state:
case H
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j : α
x : α ⊕ β
⊢ (sumCongr (swap i j) (Equiv.refl β)) x = (swap (Sum.inl i) (Sum.inl j)) x

Next tactic:
cases x
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  ext x
  cases x
  · 

Proof state:
case H.inl
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : α
⊢ (sumCongr (swap i j) (Equiv.refl β)) (Sum.inl val✝) = (swap (Sum.inl i) (Sum.inl j)) (Sum.inl val✝)

Next tactic:
simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inl, comp_apply,
      swap_apply_def, Sum.inl.injEq]
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  ext x
  cases x
  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inl, comp_apply,
      swap_apply_def, Sum.inl.injEq]
    

Proof state:
case H.inl
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : α
⊢ Sum.inl (if val✝ = i then j else if val✝ = j then i else val✝) =
    if val✝ = i then Sum.inl j else if val✝ = j then Sum.inl i else Sum.inl val✝

Next tactic:
split_ifs
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  ext x
  cases x
  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inl, comp_apply,
      swap_apply_def, Sum.inl.injEq]
    split_ifs <;> 

Proof state:
case pos
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : α
h✝ : val✝ = i
⊢ Sum.inl j = Sum.inl j

Next tactic:
rfl
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  ext x
  cases x
  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inl, comp_apply,
      swap_apply_def, Sum.inl.injEq]
    split_ifs <;> 

Proof state:
case pos
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : α
h✝¹ : ¬val✝ = i
h✝ : val✝ = j
⊢ Sum.inl i = Sum.inl i

Next tactic:
rfl
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  ext x
  cases x
  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inl, comp_apply,
      swap_apply_def, Sum.inl.injEq]
    split_ifs <;> 

Proof state:
case neg
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : α
h✝¹ : ¬val✝ = i
h✝ : ¬val✝ = j
⊢ Sum.inl val✝ = Sum.inl val✝

Next tactic:
rfl
@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j) := by
  ext x
  cases x
  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inl, comp_apply,
      swap_apply_def, Sum.inl.injEq]
    split_ifs <;> rfl
  · 

Proof state:
case H.inr
α✝ : Sort ?u.114614
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j : α
val✝ : β
⊢ (sumCongr (swap i j) (Equiv.refl β)) (Sum.inr val✝) = (swap (Sum.inl i) (Sum.inl j)) (Sum.inr val✝)

Next tactic:
simp [Sum.map, swap_apply_of_ne_of_ne]
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  

Proof state:
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j : β
⊢ sumCongr (Equiv.refl α) (swap i j) = swap (Sum.inr i) (Sum.inr j)

Next tactic:
ext x
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  ext x
  

Proof state:
case H
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j : β
x : α ⊕ β
⊢ (sumCongr (Equiv.refl α) (swap i j)) x = (swap (Sum.inr i) (Sum.inr j)) x

Next tactic:
cases x
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  ext x
  cases x
  · 

Proof state:
case H.inl
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j : β
val✝ : α
⊢ (sumCongr (Equiv.refl α) (swap i j)) (Sum.inl val✝) = (swap (Sum.inr i) (Sum.inr j)) (Sum.inl val✝)

Next tactic:
simp [Sum.map, swap_apply_of_ne_of_ne]
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  ext x
  cases x
  · simp [Sum.map, swap_apply_of_ne_of_ne]

  · 

Proof state:
case H.inr
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : β
⊢ (sumCongr (Equiv.refl α) (swap i j)) (Sum.inr val✝) = (swap (Sum.inr i) (Sum.inr j)) (Sum.inr val✝)

Next tactic:
simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inr, comp_apply,
      swap_apply_def, Sum.inr.injEq]
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  ext x
  cases x
  · simp [Sum.map, swap_apply_of_ne_of_ne]

  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inr, comp_apply,
      swap_apply_def, Sum.inr.injEq]
    

Proof state:
case H.inr
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : β
⊢ Sum.inr (if val✝ = i then j else if val✝ = j then i else val✝) =
    if val✝ = i then Sum.inr j else if val✝ = j then Sum.inr i else Sum.inr val✝

Next tactic:
split_ifs
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  ext x
  cases x
  · simp [Sum.map, swap_apply_of_ne_of_ne]

  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inr, comp_apply,
      swap_apply_def, Sum.inr.injEq]
    split_ifs <;> 

Proof state:
case pos
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : β
h✝ : val✝ = i
⊢ Sum.inr j = Sum.inr j

Next tactic:
rfl
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  ext x
  cases x
  · simp [Sum.map, swap_apply_of_ne_of_ne]

  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inr, comp_apply,
      swap_apply_def, Sum.inr.injEq]
    split_ifs <;> 

Proof state:
case pos
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : β
h✝¹ : ¬val✝ = i
h✝ : val✝ = j
⊢ Sum.inr i = Sum.inr i

Next tactic:
rfl
@[simp]
theorem sumCongr_refl_swap {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : β) :
    Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.swap i j) = Equiv.swap (Sum.inr i) (Sum.inr j) := by
  ext x
  cases x
  · simp [Sum.map, swap_apply_of_ne_of_ne]

  · simp only [Equiv.sumCongr_apply, Sum.map, coe_refl, comp.right_id, Sum.elim_inr, comp_apply,
      swap_apply_def, Sum.inr.injEq]
    split_ifs <;> 

Proof state:
case neg
α✝ : Sort ?u.118881
inst✝² : DecidableEq α✝
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
i j val✝ : β
h✝¹ : ¬val✝ = i
h✝ : ¬val✝ = j
⊢ Sum.inr val✝ = Sum.inr val✝

Next tactic:
rfl
@[simp]
theorem setValue_eq (f : α ≃ β) (a : α) (b : β) : setValue f a b a = b := by
  

Proof state:
α : Sort u_2
inst✝ : DecidableEq α
β : Sort u_1
f : α ≃ β
a : α
b : β
⊢ (setValue f a b) a = b

Next tactic:
simp [setValue, swap_apply_left]
theorem Function.Injective.map_swap [DecidableEq α] [DecidableEq β] {f : α → β}
    (hf : Function.Injective f) (x y z : α) :
    f (Equiv.swap x y z) = Equiv.swap (f x) (f y) (f z) := by
  

Proof state:
α : Sort u_1
β : Sort u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
hf : Injective f
x y z : α
⊢ f ((Equiv.swap x y) z) = (Equiv.swap (f x) (f y)) (f z)

Next tactic:
conv_rhs => rw [Equiv.swap_apply_def]
theorem Function.Injective.map_swap [DecidableEq α] [DecidableEq β] {f : α → β}
    (hf : Function.Injective f) (x y z : α) :
    f (Equiv.swap x y z) = Equiv.swap (f x) (f y) (f z) := by
  conv_rhs => 

Proof state:
α : Sort u_1
β : Sort u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
hf : Injective f
x y z : α
| (Equiv.swap (f x) (f y)) (f z)

Next tactic:
rw [Equiv.swap_apply_def]
theorem Function.Injective.map_swap [DecidableEq α] [DecidableEq β] {f : α → β}
    (hf : Function.Injective f) (x y z : α) :
    f (Equiv.swap x y z) = Equiv.swap (f x) (f y) (f z) := by
  conv_rhs => rw [Equiv.swap_apply_def]
  

Proof state:
α : Sort u_1
β : Sort u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
hf : Injective f
x y z : α
⊢ f ((Equiv.swap x y) z) = if f z = f x then f y else if f z = f y then f x else f z

Next tactic:
split_ifs with h₁ h₂
theorem Function.Injective.map_swap [DecidableEq α] [DecidableEq β] {f : α → β}
    (hf : Function.Injective f) (x y z : α) :
    f (Equiv.swap x y z) = Equiv.swap (f x) (f y) (f z) := by
  conv_rhs => rw [Equiv.swap_apply_def]
  split_ifs with h₁ h₂
  · 

Proof state:
case pos
α : Sort u_1
β : Sort u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
hf : Injective f
x y z : α
h₁ : f z = f x
⊢ f ((Equiv.swap x y) z) = f y

Next tactic:
rw [hf h₁, Equiv.swap_apply_left]
theorem Function.Injective.map_swap [DecidableEq α] [DecidableEq β] {f : α → β}
    (hf : Function.Injective f) (x y z : α) :
    f (Equiv.swap x y z) = Equiv.swap (f x) (f y) (f z) := by
  conv_rhs => rw [Equiv.swap_apply_def]
  split_ifs with h₁ h₂
  · rw [hf h₁, Equiv.swap_apply_left]
  · 

Proof state:
case pos
α : Sort u_1
β : Sort u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
hf : Injective f
x y z : α
h₁ : ¬f z = f x
h₂ : f z = f y
⊢ f ((Equiv.swap x y) z) = f x

Next tactic:
rw [hf h₂, Equiv.swap_apply_right]
theorem Function.Injective.map_swap [DecidableEq α] [DecidableEq β] {f : α → β}
    (hf : Function.Injective f) (x y z : α) :
    f (Equiv.swap x y z) = Equiv.swap (f x) (f y) (f z) := by
  conv_rhs => rw [Equiv.swap_apply_def]
  split_ifs with h₁ h₂
  · rw [hf h₁, Equiv.swap_apply_left]
  · rw [hf h₂, Equiv.swap_apply_right]
  · 

Proof state:
case neg
α : Sort u_1
β : Sort u_2
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
f : α → β
hf : Injective f
x y z : α
h₁ : ¬f z = f x
h₂ : ¬f z = f y
⊢ f ((Equiv.swap x y) z) = f z

Next tactic:
rw [Equiv.swap_apply_of_ne_of_ne (mt (congr_arg f) h₁) (mt (congr_arg f) h₂)]