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

tactic: apply top_unique
state_before: α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
⊢ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ) = ⊤
state_after: case h
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
⊢ ⊤ ≤ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)

tactic: rw [← mclosure_isSwap, Submonoid.closure_le]
state_before: case h
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
⊢ ⊤ ≤ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
state_after: case h
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
⊢ {σ | σ.IsSwap} ⊆ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: rintro _ ⟨i, j, ne, rfl⟩
state_before: case h
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
⊢ {σ | σ.IsSwap} ⊆ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: case h.intro.intro.intro
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
⊢ swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: wlog lt : i < j generalizing i j
state_before: case h.intro.intro.intro
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
⊢ swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: case h.intro.intro.intro.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
this :
  ∀ (i j : Fin (n + 1)), i ≠ j → i < j → swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
lt : ¬i < j
⊢ swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
lt : i < j
⊢ swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: induction' j using Fin.induction with j ih
state_before: α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
lt : i < j
⊢ swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: case zero
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
ne : i ≠ 0
lt : i < 0
⊢ swap i 0 ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

case succ
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
⊢ swap i j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: have mem : swap j.castSucc j.succ ∈ Submonoid.closure
    (Set.range fun (i : Fin n) ↦ swap i.castSucc i.succ) := Submonoid.subset_closure ⟨_, rfl⟩
state_before: case succ
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
⊢ swap i j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: case succ
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
⊢ swap i j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: obtain rfl | lts := (Fin.le_castSucc_iff.mpr lt).eq_or_lt
state_before: case succ
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
⊢ swap i j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: case succ.inl
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
j : Fin n
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
ih :
  j.castSucc ≠ j.castSucc →
    j.castSucc < j.castSucc →
      swap j.castSucc j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : j.castSucc ≠ j.succ
lt : j.castSucc < j.succ
⊢ swap j.castSucc j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

case succ.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
lts : i < j.castSucc
⊢ swap i j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: rw [swap_comm, ← swap_mul_swap_mul_swap (y := Fin.castSucc j) lts.ne lt.ne]
state_before: case succ.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
lts : i < j.castSucc
⊢ swap i j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: case succ.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
lts : i < j.castSucc
⊢ swap j.castSucc j.succ * swap i j.castSucc * swap j.castSucc j.succ ∈
    ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: exact mul_mem (mul_mem mem <| ih lts.ne lts) mem
state_before: case succ.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
j : Fin n
ih :
  i ≠ j.castSucc → i < j.castSucc → swap i j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : i ≠ j.succ
lt : i < j.succ
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
lts : i < j.castSucc
⊢ swap j.castSucc j.succ * swap i j.castSucc * swap j.castSucc j.succ ∈
    ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: no goals

tactic: rw [swap_comm]
state_before: case h.intro.intro.intro.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
this :
  ∀ (i j : Fin (n + 1)), i ≠ j → i < j → swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
lt : ¬i < j
⊢ swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: case h.intro.intro.intro.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
this :
  ∀ (i j : Fin (n + 1)), i ≠ j → i < j → swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
lt : ¬i < j
⊢ swap j i ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))

tactic: exact this _ _ ne.symm (ne.lt_or_lt.resolve_left lt)
state_before: case h.intro.intro.intro.inr
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i j : Fin (n + 1)
ne : i ≠ j
this :
  ∀ (i j : Fin (n + 1)), i ≠ j → i < j → swap i j ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
lt : ¬i < j
⊢ swap j i ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: no goals

tactic: cases lt
state_before: case zero
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
i : Fin (n + 1)
ne : i ≠ 0
lt : i < 0
⊢ swap i 0 ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: no goals

tactic: exact mem
state_before: case succ.inl
α : Type u
inst✝ : DecidableEq α
β : Type v
n : ℕ
j : Fin n
mem : swap j.castSucc j.succ ∈ Submonoid.closure (Set.range fun i => swap i.castSucc i.succ)
ih :
  j.castSucc ≠ j.castSucc →
    j.castSucc < j.castSucc →
      swap j.castSucc j.castSucc ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
ne : j.castSucc ≠ j.succ
lt : j.castSucc < j.succ
⊢ swap j.castSucc j.succ ∈ ↑(Submonoid.closure (Set.range fun i => swap i.castSucc i.succ))
state_after: no goals