Zulip Chat Archive
Stream: maths
Topic: dependent and
Ashvni Narayanan (Mar 25 2022 at 11:15):
I want to define X to be Y ∧ Z, where Z is dependent on Y.
As an example, I want to define
import data.zmod.basic
def factors_through {n : ℕ} (χ : zmod n →* zmod R) (d : ℕ) : Prop :=
d ∣ n ∧ (d ∣ n → ∃ χ₀ : zmod d →* zmod R, χ = χ₀.comp (zmod.cast_hom hm (zmod n)))
Is there a way to do this? One way is to use Y ∧ (Y → Z). Is there anything simpler?
Thank you!
Anne Baanen (Mar 25 2022 at 11:16):
You could do it as a struct
:
structure factors_through {n : ℕ} (χ : zmod n →* zmod R) (d : ℕ) : Prop :=
(dvd : d ∣ n)
(exists_coe : ∃ χ₀ : zmod d →* zmod R, χ = χ₀.comp (zmod.cast_hom dvd (zmod n)))
Reid Barton (Mar 25 2022 at 11:18):
You can also write \exists y : Y, Z y
Reid Barton (Mar 25 2022 at 11:19):
(or maybe h
or hy
would be a less confusing variable name)
Ashvni Narayanan (Mar 25 2022 at 11:20):
Ah, I see. I had completely forgotten about structures :relieved:
Both suggestions should work, thank you!
Last updated: Dec 20 2023 at 11:08 UTC