Skip to content

Commit

Permalink
fix(Algebra/Order/CauSeq/Completion): fix qsmul instance diamond (#11263
Browse files Browse the repository at this point in the history
)
  • Loading branch information
eric-wieser authored and uniwuni committed Apr 19, 2024
1 parent 90559ec commit d9ec6f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Mathlib/Algebra/Order/CauSeq/Completion.lean
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,17 @@ theorem ofRat_inv (x : β) : ofRat x⁻¹ = ((ofRat x)⁻¹ : (Cauchy abv)) :=
[simp only [const_limZero.1 h, GroupWithZero.inv_zero, const_zero]; rfl]
#align cau_seq.completion.of_rat_inv CauSeq.Completion.ofRat_inv

/- porting note: This takes a long time to compile.
Also needed to rewrite the proof of ratCast_mk due to simp issues -/
/- porting note: needed to rewrite the proof of ratCast_mk due to simp issues -/
/-- The Cauchy completion forms a division ring. -/
noncomputable instance Cauchy.divisionRing : DivisionRing (Cauchy abv) where
exists_pair_ne := ⟨0, 1, zero_ne_one⟩
inv_zero := inv_zero
mul_inv_cancel x := CauSeq.Completion.mul_inv_cancel
ratCast q := ofRat q
ratCast_mk n d hd hnd := by rw [← ofRat_ratCast, Rat.cast_mk', ofRat_mul, ofRat_inv]; rfl
qsmul := qsmulRec _ -- TODO: fix instance diamond
qsmul := (· • ·)
qsmul_eq_mul' q x := Quotient.inductionOn x fun f =>
congr_arg mk <| ext fun i => DivisionRing.qsmul_eq_mul' _ _

theorem ofRat_div (x y : β) : ofRat (x / y) = (ofRat x / ofRat y : Cauchy abv) := by
simp only [div_eq_mul_inv, ofRat_inv, ofRat_mul]
Expand Down

0 comments on commit d9ec6f0

Please sign in to comment.