Skip to content

Commit 0b79434

Browse files
committed
chore: golf FiniteDimensional.isROrC_to_real (#9921)
1 parent ce79848 commit 0b79434

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Mathlib/Data/IsROrC/Lemmas.lean

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,13 @@ library_note "IsROrC instance"/--
3434
This instance generates a type-class problem with a metavariable `?m` that should satisfy
3535
`IsROrC ?m`. Since this can only be satisfied by `ℝ` or `ℂ`, this does not cause problems. -/
3636

37-
3837
/-- An `IsROrC` field is finite-dimensional over `ℝ`, since it is spanned by `{1, I}`. -/
3938
-- Porting note: was @[nolint dangerous_instance]
4039
instance isROrC_to_real : FiniteDimensional ℝ K :=
41-
⟨⟨{1, I}, by
42-
rw [eq_top_iff]
43-
intro a _
44-
rw [Finset.coe_insert, Finset.coe_singleton, Submodule.mem_span_insert]
45-
refine' ⟨re a, im a • I, _, _⟩
46-
· rw [Submodule.mem_span_singleton]
47-
use im a
48-
simp [re_add_im a, Algebra.smul_def, algebraMap_eq_ofReal]⟩⟩
40+
⟨{1, I}, by
41+
suffices ∀ x : K, ∃ a b : ℝ, a • 1 + b • I = x by
42+
simpa [Submodule.eq_top_iff', Submodule.mem_span_pair]
43+
exact fun x ↦ ⟨re x, im x, by simp [real_smul_eq_coe_mul]⟩⟩
4944
#align finite_dimensional.is_R_or_C_to_real FiniteDimensional.isROrC_to_real
5045

5146
variable (K E)

0 commit comments

Comments
 (0)