Theorem: Equiv.Perm.sign_subtypePerm
File: Mathlib/GroupTheory/Perm/Sign.lean

tactic: let l := (truncSwapFactors (subtypePerm f h₁)).out
state_before: α : Type u
β : Type v
inst✝² : DecidableEq α
inst✝¹ : Fintype α
f : Perm α
p : α → Prop
inst✝ : DecidablePred p
h₁ : ∀ (x : α), p x ↔ p (↑f x)
h₂ : ∀ (x : α), ↑f x ≠ x → p x
⊢ ↑sign (subtypePerm f h₁) = ↑sign f

tactic: have hl' : ∀ g' ∈ l.1.map ofSubtype, IsSwap g' := fun g' hg' =>
  let ⟨g, hg⟩ := List.mem_map.1 hg'
  hg.2 ▸ (l.2.2 _ hg.1).of_subtype_isSwap
state_before: α : Type u
β : Type v
inst✝² : DecidableEq α
inst✝¹ : Fintype α
f : Perm α
p : α → Prop
inst✝ : DecidablePred p
h₁ : ∀ (x : α), p x ↔ p (↑f x)
h₂ : ∀ (x : α), ↑f x ≠ x → p x
l : { l // List.prod l = subtypePerm f h₁ ∧ ∀ (g : Perm { x // p x }), g ∈ l → IsSwap g } :=
  Trunc.out (truncSwapFactors (subtypePerm f h₁))
⊢ ↑sign (subtypePerm f h₁) = ↑sign f

tactic: have hl'₂ : (l.1.map ofSubtype).prod = f := by
  rw [l.1.prod_hom ofSubtype, l.2.1, ofSubtype_subtypePerm _ h₂]
state_before: α : Type u
β : Type v
inst✝² : DecidableEq α
inst✝¹ : Fintype α
f : Perm α
p : α → Prop
inst✝ : DecidablePred p
h₁ : ∀ (x : α), p x ↔ p (↑f x)
h₂ : ∀ (x : α), ↑f x ≠ x → p x
l : { l // List.prod l = subtypePerm f h₁ ∧ ∀ (g : Perm { x // p x }), g ∈ l → IsSwap g } :=
  Trunc.out (truncSwapFactors (subtypePerm f h₁))
hl' : ∀ (g' : Perm α), g' ∈ List.map ↑ofSubtype ↑l → IsSwap g'
⊢ ↑sign (subtypePerm f h₁) = ↑sign f

tactic: conv =>
  congr
  rw [← l.2.1]
  skip
state_before: α : Type u
β : Type v
inst✝² : DecidableEq α
inst✝¹ : Fintype α
f : Perm α
p : α → Prop
inst✝ : DecidablePred p
h₁ : ∀ (x : α), p x ↔ p (↑f x)
h₂ : ∀ (x : α), ↑f x ≠ x → p x
l : { l // List.prod l = subtypePerm f h₁ ∧ ∀ (g : Perm { x // p x }), g ∈ l → IsSwap g } :=
  Trunc.out (truncSwapFactors (subtypePerm f h₁))
hl' : ∀ (g' : Perm α), g' ∈ List.map ↑ofSubtype ↑l → IsSwap g'
hl'₂ : List.prod (List.map ↑ofSubtype ↑l) = f
⊢ ↑sign (subtypePerm f h₁) = ↑sign f

tactic: simp_rw [← hl'₂]
state_before: α : Type u
β : Type v
inst✝² : DecidableEq α
inst✝¹ : Fintype α
f : Perm α
p : α → Prop
inst✝ : DecidablePred p
h₁ : ∀ (x : α), p x ↔ p (↑f x)
h₂ : ∀ (x : α), ↑f x ≠ x → p x
l : { l // List.prod l = subtypePerm f h₁ ∧ ∀ (g : Perm { x // p x }), g ∈ l → IsSwap g } :=
  Trunc.out (truncSwapFactors (subtypePerm f h₁))
hl' : ∀ (g' : Perm α), g' ∈ List.map ↑ofSubtype ↑l → IsSwap g'
hl'₂ : List.prod (List.map ↑ofSubtype ↑l) = f
⊢ ↑sign (List.prod ↑l) = ↑sign f

tactic: rw [sign_prod_list_swap l.2.2, sign_prod_list_swap hl', List.length_map]
state_before: α : Type u
β : Type v
inst✝² : DecidableEq α
inst✝¹ : Fintype α
f : Perm α
p : α → Prop
inst✝ : DecidablePred p
h₁ : ∀ (x : α), p x ↔ p (↑f x)
h₂ : ∀ (x : α), ↑f x ≠ x → p x
l : { l // List.prod l = subtypePerm f h₁ ∧ ∀ (g : Perm { x // p x }), g ∈ l → IsSwap g } :=
  Trunc.out (truncSwapFactors (subtypePerm f h₁))
hl' : ∀ (g' : Perm α), g' ∈ List.map ↑ofSubtype ↑l → IsSwap g'
hl'₂ : List.prod (List.map ↑ofSubtype ↑l) = f
⊢ ↑sign (List.prod ↑(Trunc.out (truncSwapFactors (subtypePerm f h₁)))) =
    ↑sign (List.prod (List.map ↑ofSubtype ↑(Trunc.out (truncSwapFactors (subtypePerm f h₁)))))

tactic: rw [l.1.prod_hom ofSubtype, l.2.1, ofSubtype_subtypePerm _ h₂]
state_before: α : Type u
β : Type v
inst✝² : DecidableEq α
inst✝¹ : Fintype α
f : Perm α
p : α → Prop
inst✝ : DecidablePred p
h₁ : ∀ (x : α), p x ↔ p (↑f x)
h₂ : ∀ (x : α), ↑f x ≠ x → p x
l : { l // List.prod l = subtypePerm f h₁ ∧ ∀ (g : Perm { x // p x }), g ∈ l → IsSwap g } :=
  Trunc.out (truncSwapFactors (subtypePerm f h₁))
hl' : ∀ (g' : Perm α), g' ∈ List.map ↑ofSubtype ↑l → IsSwap g'
⊢ List.prod (List.map ↑ofSubtype ↑l) = f