awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw : ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
        P ≃ᵃ[R] P) :
      (a : P) → P)
    x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₁ : HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
    ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₂ : ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ x) -ᵥ
      x) +ᵥ
    HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₃ : HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
    HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₄ : (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
    x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₄ :
  (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
        HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
      x =
    y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₅ : HAdd.hAdd (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)
        (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) •
      (y -ᵥ x) +ᵥ
    x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₄ :
  (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
        HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
      x =
    y
rw₅ :
  HAdd.hAdd (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)
          (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) •
        (y -ᵥ x) +ᵥ
      x =
    y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₆ : HMul.hMul (α := R) 2 (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) • (y -ᵥ x) +ᵥ x = y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₄ :
  (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
        HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
      x =
    y
rw₅ :
  HAdd.hAdd (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)
          (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) •
        (y -ᵥ x) +ᵥ
      x =
    y
rw₆ : HMul.hMul (α := R) 2 (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) • (y -ᵥ x) +ᵥ x = y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₇ : HSMul.hSMul.{u_1, u_2, u_2} (α := R) 1 (y -ᵥ x) +ᵥ x = y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₄ :
  (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
        HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
      x =
    y
rw₅ :
  HAdd.hAdd (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)
          (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) •
        (y -ᵥ x) +ᵥ
      x =
    y
rw₆ : HMul.hMul (α := R) 2 (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) • (y -ᵥ x) +ᵥ x = y
rw₇ : HSMul.hSMul.{u_1, u_2, u_2} (α := R) 1 (y -ᵥ x) +ᵥ x = y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₈ : (y -ᵥ x) +ᵥ x = y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection R ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          P ≃ᵃ[R] P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₄ :
  (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
        HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
      x =
    y
rw₅ :
  HAdd.hAdd (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)
          (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) •
        (y -ᵥ x) +ᵥ
      x =
    y
rw₆ : HMul.hMul (α := R) 2 (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) • (y -ᵥ x) +ᵥ x = y
rw₇ : HSMul.hSMul.{u_1, u_2, u_2} (α := R) 1 (y -ᵥ x) +ᵥ x = y
rw₈ : (y -ᵥ x) +ᵥ x = y
⊢ (pointReflection R (midpoint R x y) : (a : P) → P) x = y
have rw₉ : y = y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
⊢ (pointReflection (midpoint R x y) : (a : P) → P) x = y
have rw : ((pointReflection ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
        Perm P) :
      (a : P) → P)
    x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          Perm P) :
        (a : P) → P)
      x =
    y
⊢ (pointReflection (midpoint R x y) : (a : P) → P) x = y
have rw₁ : HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
    ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          Perm P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
⊢ (pointReflection (midpoint R x y) : (a : P) → P) x = y
have rw₂ : ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ x) -ᵥ
      x) +ᵥ
    HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          Perm P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
⊢ (pointReflection (midpoint R x y) : (a : P) → P) x = y
have rw₃ : HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
    HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          Perm P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
⊢ (pointReflection (midpoint R x y) : (a : P) → P) x = y
have rw₄ : (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
    x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]
-- Lean 4 proof step from Mathlib.LinearAlgebra.AffineSpace.Midpoint (goal)
Goal:
R : Type u_1
V : Type u_2
P : Type u_4
inst : Ring R
inst_1 : Invertible (α := R) 2
inst_2 : AddCommGroup V
inst_3 : Module R V
inst_4 : AddTorsor V P
x y : P
rw :
  ((pointReflection ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)) :
          Perm P) :
        (a : P) → P)
      x =
    y
rw₁ :
  HVAdd.hVAdd (β := P) ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) -ᵥ x)
      ((lineMap x y : (a : R) → P) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) : P) =
    y
rw₂ :
  ((HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
          x) -ᵥ
        x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₃ :
  HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
      HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +ᵥ
        x =
    y
rw₄ :
  (HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x) +
        HSMul.hSMul.{u_1, u_2, u_2} (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) (y -ᵥ x)) +ᵥ
      x =
    y
⊢ (pointReflection (midpoint R x y) : (a : P) → P) x = y
have rw₅ : HAdd.hAdd (α := R) (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _)
        (@Invertible.invOf _ Distrib.toMul AddMonoidWithOne.toOne 2 _) •
      (y -ᵥ x) +ᵥ
    x =
  y
Tactic: rw [midpoint, pointReflection_apply, lineMap_apply, vadd_vsub, vadd_vadd, ← add_smul, ← two_mul,
    mul_invOf_self, one_smul, vsub_vadd]