Skip to content

Commit 773df06

Browse files
committed
feat: missing nnratCast lemmas for RCLike (#39620)
1 parent 327a72b commit 773df06

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Mathlib/Analysis/RCLike/Basic.lean

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,6 @@ instance : StarModule ℝ K where
577577
theorem ofReal_natCast (n : ℕ) : ((n : ℝ) : K) = n :=
578578
map_natCast (algebraMap ℝ K) n
579579

580-
@[rclike_simps, norm_cast]
581-
lemma ofReal_nnratCast (q : ℚ≥0) : ((q : ℝ) : K) = q := map_nnratCast (algebraMap ℝ K) _
582-
583580
@[simp, rclike_simps]
584581
theorem natCast_re (n : ℕ) : re (n : K) = n := by rw [← ofReal_natCast, ofReal_re]
585582

@@ -614,6 +611,16 @@ theorem intCast_re (n : ℤ) : re (n : K) = n := by rw [← ofReal_intCast, ofRe
614611
@[simp, rclike_simps, norm_cast]
615612
theorem intCast_im (n : ℤ) : im (n : K) = 0 := by rw [← ofReal_intCast, ofReal_im]
616613

614+
@[rclike_simps, norm_cast]
615+
theorem ofReal_nnratCast (n : ℚ≥0) : ((n : ℝ) : K) = n :=
616+
map_nnratCast _ n
617+
618+
@[simp, rclike_simps]
619+
theorem nnratCast_re (q : ℚ≥0) : re (q : K) = q := by rw [← ofReal_nnratCast, ofReal_re]
620+
621+
@[simp, rclike_simps, norm_cast]
622+
theorem nnratCast_im (q : ℚ≥0) : im (q : K) = 0 := by rw [← ofReal_nnratCast, ofReal_im]
623+
617624
@[rclike_simps, norm_cast]
618625
theorem ofReal_ratCast (n : ℚ) : ((n : ℝ) : K) = n :=
619626
map_ratCast _ n

0 commit comments

Comments
 (0)