Skip to content

Instantly share code, notes, and snippets.

@kindaro
Created June 17, 2021 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kindaro/92a7d53a4c9a4297417310dcf0a599b7 to your computer and use it in GitHub Desktop.
Save kindaro/92a7d53a4c9a4297417310dcf0a599b7 to your computer and use it in GitHub Desktop.
From Coq Require Import Unicode.Utf8.
From Coq Require Import Logic.Decidable.
From Coq Require Import QArith.
From Coq Require Import Vectors.Vector.
Notation β„• := nat.
Notation β„™ := Prop.
Notation 𝔹 := bool.
Notation β„€ := Z.
Notation β„š := Q.
Import VectorNotations.
Definition vector {dimension: β„•} := t β„š dimension.
Example eβ‚€ := [ 7#2 ; 5#3 ].
Definition Root (power: β„€) (number: β„š) := {root: β„š | root^power = number}.
Definition speed {dimension: β„•} (velocity: vector) := Root 2 (@fold_left _ _ Qplus 0 dimension (map (fun x => x^2) velocity)).
Example eβ‚‚ := speed eβ‚€.
Compute eβ‚‚.
Example eβ‚‚_computes: βˆƒ (x: β„š), eβ‚‚ = Root 2 x.
Proof with eauto. unfold eβ‚‚, eβ‚€, speed, Qplus... Defined.
Example eβ‚‚_computed: β„š.
pose eβ‚‚_computes. …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment