Pantograph/examples/lean4_dsp/lean_src_proj/MyProject/playground.lean

50 lines
712 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- import data.real.basic
import Mathlib.Data.Real.Basic
def α : Type := Nat
#check α
-- Cartesian product of Nat and String.
def myTuple : Prod Nat String := (42, "Answer")
#check Prod
#check Prop
def maximum (n : Nat) (k : Nat) : Nat :=
if n < k then
k
else n
#check maximum
#eval maximum 3 4
-- def c : Real := 3
-- def f (x : R) : R :=
-- if h : x = 3 then
-- have h : x = 3 := h
-- x
-- else
-- 2 * x
-- open Real
def f (x : Real) : Real := x
#check f
#eval f 3
noncomputable def g (x : ) : := 1 / x
#check g
#eval g 3
def n : Nat := 3
#eval n
def frac_val : Rat := 1/2
#eval frac_val
def frac_val' : Rat := 0.5
#eval frac_val'
def real_val : := 0.5
#eval real_val
--