l3lab/ntp-mathlib huggingface dataset:
instance [SMul R ℝ] [SMul S ℝ] [SMulCommClass R S ℝ] : SMulCommClass R S ℂ where
  smul_comm r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝² : SMul R ℝ
inst✝¹ : SMul S ℝ
inst✝ : SMulCommClass R S ℝ
r : R
s : S
x : ℂ
⊢ (r • s • x).re = (s • r • x).re

Next tactic:
simp [smul_re, smul_im, smul_comm]
instance [SMul R ℝ] [SMul S ℝ] [SMulCommClass R S ℝ] : SMulCommClass R S ℂ where
  smul_comm r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝² : SMul R ℝ
inst✝¹ : SMul S ℝ
inst✝ : SMulCommClass R S ℝ
r : R
s : S
x : ℂ
⊢ (r • s • x).im = (s • r • x).im

Next tactic:
simp [smul_re, smul_im, smul_comm]
instance [SMul R S] [SMul R ℝ] [SMul S ℝ] [IsScalarTower R S ℝ] : IsScalarTower R S ℂ where
  smul_assoc r s x := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝³ : SMul R S
inst✝² : SMul R ℝ
inst✝¹ : SMul S ℝ
inst✝ : IsScalarTower R S ℝ
r : R
s : S
x : ℂ
⊢ (r • s) • x = r • s • x

Next tactic:
ext
instance [SMul R S] [SMul R ℝ] [SMul S ℝ] [IsScalarTower R S ℝ] : IsScalarTower R S ℂ where
  smul_assoc r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝³ : SMul R S
inst✝² : SMul R ℝ
inst✝¹ : SMul S ℝ
inst✝ : IsScalarTower R S ℝ
r : R
s : S
x : ℂ
⊢ ((r • s) • x).re = (r • s • x).re

Next tactic:
simp [smul_re, smul_im, smul_assoc]
instance [SMul R S] [SMul R ℝ] [SMul S ℝ] [IsScalarTower R S ℝ] : IsScalarTower R S ℂ where
  smul_assoc r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝³ : SMul R S
inst✝² : SMul R ℝ
inst✝¹ : SMul S ℝ
inst✝ : IsScalarTower R S ℝ
r : R
s : S
x : ℂ
⊢ ((r • s) • x).im = (r • s • x).im

Next tactic:
simp [smul_re, smul_im, smul_assoc]
instance [SMul R ℝ] [SMul Rᵐᵒᵖ ℝ] [IsCentralScalar R ℝ] : IsCentralScalar R ℂ where
  op_smul_eq_smul r x := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝² : SMul R ℝ
inst✝¹ : SMul Rᵐᵒᵖ ℝ
inst✝ : IsCentralScalar R ℝ
r : R
x : ℂ
⊢ MulOpposite.op r • x = r • x

Next tactic:
ext
instance [SMul R ℝ] [SMul Rᵐᵒᵖ ℝ] [IsCentralScalar R ℝ] : IsCentralScalar R ℂ where
  op_smul_eq_smul r x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝² : SMul R ℝ
inst✝¹ : SMul Rᵐᵒᵖ ℝ
inst✝ : IsCentralScalar R ℝ
r : R
x : ℂ
⊢ (MulOpposite.op r • x).re = (r • x).re

Next tactic:
simp [smul_re, smul_im, op_smul_eq_smul]
instance [SMul R ℝ] [SMul Rᵐᵒᵖ ℝ] [IsCentralScalar R ℝ] : IsCentralScalar R ℂ where
  op_smul_eq_smul r x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝² : SMul R ℝ
inst✝¹ : SMul Rᵐᵒᵖ ℝ
inst✝ : IsCentralScalar R ℝ
r : R
x : ℂ
⊢ (MulOpposite.op r • x).im = (r • x).im

Next tactic:
simp [smul_re, smul_im, op_smul_eq_smul]
instance mulAction [Monoid R] [MulAction R ℝ] : MulAction R ℂ where
  one_smul x := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Monoid R
inst✝ : MulAction R ℝ
x : ℂ
⊢ 1 • x = x

Next tactic:
ext
instance mulAction [Monoid R] [MulAction R ℝ] : MulAction R ℂ where
  one_smul x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Monoid R
inst✝ : MulAction R ℝ
x : ℂ
⊢ (1 • x).re = x.re

Next tactic:
simp [smul_re, smul_im, one_smul]
instance mulAction [Monoid R] [MulAction R ℝ] : MulAction R ℂ where
  one_smul x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Monoid R
inst✝ : MulAction R ℝ
x : ℂ
⊢ (1 • x).im = x.im

Next tactic:
simp [smul_re, smul_im, one_smul]
instance mulAction [Monoid R] [MulAction R ℝ] : MulAction R ℂ where
  one_smul x := by ext <;> simp [smul_re, smul_im, one_smul]
  mul_smul r s x := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Monoid R
inst✝ : MulAction R ℝ
r s : R
x : ℂ
⊢ (r * s) • x = r • s • x

Next tactic:
ext
instance mulAction [Monoid R] [MulAction R ℝ] : MulAction R ℂ where
  one_smul x := by ext <;> simp [smul_re, smul_im, one_smul]
  mul_smul r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Monoid R
inst✝ : MulAction R ℝ
r s : R
x : ℂ
⊢ ((r * s) • x).re = (r • s • x).re

Next tactic:
simp [smul_re, smul_im, mul_smul]
instance mulAction [Monoid R] [MulAction R ℝ] : MulAction R ℂ where
  one_smul x := by ext <;> simp [smul_re, smul_im, one_smul]
  mul_smul r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Monoid R
inst✝ : MulAction R ℝ
r s : R
x : ℂ
⊢ ((r * s) • x).im = (r • s • x).im

Next tactic:
simp [smul_re, smul_im, mul_smul]
instance distribSMul [DistribSMul R ℝ] : DistribSMul R ℂ where
  smul_add r x y := by ext <;> simp [smul_re, smul_im, smul_add]
  smul_zero r := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝ : DistribSMul R ℝ
r : R
⊢ r • 0 = 0

Next tactic:
ext
instance distribSMul [DistribSMul R ℝ] : DistribSMul R ℂ where
  smul_add r x y := by ext <;> simp [smul_re, smul_im, smul_add]
  smul_zero r := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝ : DistribSMul R ℝ
r : R
⊢ (r • 0).re = 0.re

Next tactic:
simp [smul_re, smul_im, smul_zero]
instance distribSMul [DistribSMul R ℝ] : DistribSMul R ℂ where
  smul_add r x y := by ext <;> simp [smul_re, smul_im, smul_add]
  smul_zero r := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝ : DistribSMul R ℝ
r : R
⊢ (r • 0).im = 0.im

Next tactic:
simp [smul_re, smul_im, smul_zero]
instance distribSMul [DistribSMul R ℝ] : DistribSMul R ℂ where
  smul_add r x y := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝ : DistribSMul R ℝ
r : R
x y : ℂ
⊢ r • (x + y) = r • x + r • y

Next tactic:
ext
instance distribSMul [DistribSMul R ℝ] : DistribSMul R ℂ where
  smul_add r x y := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝ : DistribSMul R ℝ
r : R
x y : ℂ
⊢ (r • (x + y)).re = (r • x + r • y).re

Next tactic:
simp [smul_re, smul_im, smul_add]
instance distribSMul [DistribSMul R ℝ] : DistribSMul R ℂ where
  smul_add r x y := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝ : DistribSMul R ℝ
r : R
x y : ℂ
⊢ (r • (x + y)).im = (r • x + r • y).im

Next tactic:
simp [smul_re, smul_im, smul_add]
instance instModule [Semiring R] [Module R ℝ] : Module R ℂ where
  add_smul r s x := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : Module R ℝ
r s : R
x : ℂ
⊢ (r + s) • x = r • x + s • x

Next tactic:
ext
instance instModule [Semiring R] [Module R ℝ] : Module R ℂ where
  add_smul r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : Module R ℝ
r s : R
x : ℂ
⊢ ((r + s) • x).re = (r • x + s • x).re

Next tactic:
simp [smul_re, smul_im, add_smul]
instance instModule [Semiring R] [Module R ℝ] : Module R ℂ where
  add_smul r s x := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : Module R ℝ
r s : R
x : ℂ
⊢ ((r + s) • x).im = (r • x + s • x).im

Next tactic:
simp [smul_re, smul_im, add_smul]
instance instModule [Semiring R] [Module R ℝ] : Module R ℂ where
  add_smul r s x := by ext <;> simp [smul_re, smul_im, add_smul]
  zero_smul r := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : Module R ℝ
r : ℂ
⊢ 0 • r = 0

Next tactic:
ext
instance instModule [Semiring R] [Module R ℝ] : Module R ℂ where
  add_smul r s x := by ext <;> simp [smul_re, smul_im, add_smul]
  zero_smul r := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : Module R ℝ
r : ℂ
⊢ (0 • r).re = 0.re

Next tactic:
simp [smul_re, smul_im, zero_smul]
instance instModule [Semiring R] [Module R ℝ] : Module R ℂ where
  add_smul r s x := by ext <;> simp [smul_re, smul_im, add_smul]
  zero_smul r := by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : Module R ℝ
r : ℂ
⊢ (0 • r).im = 0.im

Next tactic:
simp [smul_re, smul_im, zero_smul]
instance [CommSemiring R] [Algebra R ℝ] : Algebra R ℂ :=
  { Complex.ofReal.comp (algebraMap R ℝ) with
    smul := (· • ·)
    smul_def' := fun r x => by ext <;> simp [smul_re, smul_im, Algebra.smul_def]
    commutes' := fun r ⟨xr, xi⟩ => by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : Algebra R ℝ
src✝ : R →+* ℂ := RingHom.comp ofReal (algebraMap R ℝ)
r : R
x✝ : ℂ
xr xi : ℝ
⊢ { toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
          map_add' :=
            (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
        r *
      { re := xr, im := xi } =
    { re := xr, im := xi } *
      { toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
          map_add' :=
            (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
        r

Next tactic:
ext
instance [CommSemiring R] [Algebra R ℝ] : Algebra R ℂ :=
  { Complex.ofReal.comp (algebraMap R ℝ) with
    smul := (· • ·)
    smul_def' := fun r x => by ext <;> simp [smul_re, smul_im, Algebra.smul_def]
    commutes' := fun r ⟨xr, xi⟩ => by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : Algebra R ℝ
src✝ : R →+* ℂ := RingHom.comp ofReal (algebraMap R ℝ)
r : R
x✝ : ℂ
xr xi : ℝ
⊢ ({ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r *
        { re := xr, im := xi }).re =
    ({ re := xr, im := xi } *
        { toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r).re

Next tactic:
simp [smul_re, smul_im, Algebra.commutes]
instance [CommSemiring R] [Algebra R ℝ] : Algebra R ℂ :=
  { Complex.ofReal.comp (algebraMap R ℝ) with
    smul := (· • ·)
    smul_def' := fun r x => by ext <;> simp [smul_re, smul_im, Algebra.smul_def]
    commutes' := fun r ⟨xr, xi⟩ => by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : Algebra R ℝ
src✝ : R →+* ℂ := RingHom.comp ofReal (algebraMap R ℝ)
r : R
x✝ : ℂ
xr xi : ℝ
⊢ ({ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r *
        { re := xr, im := xi }).im =
    ({ re := xr, im := xi } *
        { toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r).im

Next tactic:
simp [smul_re, smul_im, Algebra.commutes]
instance [CommSemiring R] [Algebra R ℝ] : Algebra R ℂ :=
  { Complex.ofReal.comp (algebraMap R ℝ) with
    smul := (· • ·)
    smul_def' := fun r x => by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : Algebra R ℝ
src✝ : R →+* ℂ := RingHom.comp ofReal (algebraMap R ℝ)
r : R
x : ℂ
⊢ r • x =
    { toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
          map_add' :=
            (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
        r *
      x

Next tactic:
ext
instance [CommSemiring R] [Algebra R ℝ] : Algebra R ℂ :=
  { Complex.ofReal.comp (algebraMap R ℝ) with
    smul := (· • ·)
    smul_def' := fun r x => by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : Algebra R ℝ
src✝ : R →+* ℂ := RingHom.comp ofReal (algebraMap R ℝ)
r : R
x : ℂ
⊢ (r • x).re =
    ({ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r *
        x).re

Next tactic:
simp [smul_re, smul_im, Algebra.smul_def]
instance [CommSemiring R] [Algebra R ℝ] : Algebra R ℂ :=
  { Complex.ofReal.comp (algebraMap R ℝ) with
    smul := (· • ·)
    smul_def' := fun r x => by ext <;> 

Proof state:
case a
R : Type u_1
S : Type u_2
inst✝¹ : CommSemiring R
inst✝ : Algebra R ℝ
src✝ : R →+* ℂ := RingHom.comp ofReal (algebraMap R ℝ)
r : R
x : ℂ
⊢ (r • x).im =
    ({ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : R), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) }
          r *
        x).im

Next tactic:
simp [smul_re, smul_im, Algebra.smul_def]
instance : StarModule ℝ ℂ :=
  ⟨fun r x => by 

Proof state:
R : Type u_1
S : Type u_2
r : ℝ
x : ℂ
⊢ star (r • x) = star r • star x

Next tactic:
simp only [star_def, star_trivial, real_smul, map_mul, conj_ofReal]
/-- Two `ℝ`-algebra homomorphisms from `ℂ` are equal if they agree on `Complex.I`. -/
@[ext]
theorem algHom_ext ⦃f g : ℂ →ₐ[ℝ] A⦄ (h : f I = g I) : f = g := by
  

Proof state:
R : Type u_1
S : Type u_2
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra ℝ A
f g : ℂ →ₐ[ℝ] A
h : f I = g I
⊢ f = g

Next tactic:
ext ⟨x, y⟩
/-- Two `ℝ`-algebra homomorphisms from `ℂ` are equal if they agree on `Complex.I`. -/
@[ext]
theorem algHom_ext ⦃f g : ℂ →ₐ[ℝ] A⦄ (h : f I = g I) : f = g := by
  ext ⟨x, y⟩
  

Proof state:
case H.mk
R : Type u_1
S : Type u_2
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra ℝ A
f g : ℂ →ₐ[ℝ] A
h : f I = g I
x y : ℝ
⊢ f { re := x, im := y } = g { re := x, im := y }

Next tactic:
simp only [mk_eq_add_mul_I, AlgHom.map_add, AlgHom.map_coe_real_complex, AlgHom.map_mul, h]
/-- `ℂ` has a basis over `ℝ` given by `1` and `I`. -/
noncomputable def basisOneI : Basis (Fin 2) ℝ ℂ :=
  Basis.ofEquivFun
    { toFun := fun z => ![z.re, z.im]
      invFun := fun c => c 0 + c 1 • I
      left_inv := fun z => by simp
      right_inv := fun c => by
        ext i
        fin_cases i <;> simp
      map_add' := fun z z' => by 

Proof state:
R : Type u_1
S : Type u_2
z z' : ℂ
⊢ (fun z => ![z.re, z.im]) (z + z') = (fun z => ![z.re, z.im]) z + (fun z => ![z.re, z.im]) z'

Next tactic:
simp
/-- `ℂ` has a basis over `ℝ` given by `1` and `I`. -/
noncomputable def basisOneI : Basis (Fin 2) ℝ ℂ :=
  Basis.ofEquivFun
    { toFun := fun z => ![z.re, z.im]
      invFun := fun c => c 0 + c 1 • I
      left_inv := fun z => by simp
      right_inv := fun c => by
        ext i
        fin_cases i <;> simp
      map_add' := fun z z' => by simp
      map_smul' := fun c z => by 

Proof state:
R : Type u_1
S : Type u_2
c : ℝ
z : ℂ
⊢ AddHom.toFun
      { toFun := fun z => ![z.re, z.im],
        map_add' := (_ : ∀ (z z' : ℂ), ![z.re + z'.re, z.im + z'.im] = ![z.re, z.im] + ![z'.re, z'.im]) }
      (c • z) =
    (RingHom.id ℝ) c •
      AddHom.toFun
        { toFun := fun z => ![z.re, z.im],
          map_add' := (_ : ∀ (z z' : ℂ), ![z.re + z'.re, z.im + z'.im] = ![z.re, z.im] + ![z'.re, z'.im]) }
        z

Next tactic:
simp
/-- `ℂ` has a basis over `ℝ` given by `1` and `I`. -/
noncomputable def basisOneI : Basis (Fin 2) ℝ ℂ :=
  Basis.ofEquivFun
    { toFun := fun z => ![z.re, z.im]
      invFun := fun c => c 0 + c 1 • I
      left_inv := fun z => by 

Proof state:
R : Type u_1
S : Type u_2
z : ℂ
⊢ (fun c => ↑(c 0) + c 1 • I)
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun z => ![z.re, z.im],
                map_add' := (_ : ∀ (z z' : ℂ), ![z.re + z'.re, z.im + z'.im] = ![z.re, z.im] + ![z'.re, z'.im]) },
            map_smul' :=
              (_ : ∀ (c : ℝ) (z : ℂ), ![c * z.re - 0 * z.im, c * z.im + 0 * z.re] = c • ![z.re, z.im]) }.toAddHom
        z) =
    z

Next tactic:
simp
/-- `ℂ` has a basis over `ℝ` given by `1` and `I`. -/
noncomputable def basisOneI : Basis (Fin 2) ℝ ℂ :=
  Basis.ofEquivFun
    { toFun := fun z => ![z.re, z.im]
      invFun := fun c => c 0 + c 1 • I
      left_inv := fun z => by simp
      right_inv := fun c => by
        

Proof state:
R : Type u_1
S : Type u_2
c : Fin 2 → ℝ
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun z => ![z.re, z.im],
              map_add' := (_ : ∀ (z z' : ℂ), ![z.re + z'.re, z.im + z'.im] = ![z.re, z.im] + ![z'.re, z'.im]) },
          map_smul' :=
            (_ : ∀ (c : ℝ) (z : ℂ), ![c * z.re - 0 * z.im, c * z.im + 0 * z.re] = c • ![z.re, z.im]) }.toAddHom
      ((fun c => ↑(c 0) + c 1 • I) c) =
    c

Next tactic:
ext i
/-- `ℂ` has a basis over `ℝ` given by `1` and `I`. -/
noncomputable def basisOneI : Basis (Fin 2) ℝ ℂ :=
  Basis.ofEquivFun
    { toFun := fun z => ![z.re, z.im]
      invFun := fun c => c 0 + c 1 • I
      left_inv := fun z => by simp
      right_inv := fun c => by
        ext i
        

Proof state:
case h
R : Type u_1
S : Type u_2
c : Fin 2 → ℝ
i : Fin 2
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun z => ![z.re, z.im],
              map_add' := (_ : ∀ (z z' : ℂ), ![z.re + z'.re, z.im + z'.im] = ![z.re, z.im] + ![z'.re, z'.im]) },
          map_smul' :=
            (_ : ∀ (c : ℝ) (z : ℂ), ![c * z.re - 0 * z.im, c * z.im + 0 * z.re] = c • ![z.re, z.im]) }.toAddHom
      ((fun c => ↑(c 0) + c 1 • I) c) i =
    c i

Next tactic:
fin_cases i
/-- `ℂ` has a basis over `ℝ` given by `1` and `I`. -/
noncomputable def basisOneI : Basis (Fin 2) ℝ ℂ :=
  Basis.ofEquivFun
    { toFun := fun z => ![z.re, z.im]
      invFun := fun c => c 0 + c 1 • I
      left_inv := fun z => by simp
      right_inv := fun c => by
        ext i
        fin_cases i <;> 

Proof state:
case h.head
R : Type u_1
S : Type u_2
c : Fin 2 → ℝ
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun z => ![z.re, z.im],
              map_add' := (_ : ∀ (z z' : ℂ), ![z.re + z'.re, z.im + z'.im] = ![z.re, z.im] + ![z'.re, z'.im]) },
          map_smul' :=
            (_ : ∀ (c : ℝ) (z : ℂ), ![c * z.re - 0 * z.im, c * z.im + 0 * z.re] = c • ![z.re, z.im]) }.toAddHom
      ((fun c => ↑(c 0) + c 1 • I) c) { val := 0, isLt := (_ : 0 < 2) } =
    c { val := 0, isLt := (_ : 0 < 2) }

Next tactic:
simp
/-- `ℂ` has a basis over `ℝ` given by `1` and `I`. -/
noncomputable def basisOneI : Basis (Fin 2) ℝ ℂ :=
  Basis.ofEquivFun
    { toFun := fun z => ![z.re, z.im]
      invFun := fun c => c 0 + c 1 • I
      left_inv := fun z => by simp
      right_inv := fun c => by
        ext i
        fin_cases i <;> 

Proof state:
case h.tail.head
R : Type u_1
S : Type u_2
c : Fin 2 → ℝ
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun z => ![z.re, z.im],
              map_add' := (_ : ∀ (z z' : ℂ), ![z.re + z'.re, z.im + z'.im] = ![z.re, z.im] + ![z'.re, z'.im]) },
          map_smul' :=
            (_ : ∀ (c : ℝ) (z : ℂ), ![c * z.re - 0 * z.im, c * z.im + 0 * z.re] = c • ![z.re, z.im]) }.toAddHom
      ((fun c => ↑(c 0) + c 1 • I) c) { val := 1, isLt := (_ : (fun a => a < 2) 1) } =
    c { val := 1, isLt := (_ : (fun a => a < 2) 1) }

Next tactic:
simp
@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I] :=
  funext fun i =>
    Basis.apply_eq_iff.mpr <|
      Finsupp.ext fun j => by
        

Proof state:
R : Type u_1
S : Type u_2
i j : Fin 2
⊢ (basisOneI.repr (Matrix.vecCons 1 ![I] i)) j = (fun₀ | i => 1) j

Next tactic:
fin_cases i
@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I] :=
  funext fun i =>
    Basis.apply_eq_iff.mpr <|
      Finsupp.ext fun j => by
        fin_cases i <;> 

Proof state:
case head
R : Type u_1
S : Type u_2
j : Fin 2
⊢ (basisOneI.repr (Matrix.vecCons 1 ![I] { val := 0, isLt := (_ : 0 < 2) })) j =
    (fun₀ | { val := 0, isLt := (_ : 0 < 2) } => 1) j

Next tactic:
fin_cases j
@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I] :=
  funext fun i =>
    Basis.apply_eq_iff.mpr <|
      Finsupp.ext fun j => by
        fin_cases i <;> 

Proof state:
case tail.head
R : Type u_1
S : Type u_2
j : Fin 2
⊢ (basisOneI.repr (Matrix.vecCons 1 ![I] { val := 1, isLt := (_ : (fun a => a < 2) 1) })) j =
    (fun₀ | { val := 1, isLt := (_ : (fun a => a < 2) 1) } => 1) j

Next tactic:
fin_cases j
@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I] :=
  funext fun i =>
    Basis.apply_eq_iff.mpr <|
      Finsupp.ext fun j => by
        fin_cases i <;> fin_cases j <;>
          -- Porting note: removed `only`, consider squeezing again
          

Proof state:
case head.head
R : Type u_1
S : Type u_2
⊢ (basisOneI.repr (Matrix.vecCons 1 ![I] { val := 0, isLt := (_ : 0 < 2) })) { val := 0, isLt := (_ : 0 < 2) } =
    (fun₀ | { val := 0, isLt := (_ : 0 < 2) } => 1) { val := 0, isLt := (_ : 0 < 2) }

Next tactic:
simp [coe_basisOneI_repr, Finsupp.single_eq_of_ne, Matrix.cons_val_zero,
            Matrix.cons_val_one, Matrix.head_cons, Fin.one_eq_zero_iff, Ne.def, not_false_iff, I_re,
            Nat.succ_succ_ne_one, one_im, I_im, one_re, Finsupp.single_eq_same, Fin.zero_eq_one_iff]
@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I] :=
  funext fun i =>
    Basis.apply_eq_iff.mpr <|
      Finsupp.ext fun j => by
        fin_cases i <;> fin_cases j <;>
          -- Porting note: removed `only`, consider squeezing again
          

Proof state:
case head.tail.head
R : Type u_1
S : Type u_2
⊢ (basisOneI.repr (Matrix.vecCons 1 ![I] { val := 0, isLt := (_ : 0 < 2) }))
      { val := 1, isLt := (_ : (fun a => a < 2) 1) } =
    (fun₀ | { val := 0, isLt := (_ : 0 < 2) } => 1) { val := 1, isLt := (_ : (fun a => a < 2) 1) }

Next tactic:
simp [coe_basisOneI_repr, Finsupp.single_eq_of_ne, Matrix.cons_val_zero,
            Matrix.cons_val_one, Matrix.head_cons, Fin.one_eq_zero_iff, Ne.def, not_false_iff, I_re,
            Nat.succ_succ_ne_one, one_im, I_im, one_re, Finsupp.single_eq_same, Fin.zero_eq_one_iff]
@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I] :=
  funext fun i =>
    Basis.apply_eq_iff.mpr <|
      Finsupp.ext fun j => by
        fin_cases i <;> fin_cases j <;>
          -- Porting note: removed `only`, consider squeezing again
          

Proof state:
case tail.head.head
R : Type u_1
S : Type u_2
⊢ (basisOneI.repr (Matrix.vecCons 1 ![I] { val := 1, isLt := (_ : (fun a => a < 2) 1) }))
      { val := 0, isLt := (_ : 0 < 2) } =
    (fun₀ | { val := 1, isLt := (_ : (fun a => a < 2) 1) } => 1) { val := 0, isLt := (_ : 0 < 2) }

Next tactic:
simp [coe_basisOneI_repr, Finsupp.single_eq_of_ne, Matrix.cons_val_zero,
            Matrix.cons_val_one, Matrix.head_cons, Fin.one_eq_zero_iff, Ne.def, not_false_iff, I_re,
            Nat.succ_succ_ne_one, one_im, I_im, one_re, Finsupp.single_eq_same, Fin.zero_eq_one_iff]
@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I] :=
  funext fun i =>
    Basis.apply_eq_iff.mpr <|
      Finsupp.ext fun j => by
        fin_cases i <;> fin_cases j <;>
          -- Porting note: removed `only`, consider squeezing again
          

Proof state:
case tail.head.tail.head
R : Type u_1
S : Type u_2
⊢ (basisOneI.repr (Matrix.vecCons 1 ![I] { val := 1, isLt := (_ : (fun a => a < 2) 1) }))
      { val := 1, isLt := (_ : (fun a => a < 2) 1) } =
    (fun₀ | { val := 1, isLt := (_ : (fun a => a < 2) 1) } => 1) { val := 1, isLt := (_ : (fun a => a < 2) 1) }

Next tactic:
simp [coe_basisOneI_repr, Finsupp.single_eq_of_ne, Matrix.cons_val_zero,
            Matrix.cons_val_one, Matrix.head_cons, Fin.one_eq_zero_iff, Ne.def, not_false_iff, I_re,
            Nat.succ_succ_ne_one, one_im, I_im, one_re, Finsupp.single_eq_same, Fin.zero_eq_one_iff]
@[simp]
theorem finrank_real_complex : FiniteDimensional.finrank ℝ ℂ = 2 := by
  

Proof state:
R : Type u_1
S : Type u_2
⊢ finrank ℝ ℂ = 2

Next tactic:
rw [finrank_eq_card_basis basisOneI, Fintype.card_fin]
@[simp]
theorem rank_real_complex : Module.rank ℝ ℂ = 2 := by 

Proof state:
R : Type u_1
S : Type u_2
⊢ Module.rank ℝ ℂ = 2

Next tactic:
simp [← finrank_eq_rank, finrank_real_complex]
theorem rank_real_complex'.{u} : Cardinal.lift.{u} (Module.rank ℝ ℂ) = 2 := by
  

Proof state:
R : Type u_1
S : Type u_2
⊢ Cardinal.lift.{u, 0} (Module.rank ℝ ℂ) = 2

Next tactic:
rw [← finrank_eq_rank, finrank_real_complex, Cardinal.lift_natCast, Nat.cast_ofNat]
theorem rank_real_of_complex (E : Type*) [AddCommGroup E] [Module ℂ E] :
    Module.rank ℝ E = 2 * Module.rank ℂ E :=
  Cardinal.lift_inj.1 <| by
    

Proof state:
E : Type u_1
inst✝¹ : AddCommGroup E
inst✝ : Module ℂ E
⊢ Cardinal.lift.{?u.194462, u_1} (Module.rank ℝ E) = Cardinal.lift.{?u.194462, u_1} (2 * Module.rank ℂ E)

Next tactic:
rw [← lift_rank_mul_lift_rank ℝ ℂ E, Complex.rank_real_complex']