-- Mathlib/GroupTheory/Complement.lean
theorem IsComplement'.symm (h : IsComplement' H K) : IsComplement' K H

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
⊢ K.IsComplement' H

Tactic:
let ψ : G ≃ G := Equiv.mk (fun g : G => g⁻¹) (fun g : G => g⁻¹) inv_inv inv_inv

Result:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
⊢ K.IsComplement' H

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
⊢ K.IsComplement' H

Tactic:
suffices hf : (ψ ∘ fun x : H × K => x.1.1 * x.2.1) = (fun x : K × H => x.1.1 * x.2.1) ∘ ϕ by
  rw [isComplement'_def, IsComplement, ← Equiv.bijective_comp ϕ]
  apply (congr_arg Function.Bijective hf).mp rwa [ψ.comp_bijective]

Result:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
⊢ (⇑ψ ∘ fun x => ↑x.1 * ↑x.2) = (fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
hf : (⇑ψ ∘ fun x => ↑x.1 * ↑x.2) = (fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ
⊢ Bijective ((fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ)

Tactic:
apply (congr_arg Function.Bijective hf).mp

Result:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
hf : (⇑ψ ∘ fun x => ↑x.1 * ↑x.2) = (fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ
⊢ Bijective (⇑ψ ∘ fun x => ↑x.1 * ↑x.2)

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
⊢ K.IsComplement' H

Tactic:
let ϕ : H × K ≃ K × H :=
  Equiv.mk (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => ⟨x.2⁻¹, x.1⁻¹⟩)
    (fun x => Prod.ext (inv_inv _) (inv_inv _)) fun x => Prod.ext (inv_inv _) (inv_inv _)

Result:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
⊢ K.IsComplement' H

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
hf : (⇑ψ ∘ fun x => ↑x.1 * ↑x.2) = (fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ
⊢ K.IsComplement' H

Tactic:
rw [isComplement'_def, IsComplement, ← Equiv.bijective_comp ϕ]

Result:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
hf : (⇑ψ ∘ fun x => ↑x.1 * ↑x.2) = (fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ
⊢ Bijective ((fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ)

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
hf : (⇑ψ ∘ fun x => ↑x.1 * ↑x.2) = (fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ
⊢ Bijective (⇑ψ ∘ fun x => ↑x.1 * ↑x.2)

Tactic:
rwa [ψ.comp_bijective]

Result:
no goals

Proof state:
G : Type u_1
inst✝ : Group G
H K : Subgroup G
h : H.IsComplement' K
ϕ : ↥H × ↥K ≃ ↥K × ↥H :=
  { toFun := fun x => (x.2⁻¹, x.1⁻¹), invFun := fun x => (x.2⁻¹, x.1⁻¹), left_inv := ⋯, right_inv := ⋯ }
ψ : G ≃ G := { toFun := fun g => g⁻¹, invFun := fun g => g⁻¹, left_inv := ⋯, right_inv := ⋯ }
⊢ (⇑ψ ∘ fun x => ↑x.1 * ↑x.2) = (fun x => ↑x.1 * ↑x.2) ∘ ⇑ϕ

Tactic:
exact funext fun x => mul_inv_rev _ _

Result:
no goals