Zulip Chat Archive

Stream: new members

Topic: UFDs, GCD domains and integrally closed domains in Mathlib


Isak Colboubrani (Aug 11 2024 at 20:40):

I want to assert that ℚ is a.) an UFD, b.) a GCD domain and c.) an integrally closed domain.

This is my #mwe:

import Mathlib

-- Assert that ℚ is an unique factorization domain (UFD)
instance : UniqueFactorizationMonoid  := by infer_instance
instance : IsDomain  := by infer_instance

-- Assert that ℚ is a GCD domain
instance : GCDMonoid  := by infer_instance
instance : IsDomain  := by infer_instance

-- Assert that ℚ is an integrally closed domain
instance : IsIntegrallyClosed  := by infer_instance
instance : IsDomain  := by infer_instance

Do these assertions correspond correctly with the properties of ℚ as demonstrated by the code?

Is there anything that could be improved?

Ruben Van de Velde (Aug 11 2024 at 21:49):

Seems correct


Last updated: May 02 2025 at 03:31 UTC