Ask Your Question

# How do I show in sage that an ideal is contained in another?

For example I have

       sage: K.<a> = QuadraticField(5)
OK = K. ring_of_integers ()
sage: J=ideal(1+7*(1+sqrt(5))/2)
J.issubset(OK)


but this does not work.

edit retag close merge delete

## 1 Answer

Sort by ยป oldest newest most voted

The following dialog worked for me...

sage: K.<a> = QuadraticField(5)
sage: OK = K.ring_of_integers()
sage: OK.gens()
(1/2*a + 1/2, a)
sage: g = 1 + 7*(1+a)/2    # can be obviously expressed in terms of OK.gens()
sage: g in OK
True
sage: J = OK.ideal(g)    # works
sage: J
Fractional ideal (7/2*a + 9/2)


It was possible to initialize J, since its generator(s) $\in \mathcal O_K$. But if we try "the same" with some $h$ which is not integral...

sage: h = a/3
sage: h in OK
False
sage: H = OK.ideal(h)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2020-06-07 13:35:39 +0200

Seen: 193 times

Last updated: Jun 12 '20