Interface

Difficulty: optional — 8 definitions, 2 abbreviations, 1 lemmas, 5 theorems, 0 examples.

definition abbreviation lemma theorem
legend
interfaces
InterfaceOld : Type 1
Show details
| InterfaceOld.mk : (Ports : Type) 
  (Port : Ports  Type) 
    ( (i : Ports), Nonempty (Port i)) 
      ((i : Ports)  Norm (Port i)) 
        (Coherent : Finset Ports  Prop) 
          Coherent  
            ( (i : Ports), Coherent {i}) 
              ( {a b : Finset Ports}, Coherent a  b  a  Coherent b)  InterfaceOld

Outer dependencies: (none)

Mathlib dependencies: Finset, Norm

Lean core dependencies: Eq, HEq, Nat, Nonempty

instNonemptyValue (I : InterfaceOld) : Nonempty I.Value
Show details
fun I =>
  Nonempty.intro
    { fired := , coherent := I.coherent_empty,
      value := fun i => (Finset.notMem_empty (i) i.property).elim }

Complexity: 271 (size of the value term)

Outer dependencies: InterfaceOld, InterfaceOld.Value

Mathlib dependencies: Finset, Finset.notMem_empty

Lean core dependencies: False.elim, Nonempty, Subtype

instNormValue (I : InterfaceOld) : Norm I.Value
Show details
fun I => { norm := fun v =>  i  v.fired.attach, v.value i }

Complexity: 243 (size of the value term)

Outer dependencies: InterfaceOld, InterfaceOld.Value

Mathlib dependencies: Finset, Finset.attach, Finset.sum, Norm, Real

Lean core dependencies: Subtype

Used by: (none)

InterfaceOld.unit : InterfaceOld
Show details
{ Ports := Empty, Port := Empty.elim, nonempty := InterfaceOld.unit._proof_1,
  size := fun i => i.elim, Coherent := fun x => True, coherent_empty := trivial,
  coherent_singleton := , coherent_downward :=  }

Complexity: 77 (size of the value term)

Outer dependencies: InterfaceOld

Mathlib dependencies: Finset, Norm

Lean core dependencies: Empty, Empty.elim, Nonempty, True, trivial

InterfaceOld.tensor (I J : InterfaceOld) : InterfaceOld
Show details
fun I J =>
  { Ports := I.Ports  J.Ports, Port := Sum.elim I.Port J.Port, nonempty := ,
    size := fun x =>
      match x with
      | Sum.inl i => I.size i
      | Sum.inr j => J.size j,
    Coherent := fun a => I.Coherent (a.preimage Sum.inl )  J.Coherent (a.preimage Sum.inr ),
    coherent_empty := , coherent_singleton := , coherent_downward :=  }

Complexity: 225 (size of the value term)

Outer dependencies: InterfaceOld

InterfaceOld.homogeneous (Wire : Type) [Nonempty Wire] [Norm Wire] (n : ) : InterfaceOld
Show details
fun Wire [Nonempty Wire] [inst_1 : Norm Wire] n =>
  { Ports := Fin n, Port := fun x => Wire, nonempty := , size := fun x => inst_1,
    Coherent := fun x => True, coherent_empty := trivial, coherent_singleton := ,
    coherent_downward :=  }

Complexity: 101 (size of the value term)

Outer dependencies: InterfaceOld

Mathlib dependencies: Finset, Norm

Lean core dependencies: Fin, Nat, Nonempty, True, trivial

InterfaceOld.single (Wire : Type) [Nonempty Wire] [Norm Wire] : InterfaceOld
Show details
fun Wire [Nonempty Wire] [Norm Wire] => InterfaceOld.homogeneous Wire 1

Complexity: 27 (size of the value term)

Outer dependencies: InterfaceOld

Inner dependencies: InterfaceOld.homogeneous

Mathlib dependencies: Norm

Lean core dependencies: Nat, Nonempty

InterfaceOld.Value.observe {Wire : Type} [Nonempty Wire] [Norm Wire]
  (v : (InterfaceOld.single Wire).Value) : Option Wire
Show details
fun {Wire} [Nonempty Wire] [Norm Wire] v => if h : 0  v.fired then some (v.value 0, h) else none

Complexity: 563 (size of the value term)

Mathlib dependencies: Finset, Norm

Lean core dependencies: Fin, Nat, Nonempty, Not, Option, dite

InterfaceOld.Value.join {I J : InterfaceOld} (a : I.Value) (b : J.Value) : (I.tensor J).Value
Show details
fun {I J} a b =>
  {
    fired :=
      (Finset.map { toFun := Sum.inl, inj' :=  } a.fired).disjUnion
        (Finset.map { toFun := Sum.inr, inj' :=  } b.fired) ,
    coherent := ,
    value := fun p =>
      match hp : p,  with
      | Sum.inl x, hmem => a.value x, ⋯⟩
      | Sum.inr y, hmem => b.value y, ⋯⟩ }

Complexity: 1763 (size of the value term)

InterfaceOld.Value.eq_of_heq {I : InterfaceOld} {a b : I.Value} (hfired : a.fired = b.fired)
  (hval : a.value  b.value) : a = b
Show details
fun {I} {a b} hfired hval =>
  InterfaceOld.Value.casesOn (motive := fun t => a = t  a = b) a
    (fun aFired aCoh aVal h =>
      Eq.ndrec (motive := fun {a} => a.fired = b.fired  a.value  b.value  a = b)
        (fun hfired hval =>
          InterfaceOld.Value.casesOn (motive := fun t =>
            b = t  { fired := aFired, coherent := aCoh, value := aVal } = b) b
            (fun bFired bCoh bVal h =>
              Eq.ndrec (motive := fun {b} =>
                { fired := aFired, coherent := aCoh, value := aVal }.fired = b.fired 
                  { fired := aFired, coherent := aCoh, value := aVal }.value  b.value 
                    { fired := aFired, coherent := aCoh, value := aVal } = b)
                (fun hfired hval =>
                  Eq.ndrec (motive := fun bFired =>
                     (bCoh : I.Coherent bFired) (bVal : (i : bFired)  I.Port i),
                      { fired := aFired, coherent := aCoh, value := aVal }.value 
                          { fired := bFired, coherent := bCoh, value := bVal }.value 
                        { fired := aFired, coherent := aCoh, value := aVal } =
                          { fired := bFired, coherent := bCoh, value := bVal })
                    (fun bCoh bVal hval =>
                      have this := eq_of_heq hval;
                      Eq.ndrec (motive := fun bVal =>
                        { fired := aFired, coherent := aCoh, value := aVal }.value 
                            { fired := aFired, coherent := bCoh, value := bVal }.value 
                          { fired := aFired, coherent := aCoh, value := aVal } =
                            { fired := aFired, coherent := bCoh, value := bVal })
                        (fun hval => Eq.refl { fired := aFired, coherent := aCoh, value := aVal })
                        this hval)
                    hfired bCoh bVal hval)
                (Eq.symm h) hfired hval)
            (Eq.refl b))
        (Eq.symm h) hfired hval)
    (Eq.refl a)

Complexity: 3536 (size of the value term)

Mathlib dependencies: Finset

Lean core dependencies: Eq, Eq.symm, HEq, Subtype, eq_of_heq

InterfaceOld.Value.left_join {I J : InterfaceOld} (a : I.Value) (b : J.Value) : (a.join b).left = a
Show details
fun {I J} a b =>
  InterfaceOld.Value.ext_of_fired_eq (InterfaceOld.Value.join_fired_inl a b) fun x ha hb =>
    Eq.refl ((a.join b).left.value x, ha)

Complexity: 357 (size of the value term)

Mathlib dependencies: Finset

Lean core dependencies: Eq

InterfaceOld.Value.right_join {I J : InterfaceOld} (a : I.Value) (b : J.Value) :
  (a.join b).right = b
Show details
fun {I J} a b =>
  InterfaceOld.Value.ext_of_fired_eq (InterfaceOld.Value.join_fired_inr a b) fun x ha hb =>
    Eq.refl ((a.join b).right.value x, ha)

Complexity: 357 (size of the value term)

Mathlib dependencies: Finset

Lean core dependencies: Eq

InterfaceOld.Value.join_left_right {I J : InterfaceOld} (v : (I.tensor J).Value) :
  v.left.join v.right = v
Show details
fun {I J} v =>
  have hfired :=
    id
      (Finset.sum_preimage_map_disjUnion v.fired
        (InterfaceOld.Value.join_disjoint v.left v.right));
  InterfaceOld.Value.ext_of_fired_eq hfired fun x ha hb =>
    Sum.casesOn (motive := fun t => x = t  (v.left.join v.right).value x, ha = v.value x, hb) x
      (fun a h =>
        Eq.ndrec (motive := fun x =>
           (ha : x  (v.left.join v.right).fired) (hb : x  v.fired),
            (v.left.join v.right).value x, ha = v.value x, hb)
          (fun ha hb => Eq.refl ((v.left.join v.right).value Sum.inl a, ha)) (Eq.symm h) ha hb)
      (fun b h =>
        Eq.ndrec (motive := fun x =>
           (ha : x  (v.left.join v.right).fired) (hb : x  v.fired),
            (v.left.join v.right).value x, ha = v.value x, hb)
          (fun ha hb => Eq.refl ((v.left.join v.right).value Sum.inr b, ha)) (Eq.symm h) ha hb)
      (Eq.refl x)

Complexity: 3250 (size of the value term)

Mathlib dependencies: Finset

Lean core dependencies: Eq, Eq.symm, Sum, id

Dependency diagram

Drag to pan, Ctrl+scroll (or Cmd+scroll, or pinch on a touch screen) to zoom, click a node to jump to it.

definitionabbreviationlemmatheoremdeclared elsewheredependencyproof dependency
legend