You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>But writing a fixpoint (either with the <codeclass="highlight coq"><spanclass="keyword namespace">Fixpoint</span></code> command or with the <codeclass="highlight coq"><spanclass="keyword reserved">fix</span></code> tactic) is much nicer:</p>
80
+
<p>But writing a fixpoint (either with the <codeclass="highlight coq"><spanclass="kn">Fixpoint</span></code> command or with the <codeclass="highlight coq"><spanclass="kr">fix</span></code> tactic) is much nicer:</p>
even n = true <-> Even n.</span></label><smallclass="alectryon-output"><div><divclass="alectryon-goals"><blockquoteclass="alectryon-goal"><divclass="goal-hyps"><div><var>even_Even_fp</var><spanclass="hyp-type"><b>:</b><spanclass="highlight"><spanclass="kr">forall</span><spanclass="nv">n</span> : nat,
83
83
even n = true <-> Even n</span></span></div><div><var>n</var><spanclass="hyp-type"><b>:</b><spanclass="highlight">nat</span></span></div></div><spanclass="goal-separator"><hr></span><divclass="goal-conclusion"><spanclass="highlight">even n = true <-> Even n</span></div></blockquote></div></div></small><spanclass="alectryon-wsp">
@@ -102,7 +102,7 @@ <h1>Writing a fixpoint</h1>
102
102
even n = true <-> Even n</span></span></div><div><var>n</var><spanclass="hyp-type"><b>:</b><spanclass="highlight">nat</span></span></div></div><spanclass="goal-separator"><hr></span><divclass="goal-conclusion"><spanclass="highlight">even n = true -> Even (S (S n))</span></div></blockquote></div></div></small><spanclass="alectryon-wsp"></span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="nb">constructor</span>; <spanclass="nb">apply</span> even_Even_fp; <spanclass="bp">assumption</span>.</span></span><spanclass="alectryon-wsp">
even n = true <-> Even n</span></span></div><div><var>n</var><spanclass="hyp-type"><b>:</b><spanclass="highlight">nat</span></span></div></div><spanclass="goal-separator"><hr></span><divclass="goal-conclusion"><spanclass="highlight">Even (S (S n)) -> even n = true</span></div></blockquote></div></div></small><spanclass="alectryon-wsp"></span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="nb">inversion</span><spanclass="mi">1</span>; <spanclass="nb">apply</span> even_Even_fp; <spanclass="bp">assumption</span>.</span></span><spanclass="alectryon-wsp">
105
-
</span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="kn">Qed</span>.</span></span></span></pre><p>Note that the standard library already contains a <aclass="mycoqid reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">boolean</a><aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">predicate</a> for <codeclass="highlight coq"><spanclass="name">even</span></code> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">Coq.Init.Nat.even</a>, or <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">even</a> for short), as well as an <aclass="mycoqid reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">inductive one</a> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">Nat.Even</a> in module <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#">Coq.Arith.PeanoNat</a>).</p>
105
+
</span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="kn">Qed</span>.</span></span></span></pre><p>Note that the standard library already contains a <aclass="mycoqid reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">boolean</a><aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">predicate</a> for <codeclass="highlight coq"><spanclass="n">even</span></code> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">Coq.Init.Nat.even</a>, or <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">even</a> for short), as well as an <aclass="mycoqid reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">inductive one</a> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">Nat.Even</a> in module <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#">Coq.Arith.PeanoNat</a>).</p>
<p>But writing a fixpoint (either with the <codeclass="highlight coq"><spanclass="keyword namespace">Fixpoint</span></code> command or with the <codeclass="highlight coq"><spanclass="keyword reserved">fix</span></code> tactic) is much nicer:</p>
80
+
<p>But writing a fixpoint (either with the <codeclass="highlight coq"><spanclass="kn">Fixpoint</span></code> command or with the <codeclass="highlight coq"><spanclass="kr">fix</span></code> tactic) is much nicer:</p>
even n = true <-> Even n.</span></label><smallclass="alectryon-output"><div><divclass="alectryon-goals"><blockquoteclass="alectryon-goal"><divclass="goal-hyps"><div><var>even_Even_fp</var><spanclass="hyp-type"><b>:</b><spanclass="highlight"><spanclass="kr">forall</span><spanclass="nv">n</span> : nat,
83
83
even n = true <-> Even n</span></span></div><div><var>n</var><spanclass="hyp-type"><b>:</b><spanclass="highlight">nat</span></span></div></div><spanclass="goal-separator"><hr></span><divclass="goal-conclusion"><spanclass="highlight">even n = true <-> Even n</span></div></blockquote></div></div></small><spanclass="alectryon-wsp">
@@ -102,7 +102,7 @@ <h1>Writing a fixpoint</h1>
102
102
even n = true <-> Even n</span></span></div><div><var>n</var><spanclass="hyp-type"><b>:</b><spanclass="highlight">nat</span></span></div></div><spanclass="goal-separator"><hr></span><divclass="goal-conclusion"><spanclass="highlight">even n = true -> Even (S (S n))</span></div></blockquote></div></div></small><spanclass="alectryon-wsp"></span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="nb">constructor</span>; <spanclass="nb">apply</span> even_Even_fp; <spanclass="bp">assumption</span>.</span></span><spanclass="alectryon-wsp">
even n = true <-> Even n</span></span></div><div><var>n</var><spanclass="hyp-type"><b>:</b><spanclass="highlight">nat</span></span></div></div><spanclass="goal-separator"><hr></span><divclass="goal-conclusion"><spanclass="highlight">Even (S (S n)) -> even n = true</span></div></blockquote></div></div></small><spanclass="alectryon-wsp"></span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="nb">inversion</span><spanclass="mi">1</span>; <spanclass="nb">apply</span> even_Even_fp; <spanclass="bp">assumption</span>.</span></span><spanclass="alectryon-wsp">
105
-
</span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="kn">Qed</span>.</span></span></span></pre><p>Note that the standard library already contains a <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">boolean</a><aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">predicate</a> for <codeclass="highlight coq"><spanclass="name">even</span></code> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">Coq.Init.Nat.even</a>, or <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">even</a> for short), as well as an <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">inductive one</a> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">Nat.Even</a> in module <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#">Coq.Arith.PeanoNat</a>).</p>
105
+
</span></span><spanclass="alectryon-sentence"><spanclass="alectryon-input"><spanclass="highlight"><spanclass="kn">Qed</span>.</span></span></span></pre><p>Note that the standard library already contains a <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">boolean</a><aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">predicate</a> for <codeclass="highlight coq"><spanclass="n">even</span></code> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">Coq.Init.Nat.even</a>, or <aclass="reference external" href="https://coq.inria.fr/library/Coq.Init.Nat.html#even">even</a> for short), as well as an <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">inductive one</a> (called <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#Nat.Even">Nat.Even</a> in module <aclass="reference external" href="https://coq.inria.fr/library/Coq.Arith.PeanoNat.html#">Coq.Arith.PeanoNat</a>).</p>
0 commit comments