Module FirstTry.
Inductive reflect : Prop -> bool -> Prop :=
| ReflectT : forall (P:Prop), P -> reflect P true
| ReflectF : forall (P:Prop), ~ P -> reflect P false.
(** Before explaining this, let's rearrange it a little: Since the types of both [ReflectT] and [ReflectF] begin with [forall (P:Prop)], we can make the definition a bit more readable and easier to work with by making [P] a parameter of the whole Inductive declaration. *)
End FirstTry.
Inductive reflect (P : Prop) : bool -> Prop :=
| ReflectT : P -> reflect P true
| ReflectF : ~ P -> reflect P false.
(** The [reflect] property takes two arguments: a proposition [P] and a boolean [b].  Intuitively, it states that the property [P] is _reflected_ in (i.e., equivalent to) the boolean [b]: [P] holds if and only if [b = true].  To see this, notice that, by definition, the only way we can produce evidence that [reflect P true] holds is by showing that [P] is true and using the [ReflectT] constructor.  If we invert this statement, this means that it should be possible to extract evidence for [P] from a proof of [reflect P true].  Conversely, the only way to show [reflect P false] is by combining evidence for [~ P] with the [ReflectF] constructor.  It is easy to formalize this intuition and show that the two statements are indeed equivalent: *)

Theorem iff_reflect : forall P b, (P <-> b = true) -> reflect P b.