Zulip Chat Archive
Stream: Is there code for X?
Topic: if then else in Prop
Ka Wing Li (Jan 02 2026 at 17:34):
Is there a way to use if-then-else in Prop? Aka, not decidable.
def bar_prop : A -> B -> Prop := fun a b => exists i, i < a, i \in b
def foo_prop : A -> B -> Prop :=
fun a b => if bar_prop a b then sorry else sorry
Adam Topaz (Jan 02 2026 at 17:36):
You're missing a decidable instance.
Ka Wing Li (Jan 02 2026 at 17:37):
I am not sure how to make it decidable. Like the bar_prop has an existential quantifier or complex stuff.
Robin Arnez (Jan 02 2026 at 17:38):
You can always open Classical in before the if
Eric Wieser (Jan 02 2026 at 17:40):
Or you can use a conjunction of two implications
Robin Arnez (Jan 02 2026 at 17:51):
Yeah right the obvious (P → Q) ∧ (¬P → R) and P ∧ Q ∨ ¬P ∧ R translations work too (although they duplicate the condition term)
Ka Wing Li (Jan 02 2026 at 17:54):
Let me see if I can simplify stuff when translating.
Jakub Nowak (Jan 03 2026 at 01:33):
You could also try using inductive, something like this:
def bar_prop : A -> B -> Prop := fun a b => exists i, i < a, i ∈ b
inductive foo_prop (a : A) (b : B) : Prop
| bar_prop_ : bar_prop a b → sorry
| bar_prop_false : ¬ bar_prop a b → sorry
Last updated: Feb 28 2026 at 14:05 UTC