l3lab/ntp-mathlib huggingface dataset:
/-- Barycentric coordinates as an affine map. -/
noncomputable def coords : P →ᵃ[k] ι → k where
  toFun q i := b.coord i q
  linear :=
    { toFun := fun v i => -(b.basisOf i).sumCoords v
      map_add' := fun v w => by
        ext i
        simp only [LinearMap.map_add, Pi.add_apply, neg_add]
      map_smul' := fun t v => by
        ext i
        simp only [LinearMap.map_smul, Pi.smul_apply, smul_neg, RingHom.id_apply, mul_neg] }
  map_vadd' p v := by
    ext i
    -- Porting note:
    -- mathlib3 proof was:
    -- simp only [linear_eq_sumCoords, LinearMap.coe_mk, LinearMap.neg_apply, Pi.vadd_apply',
    --   AffineMap.map_vadd]
    -- but now we need to `dsimp` before `AffineMap.map_vadd` works.
    

Proof state:
case h
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝³ : AddCommGroup V
inst✝² : AffineSpace V P
inst✝¹ : Ring k
inst✝ : Module k V
b : AffineBasis ι k P
s : Finset ι
i✝ j : ι
e : ι ≃ ι'
p : P
v : V
i : ι
⊢ (fun q i => (coord b i) q) (v +ᵥ p) i =
    ({
            toAddHom :=
              { toFun := fun v i => -(Basis.sumCoords (basisOf b i)) v,
                map_add' :=
                  (_ :
                    ∀ (v w : V),
                      (fun v i => -(Basis.sumCoords (basisOf b i)) v) (v + w) =
                        (fun v i => -(Basis.sumCoords (basisOf b i)) v) v +
                          (fun v i => -(Basis.sumCoords (basisOf b i)) v) w) },
            map_smul' :=
              (_ :
                ∀ (t : k) (v : V),
                  AddHom.toFun
                      { toFun := fun v i => -(Basis.sumCoords (basisOf b i)) v,
                        map_add' :=
                          (_ :
                            ∀ (v w : V),
                              (fun v i => -(Basis.sumCoords (basisOf b i)) v) (v + w) =
                                (fun v i => -(Basis.sumCoords (basisOf b i)) v) v +
                                  (fun v i => -(Basis.sumCoords (basisOf b i)) v) w) }
                      (t • v) =
                    (RingHom.id k) t •
                      AddHom.toFun
                        { toFun := fun v i => -(Basis.sumCoords (basisOf b i)) v,
                          map_add' :=
                            (_ :
                              ∀ (v w : V),
                                (fun v i => -(Basis.sumCoords (basisOf b i)) v) (v + w) =
                                  (fun v i => -(Basis.sumCoords (basisOf b i)) v) v +
                                    (fun v i => -(Basis.sumCoords (basisOf b i)) v) w) }
                        v) }
          v +ᵥ
        (fun q i => (coord b i) q) p)
      i

Next tactic:
rw [LinearMap.coe_mk, Pi.vadd_apply']
/-- Barycentric coordinates as an affine map. -/
noncomputable def coords : P →ᵃ[k] ι → k where
  toFun q i := b.coord i q
  linear :=
    { toFun := fun v i => -(b.basisOf i).sumCoords v
      map_add' := fun v w => by
        ext i
        simp only [LinearMap.map_add, Pi.add_apply, neg_add]
      map_smul' := fun t v => by
        ext i
        simp only [LinearMap.map_smul, Pi.smul_apply, smul_neg, RingHom.id_apply, mul_neg] }
  map_vadd' p v := by
    ext i
    -- Porting note:
    -- mathlib3 proof was:
    -- simp only [linear_eq_sumCoords, LinearMap.coe_mk, LinearMap.neg_apply, Pi.vadd_apply',
    --   AffineMap.map_vadd]
    -- but now we need to `dsimp` before `AffineMap.map_vadd` works.
    rw [LinearMap.coe_mk, Pi.vadd_apply']
    

Proof state:
case h
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝³ : AddCommGroup V
inst✝² : AffineSpace V P
inst✝¹ : Ring k
inst✝ : Module k V
b : AffineBasis ι k P
s : Finset ι
i✝ j : ι
e : ι ≃ ι'
p : P
v : V
i : ι
⊢ (fun q i => (coord b i) q) (v +ᵥ p) i =
    { toFun := fun v i => -(Basis.sumCoords (basisOf b i)) v,
          map_add' :=
            (_ :
              ∀ (v w : V),
                (fun v i => -(Basis.sumCoords (basisOf b i)) v) (v + w) =
                  (fun v i => -(Basis.sumCoords (basisOf b i)) v) v +
                    (fun v i => -(Basis.sumCoords (basisOf b i)) v) w) }
        v i +ᵥ
      (fun q i => (coord b i) q) p i

Next tactic:
dsimp
/-- Barycentric coordinates as an affine map. -/
noncomputable def coords : P →ᵃ[k] ι → k where
  toFun q i := b.coord i q
  linear :=
    { toFun := fun v i => -(b.basisOf i).sumCoords v
      map_add' := fun v w => by
        ext i
        simp only [LinearMap.map_add, Pi.add_apply, neg_add]
      map_smul' := fun t v => by
        ext i
        simp only [LinearMap.map_smul, Pi.smul_apply, smul_neg, RingHom.id_apply, mul_neg] }
  map_vadd' p v := by
    ext i
    -- Porting note:
    -- mathlib3 proof was:
    -- simp only [linear_eq_sumCoords, LinearMap.coe_mk, LinearMap.neg_apply, Pi.vadd_apply',
    --   AffineMap.map_vadd]
    -- but now we need to `dsimp` before `AffineMap.map_vadd` works.
    rw [LinearMap.coe_mk, Pi.vadd_apply']
    dsimp
    

Proof state:
case h
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝³ : AddCommGroup V
inst✝² : AffineSpace V P
inst✝¹ : Ring k
inst✝ : Module k V
b : AffineBasis ι k P
s : Finset ι
i✝ j : ι
e : ι ≃ ι'
p : P
v : V
i : ι
⊢ (coord b i) (v +ᵥ p) = (-Finsupp.sum ((basisOf b i).repr v) fun x => id) + (coord b i) p

Next tactic:
rw [AffineMap.map_vadd, linear_eq_sumCoords,
        LinearMap.neg_apply]
/-- Barycentric coordinates as an affine map. -/
noncomputable def coords : P →ᵃ[k] ι → k where
  toFun q i := b.coord i q
  linear :=
    { toFun := fun v i => -(b.basisOf i).sumCoords v
      map_add' := fun v w => by
        ext i
        simp only [LinearMap.map_add, Pi.add_apply, neg_add]
      map_smul' := fun t v => by
        ext i
        simp only [LinearMap.map_smul, Pi.smul_apply, smul_neg, RingHom.id_apply, mul_neg] }
  map_vadd' p v := by
    ext i
    -- Porting note:
    -- mathlib3 proof was:
    -- simp only [linear_eq_sumCoords, LinearMap.coe_mk, LinearMap.neg_apply, Pi.vadd_apply',
    --   AffineMap.map_vadd]
    -- but now we need to `dsimp` before `AffineMap.map_vadd` works.
    rw [LinearMap.coe_mk, Pi.vadd_apply']
    dsimp
    rw [AffineMap.map_vadd, linear_eq_sumCoords,
        LinearMap.neg_apply]
    

Proof state:
case h
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝³ : AddCommGroup V
inst✝² : AffineSpace V P
inst✝¹ : Ring k
inst✝ : Module k V
b : AffineBasis ι k P
s : Finset ι
i✝ j : ι
e : ι ≃ ι'
p : P
v : V
i : ι
⊢ -(Basis.sumCoords (basisOf b i)) v +ᵥ (coord b i) p =
    (-Finsupp.sum ((basisOf b i).repr v) fun x => id) + (coord b i) p

Next tactic:
simp only [ne_eq, Basis.coe_sumCoords, vadd_eq_add]
@[simp]
theorem coord_apply_centroid [CharZero k] (b : AffineBasis ι k P) {s : Finset ι} {i : ι}
    (hi : i ∈ s) : b.coord i (s.centroid k b) = (s.card : k)⁻¹ := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝⁴ : AddCommGroup V
inst✝³ : AffineSpace V P
inst✝² : DivisionRing k
inst✝¹ : Module k V
inst✝ : CharZero k
b : AffineBasis ι k P
s : Finset ι
i : ι
hi : i ∈ s
⊢ (coord b i) (Finset.centroid k s ⇑b) = (↑(Finset.card s))⁻¹

Next tactic:
rw [Finset.centroid,
    b.coord_apply_combination_of_mem hi (s.sum_centroidWeights_eq_one_of_nonempty _ ⟨i, hi⟩),
    Finset.centroidWeights, Function.const_apply]
theorem exists_affine_subbasis {t : Set P} (ht : affineSpan k t = ⊤) :
    ∃ (s : _) (_ : s ⊆ t) (b : AffineBasis (↥s) k P), ⇑b = ((↑) : s → P) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝³ : AddCommGroup V
inst✝² : AffineSpace V P
inst✝¹ : DivisionRing k
inst✝ : Module k V
t : Set P
ht : affineSpan k t = ⊤
⊢ ∃ s, ∃ (_ : s ⊆ t), ∃ b, ⇑b = Subtype.val

Next tactic:
obtain ⟨s, hst, h_tot, h_ind⟩ := exists_affineIndependent k V t
theorem exists_affine_subbasis {t : Set P} (ht : affineSpan k t = ⊤) :
    ∃ (s : _) (_ : s ⊆ t) (b : AffineBasis (↥s) k P), ⇑b = ((↑) : s → P) := by
  obtain ⟨s, hst, h_tot, h_ind⟩ := exists_affineIndependent k V t
  

Proof state:
case intro.intro.intro
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝³ : AddCommGroup V
inst✝² : AffineSpace V P
inst✝¹ : DivisionRing k
inst✝ : Module k V
t : Set P
ht : affineSpan k t = ⊤
s : Set P
hst : s ⊆ t
h_tot : affineSpan k s = affineSpan k t
h_ind : AffineIndependent k Subtype.val
⊢ ∃ s, ∃ (_ : s ⊆ t), ∃ b, ⇑b = Subtype.val

Next tactic:
refine' ⟨s, hst, ⟨(↑), h_ind, _⟩, rfl⟩
theorem exists_affine_subbasis {t : Set P} (ht : affineSpan k t = ⊤) :
    ∃ (s : _) (_ : s ⊆ t) (b : AffineBasis (↥s) k P), ⇑b = ((↑) : s → P) := by
  obtain ⟨s, hst, h_tot, h_ind⟩ := exists_affineIndependent k V t
  refine' ⟨s, hst, ⟨(↑), h_ind, _⟩, rfl⟩
  

Proof state:
case intro.intro.intro
ι : Type u_1
ι' : Type u_2
k : Type u_3
V : Type u_4
P : Type u_5
inst✝³ : AddCommGroup V
inst✝² : AffineSpace V P
inst✝¹ : DivisionRing k
inst✝ : Module k V
t : Set P
ht : affineSpan k t = ⊤
s : Set P
hst : s ⊆ t
h_tot : affineSpan k s = affineSpan k t
h_ind : AffineIndependent k Subtype.val
⊢ affineSpan k (range Subtype.val) = ⊤

Next tactic:
rw [Subtype.range_coe, h_tot, ht]
@[simp]
theorem card_disjSum : Multiset.card (s.disjSum t) = Multiset.card s + Multiset.card t := by
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
⊢ card (disjSum s t) = card s + card t

Next tactic:
rw [disjSum, card_add, card_map, card_map]
theorem mem_disjSum : x ∈ s.disjSum t ↔ (∃ a, a ∈ s ∧ inl a = x) ∨ ∃ b, b ∈ t ∧ inr b = x := by
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ x ∈ disjSum s t ↔ (∃ a ∈ s, inl a = x) ∨ ∃ b ∈ t, inr b = x

Next tactic:
simp_rw [disjSum, mem_add, mem_map]
@[simp]
theorem inl_mem_disjSum : inl a ∈ s.disjSum t ↔ a ∈ s := by
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ inl a ∈ disjSum s t ↔ a ∈ s

Next tactic:
rw [mem_disjSum, or_iff_left]
@[simp]
theorem inl_mem_disjSum : inl a ∈ s.disjSum t ↔ a ∈ s := by
  rw [mem_disjSum, or_iff_left]
  -- Porting note: Previous code for L62 was: simp only [exists_eq_right]
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ (∃ a_1 ∈ s, inl a_1 = inl a) ↔ a ∈ s
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ ¬∃ b ∈ t, inr b = inl a

Next tactic:
simp only [inl.injEq, exists_eq_right]
@[simp]
theorem inl_mem_disjSum : inl a ∈ s.disjSum t ↔ a ∈ s := by
  rw [mem_disjSum, or_iff_left]
  -- Porting note: Previous code for L62 was: simp only [exists_eq_right]
  simp only [inl.injEq, exists_eq_right]
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ ¬∃ b ∈ t, inr b = inl a

Next tactic:
rintro ⟨b, _, hb⟩
@[simp]
theorem inl_mem_disjSum : inl a ∈ s.disjSum t ↔ a ∈ s := by
  rw [mem_disjSum, or_iff_left]
  -- Porting note: Previous code for L62 was: simp only [exists_eq_right]
  simp only [inl.injEq, exists_eq_right]
  rintro ⟨b, _, hb⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b✝ : β
x : α ⊕ β
b : β
left✝ : b ∈ t
hb : inr b = inl a
⊢ False

Next tactic:
exact inr_ne_inl hb
@[simp]
theorem inr_mem_disjSum : inr b ∈ s.disjSum t ↔ b ∈ t := by
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ inr b ∈ disjSum s t ↔ b ∈ t

Next tactic:
rw [mem_disjSum, or_iff_right]
@[simp]
theorem inr_mem_disjSum : inr b ∈ s.disjSum t ↔ b ∈ t := by
  rw [mem_disjSum, or_iff_right]
  -- Porting note: Previous code for L72 was: simp only [exists_eq_right]
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ (∃ b_1 ∈ t, inr b_1 = inr b) ↔ b ∈ t
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ ¬∃ a ∈ s, inl a = inr b

Next tactic:
simp only [inr.injEq, exists_eq_right]
@[simp]
theorem inr_mem_disjSum : inr b ∈ s.disjSum t ↔ b ∈ t := by
  rw [mem_disjSum, or_iff_right]
  -- Porting note: Previous code for L72 was: simp only [exists_eq_right]
  simp only [inr.injEq, exists_eq_right]
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
⊢ ¬∃ a ∈ s, inl a = inr b

Next tactic:
rintro ⟨a, _, ha⟩
@[simp]
theorem inr_mem_disjSum : inr b ∈ s.disjSum t ↔ b ∈ t := by
  rw [mem_disjSum, or_iff_right]
  -- Porting note: Previous code for L72 was: simp only [exists_eq_right]
  simp only [inr.injEq, exists_eq_right]
  rintro ⟨a, _, ha⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a✝ : α
b : β
x : α ⊕ β
a : α
left✝ : a ∈ s
ha : inl a = inr b
⊢ False

Next tactic:
exact inl_ne_inr ha
protected theorem Nodup.disjSum (hs : s.Nodup) (ht : t.Nodup) : (s.disjSum t).Nodup := by
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x : α ⊕ β
hs : Nodup s
ht : Nodup t
⊢ Nodup (disjSum s t)

Next tactic:
refine' ((hs.map inl_injective).add_iff <| ht.map inr_injective).2 fun x hs ht => _
protected theorem Nodup.disjSum (hs : s.Nodup) (ht : t.Nodup) : (s.disjSum t).Nodup := by
  refine' ((hs.map inl_injective).add_iff <| ht.map inr_injective).2 fun x hs ht => _
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x✝ : α ⊕ β
hs✝ : Nodup s
ht✝ : Nodup t
x : α ⊕ β
hs : x ∈ Multiset.map inl s
ht : x ∈ Multiset.map inr t
⊢ False

Next tactic:
rw [Multiset.mem_map] at hs ht
protected theorem Nodup.disjSum (hs : s.Nodup) (ht : t.Nodup) : (s.disjSum t).Nodup := by
  refine' ((hs.map inl_injective).add_iff <| ht.map inr_injective).2 fun x hs ht => _
  rw [Multiset.mem_map] at hs ht
  

Proof state:
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a : α
b : β
x✝ : α ⊕ β
hs✝ : Nodup s
ht✝ : Nodup t
x : α ⊕ β
hs : ∃ a ∈ s, inl a = x
ht : ∃ a ∈ t, inr a = x
⊢ False

Next tactic:
obtain ⟨a, _, rfl⟩ := hs
protected theorem Nodup.disjSum (hs : s.Nodup) (ht : t.Nodup) : (s.disjSum t).Nodup := by
  refine' ((hs.map inl_injective).add_iff <| ht.map inr_injective).2 fun x hs ht => _
  rw [Multiset.mem_map] at hs ht
  obtain ⟨a, _, rfl⟩ := hs
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a✝ : α
b : β
x : α ⊕ β
hs : Nodup s
ht✝ : Nodup t
a : α
left✝ : a ∈ s
ht : ∃ a_1 ∈ t, inr a_1 = inl a
⊢ False

Next tactic:
obtain ⟨b, _, h⟩ := ht
protected theorem Nodup.disjSum (hs : s.Nodup) (ht : t.Nodup) : (s.disjSum t).Nodup := by
  refine' ((hs.map inl_injective).add_iff <| ht.map inr_injective).2 fun x hs ht => _
  rw [Multiset.mem_map] at hs ht
  obtain ⟨a, _, rfl⟩ := hs
  obtain ⟨b, _, h⟩ := ht
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
s : Multiset α
t : Multiset β
s₁ s₂ : Multiset α
t₁ t₂ : Multiset β
a✝ : α
b✝ : β
x : α ⊕ β
hs : Nodup s
ht : Nodup t
a : α
left✝¹ : a ∈ s
b : β
left✝ : b ∈ t
h : inr b = inl a
⊢ False

Next tactic:
exact inr_ne_inl h
/-- An element of the unit circle defines a `LinearIsometryEquiv` from `ℂ` to itself, by
rotation. -/
def rotation : circle →* ℂ ≃ₗᵢ[ℝ] ℂ where
  toFun a :=
    { DistribMulAction.toLinearEquiv ℝ ℂ a with
      norm_map' := fun x => show |a * x| = |x| by 

Proof state:
a : ↥circle
src✝ : ℂ ≃ₗ[ℝ] ℂ := DistribMulAction.toLinearEquiv ℝ ℂ a
x : ℂ
⊢ Complex.abs (↑a * x) = Complex.abs x

Next tactic:
rw [map_mul, abs_coe_circle, one_mul]
@[simp]
theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by
  

Proof state:
a b : ↥circle
⊢ LinearIsometryEquiv.trans (rotation a) (rotation b) = rotation (b * a)

Next tactic:
ext1
@[simp]
theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by
  ext1
  

Proof state:
case h
a b : ↥circle
x✝ : ℂ
⊢ (LinearIsometryEquiv.trans (rotation a) (rotation b)) x✝ = (rotation (b * a)) x✝

Next tactic:
simp
theorem rotation_ne_conjLie (a : circle) : rotation a ≠ conjLie := by
  

Proof state:
a : ↥circle
⊢ rotation a ≠ conjLie

Next tactic:
intro h
theorem rotation_ne_conjLie (a : circle) : rotation a ≠ conjLie := by
  intro h
  

Proof state:
a : ↥circle
h : rotation a = conjLie
⊢ False

Next tactic:
have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1
theorem rotation_ne_conjLie (a : circle) : rotation a ≠ conjLie := by
  intro h
  have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1
  

Proof state:
a : ↥circle
h : rotation a = conjLie
h1 : (rotation a) 1 = (starRingEnd ℂ) 1
⊢ False

Next tactic:
have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I
theorem rotation_ne_conjLie (a : circle) : rotation a ≠ conjLie := by
  intro h
  have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1
  have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I
  

Proof state:
a : ↥circle
h : rotation a = conjLie
h1 : (rotation a) 1 = (starRingEnd ℂ) 1
hI : (rotation a) I = (starRingEnd ℂ) I
⊢ False

Next tactic:
rw [rotation_apply, RingHom.map_one, mul_one] at h1
theorem rotation_ne_conjLie (a : circle) : rotation a ≠ conjLie := by
  intro h
  have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1
  have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I
  rw [rotation_apply, RingHom.map_one, mul_one] at h1
  

Proof state:
a : ↥circle
h : rotation a = conjLie
h1 : ↑a = 1
hI : (rotation a) I = (starRingEnd ℂ) I
⊢ False

Next tactic:
rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI
theorem rotation_ne_conjLie (a : circle) : rotation a ≠ conjLie := by
  intro h
  have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1
  have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I
  rw [rotation_apply, RingHom.map_one, mul_one] at h1
  rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI
  

Proof state:
a : ↥circle
h : rotation a = conjLie
h1 : ↑a = 1
hI : 1 = 0
⊢ False

Next tactic:
exact one_ne_zero hI
/-- Takes an element of `ℂ ≃ₗᵢ[ℝ] ℂ` and checks if it is a rotation, returns an element of the
unit circle. -/
@[simps]
def rotationOf (e : ℂ ≃ₗᵢ[ℝ] ℂ) : circle :=
  ⟨e 1 / Complex.abs (e 1), by 

Proof state:
e : ℂ ≃ₗᵢ[ℝ] ℂ
⊢ e 1 / ↑(Complex.abs (e 1)) ∈ circle

Next tactic:
simp
@[simp]
theorem rotationOf_rotation (a : circle) : rotationOf (rotation a) = a :=
  Subtype.ext <| by 

Proof state:
a : ↥circle
⊢ ↑(rotationOf (rotation a)) = ↑a

Next tactic:
simp
theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : ℂ →ₗᵢ[ℝ] ℂ)
    (h₃ : ∀ z, z + conj z = f z + conj (f z)) (z : ℂ) : (f z).re = z.re := by
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h₃ : ∀ (z : ℂ), z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)
z : ℂ
⊢ (f z).re = z.re

Next tactic:
simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul,
    show (2 : ℝ) ≠ 0 by simp [two_ne_zero]] using (h₃ z).symm
theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : ℂ →ₗᵢ[ℝ] ℂ)
    (h₃ : ∀ z, z + conj z = f z + conj (f z)) (z : ℂ) : (f z).re = z.re := by
  simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul,
    show (2 : ℝ) ≠ 0 by 

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h₃ : ∀ (z : ℂ), z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)
z : ℂ
⊢ 2 ≠ 0

Next tactic:
simp [two_ne_zero]
theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : ℂ →ₗᵢ[ℝ] ℂ}
    (h₂ : ∀ z, (f z).re = z.re) (z : ℂ) : (f z).im = z.im ∨ (f z).im = -z.im := by
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h₂ : ∀ (z : ℂ), (f z).re = z.re
z : ℂ
⊢ (f z).im = z.im ∨ (f z).im = -z.im

Next tactic:
have h₁ := f.norm_map z
theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : ℂ →ₗᵢ[ℝ] ℂ}
    (h₂ : ∀ z, (f z).re = z.re) (z : ℂ) : (f z).im = z.im ∨ (f z).im = -z.im := by
  have h₁ := f.norm_map z
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h₂ : ∀ (z : ℂ), (f z).re = z.re
z : ℂ
h₁ : ‖f z‖ = ‖z‖
⊢ (f z).im = z.im ∨ (f z).im = -z.im

Next tactic:
simp only [Complex.abs_def, norm_eq_abs] at h₁
theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : ℂ →ₗᵢ[ℝ] ℂ}
    (h₂ : ∀ z, (f z).re = z.re) (z : ℂ) : (f z).im = z.im ∨ (f z).im = -z.im := by
  have h₁ := f.norm_map z
  simp only [Complex.abs_def, norm_eq_abs] at h₁
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h₂ : ∀ (z : ℂ), (f z).re = z.re
z : ℂ
h₁ : Real.sqrt (normSq (f z)) = Real.sqrt (normSq z)
⊢ (f z).im = z.im ∨ (f z).im = -z.im

Next tactic:
rwa [Real.sqrt_inj (normSq_nonneg _) (normSq_nonneg _), normSq_apply (f z), normSq_apply z,
    h₂, add_left_cancel_iff, mul_self_eq_mul_self_iff] at h₁
theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z) := by
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h : f 1 = 1
z : ℂ
⊢ z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)

Next tactic:
have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h]
theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z) := by
  have : ‖f z - 1‖ = ‖z - 1‖ := by 

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h : f 1 = 1
z : ℂ
⊢ ‖f z - 1‖ = ‖z - 1‖

Next tactic:
rw [← f.norm_map (z - 1), f.map_sub, h]
theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z) := by
  have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h]
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h : f 1 = 1
z : ℂ
this : ‖f z - 1‖ = ‖z - 1‖
⊢ z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)

Next tactic:
apply_fun fun x => x ^ 2 at this
theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z) := by
  have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h]
  apply_fun fun x => x ^ 2 at this
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h : f 1 = 1
z : ℂ
this : ‖f z - 1‖ ^ 2 = ‖z - 1‖ ^ 2
⊢ z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)

Next tactic:
simp only [norm_eq_abs, ← normSq_eq_abs] at this
theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z) := by
  have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h]
  apply_fun fun x => x ^ 2 at this
  simp only [norm_eq_abs, ← normSq_eq_abs] at this
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h : f 1 = 1
z : ℂ
this : normSq (f z - 1) = normSq (z - 1)
⊢ z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)

Next tactic:
rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this
theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z) := by
  have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h]
  apply_fun fun x => x ^ 2 at this
  simp only [norm_eq_abs, ← normSq_eq_abs] at this
  rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h : f 1 = 1
z : ℂ
this : (f z - 1) * (starRingEnd ℂ) (f z - 1) = (z - 1) * (starRingEnd ℂ) (z - 1)
⊢ z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)

Next tactic:
rw [RingHom.map_sub, RingHom.map_sub] at this
theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) :
    z + conj z = f z + conj (f z) := by
  have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h]
  apply_fun fun x => x ^ 2 at this
  simp only [norm_eq_abs, ← normSq_eq_abs] at this
  rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this
  rw [RingHom.map_sub, RingHom.map_sub] at this
  

Proof state:
f : ℂ →ₗᵢ[ℝ] ℂ
h : f 1 = 1
z : ℂ
this : (f z - 1) * ((starRingEnd ℂ) (f z) - (starRingEnd ℂ) 1) = (z - 1) * ((starRingEnd ℂ) z - (starRingEnd ℂ) 1)
⊢ z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z)

Next tactic:
simp only [sub_mul, mul_sub, one_mul, mul_one] at this