lean4-htt/tests/lean/run/structInst3.lean
Leonardo de Moura 90a79a0b06 chore: remove command universes
Now, `universe` may declare many universes. The goal is to make it
consistent with the `variable` command
2021-06-29 17:01:07 -07:00

39 lines
598 B
Text
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.

universe u
namespace Ex1
structure A (α : Type u) :=
(x : α) (f : αα := λ x => x)
structure B (α : Type u) extends A α :=
(y : α := f (f x)) (g : ααα := λ x y => f x)
structure C (α : Type u) extends B α :=
(z : α := g x y) (x := f z)
end Ex1
open Ex1
def c1 : C Nat := { x := 1 }
#check { c1 with z := 2 }
#check { c1 with z := 2 }
theorem ex1 : { c1 with z := 2 }.z = 2 :=
rfl
#check ex1
theorem ex2 : { c1 with z := 2 }.x = c1.x :=
rfl
#check ex2
def c2 : C (Nat × Nat) := { z := (1, 1) }
#check { c2 with x.fst := 2 }
#check { c2 with x.1 := 3 }