Documentation

GaudisCrypt.Lib.EC.FMap

EasyCrypt's finite maps (theories/datatypes/FMap.ec) #

('a, 'b) fmap is a finite map, here Mathlib's Finmap. Only what ported developments use is here. Names are EasyCrypt's, with function names for its mixfix operators:

EasyCrypthere
emptyFMap.empty
m.[x]FMap.get m x
m.[x <- y]FMap.set m x y
x \in m (dom m x)FMap.dom m x
rng m yFMap.rng m y
fdom m, frng mFMap.fdom m, FMap.frng m
restr f mFMap.restr f m
find p mFMap.find p m
map f mFMap.map f m
noflags mFMap.noflags m
m1 + m2FMap.add m1 m2
in_dom_with m x fFMap.in_dom_with m x f
@[reducible, inline]
abbrev GaudisCrypt.EC.FMap (α : Type u_1) (β : Type u_2) :
Type (max u_1 u_2)

('a, 'b) fmap.

Equations
Instances For
    def GaudisCrypt.EC.FMap.empty {α : Type u_1} {β : Type u_2} :
    FMap α β

    empty: the map with no bindings.

    Equations
    Instances For
      def GaudisCrypt.EC.FMap.get {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) :

      m.[x].

      Equations
      Instances For
        def GaudisCrypt.EC.FMap.set {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) (y : β) :
        FMap α β

        m.[x <- y].

        Equations
        Instances For
          def GaudisCrypt.EC.FMap.rem {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) :
          FMap α β

          rem m x: m without a binding for x.

          Equations
          Instances For
            def GaudisCrypt.EC.FMap.dom {α : Type u_1} {β : Type u_2} (m : FMap α β) (x : α) :

            x \in m: x is bound in m.

            Equations
            Instances For
              def GaudisCrypt.EC.FMap.rng {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (y : β) :

              rng m y: some key is bound to y.

              Equations
              Instances For
                @[implicit_reducible]
                noncomputable instance GaudisCrypt.EC.FMap.instDecidablePredRng {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) :
                Equations
                def GaudisCrypt.EC.FMap.fdom {α : Type u_1} {β : Type u_2} (m : FMap α β) :

                fdom m: the keys of m.

                Equations
                Instances For
                  def GaudisCrypt.EC.FMap.frng {α : Type u_1} {β : Type u_2} [DecidableEq β] (m : FMap α β) :

                  frng m: the values of m.

                  Equations
                  Instances For
                    noncomputable def GaudisCrypt.EC.FMap.find {α : Type u_1} {β : Type u_2} [DecidableEq α] (p : α → β → Bool) (m : FMap α β) :

                    find p m: some key x bound to y with p x y (EasyCrypt leaves which one unspecified), None if there is none.

                    Equations
                    Instances For
                      noncomputable def GaudisCrypt.EC.FMap.ofOpt {α : Type u_1} {β : Type u_2} [DecidableEq α] (s : Finset α) (h : α → Option β) :
                      FMap α β

                      The map binding each x ∈ s with h x = some y to y (how restr and map are built).

                      Equations
                      Instances For
                        theorem GaudisCrypt.EC.FMap.lookup_foldl_ofOpt {α : Type u_1} {β : Type u_2} [DecidableEq α] (h : α → Option β) (x : α) (l : List α) (acc : FMap α β) :
                        Finmap.lookup x (List.foldl (fun (acc : FMap α β) (x : α) => match h x with | some y => Finmap.insert x y acc | none => acc) acc l) = if x ∈ l ∧ (h x).isSome = true then h x else Finmap.lookup x acc
                        theorem GaudisCrypt.EC.FMap.get_ofOpt {α : Type u_1} {β : Type u_2} [DecidableEq α] (s : Finset α) (h : α → Option β) (x : α) :
                        (ofOpt s h).get x = if x ∈ s then h x else none
                        noncomputable def GaudisCrypt.EC.FMap.restr {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] (f : φ) (m : FMap α (β × φ)) :
                        FMap α β

                        restr f m (for m : ('a, 'b * 'f) fmap): the bindings of m whose tag is f, without the tag.

                        Equations
                        Instances For
                          noncomputable def GaudisCrypt.EC.FMap.map {α : Type u_1} {β : Type u_2} [DecidableEq α] {γ : Type u_3} (f : α → β → γ) (m : FMap α β) :
                          FMap α γ

                          map f m: m with each binding x ↦ y replaced by x ↦ f x y.

                          Equations
                          Instances For
                            noncomputable def GaudisCrypt.EC.FMap.noflags {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} (m : FMap α (β × φ)) :
                            FMap α β

                            noflags m (for m : ('a, 'b * 'f) fmap): m without its tags.

                            Equations
                            Instances For
                              def GaudisCrypt.EC.FMap.add {α : Type u_1} {β : Type u_2} [DecidableEq α] (m1 m2 : FMap α β) :
                              FMap α β

                              m1 + m2: the bindings of both, m2's winning where both bind a key.

                              Equations
                              Instances For
                                def GaudisCrypt.EC.FMap.in_dom_with {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [Inhabited β] [Inhabited φ] (m : FMap α (β × φ)) (x : α) (f : φ) :

                                in_dom_with m x f: x is bound in m, with tag f.

                                Equations
                                Instances For
                                  @[implicit_reducible]
                                  instance GaudisCrypt.EC.FMap.instDecidableIn_dom_withOfDecidableEq {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [Inhabited β] [Inhabited φ] [DecidableEq φ] (m : FMap α (β × φ)) (x : α) (f : φ) :
                                  Equations
                                  def GaudisCrypt.EC.FMap.eq_except {α : Type u_1} {β : Type u_2} [DecidableEq α] (X : α → Prop) (m1 m2 : FMap α β) :

                                  eq_except X m1 m2: m1 and m2 agree outside X (EC's eq_exceptP is the definition).

                                  Equations
                                  Instances For

                                    Lemmas (EasyCrypt's names) #

                                    theorem GaudisCrypt.EC.FMap.domE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) :
                                    m.dom x ↔ m.get x ≠ none

                                    domE.

                                    theorem GaudisCrypt.EC.FMap.get_some {α : Type u_1} {β : Type u_2} [DecidableEq α] [Inhabited β] (m : FMap α β) (x : α) (h : m.dom x) :
                                    m.get x = some (oget (m.get x))

                                    get_some: x \in m => m.[x] = Some (oget m.[x]).

                                    theorem GaudisCrypt.EC.FMap.rngE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (y : β) :
                                    m.rng y ↔ ∃ (x : α), m.get x = some y

                                    rngE.

                                    theorem GaudisCrypt.EC.FMap.mem_frng {α : Type u_1} {β : Type u_2} [DecidableEq α] [DecidableEq β] (m : FMap α β) (y : β) :
                                    y ∈ m.frng ↔ m.rng y

                                    mem_frng.

                                    theorem GaudisCrypt.EC.FMap.findP {α : Type u_1} {β : Type u_2} [DecidableEq α] (p : α → β → Bool) (m : FMap α β) :
                                    (find p m = none ∧ ∀ (x : α) (y : β), m.get x = some y → p x y = false) ∨ ∃ (x : α) (y : β), find p m = some x ∧ m.get x = some y ∧ p x y = true

                                    findP, with bindings get m x = some y for EasyCrypt's x \in m and oget m.[x]: either find fails and no binding satisfies p, or it returns a key whose binding satisfies p.

                                    theorem GaudisCrypt.EC.FMap.fmap_eqP {α : Type u_1} {β : Type u_2} [DecidableEq α] (m₁ m₂ : FMap α β) :
                                    (∀ (x : α), m₁.get x = m₂.get x) ↔ m₁ = m₂

                                    fmap_eqP.

                                    @[simp]
                                    theorem GaudisCrypt.EC.FMap.emptyE {α : Type u_1} {β : Type u_2} [DecidableEq α] (x : α) :

                                    emptyE.

                                    @[simp]
                                    theorem GaudisCrypt.EC.FMap.frng0 {α : Type u_1} {β : Type u_2} [DecidableEq β] :

                                    frng0: the empty map's range is empty.

                                    @[simp]
                                    theorem GaudisCrypt.EC.FMap.fdom0 {α : Type u_1} {β : Type u_2} :

                                    fdom0.

                                    theorem GaudisCrypt.EC.FMap.mem_fdom {α : Type u_1} {β : Type u_2} (m : FMap α β) (x : α) :
                                    x ∈ m.fdom ↔ m.dom x

                                    mem_fdom.

                                    theorem GaudisCrypt.EC.FMap.leq_card_rng_dom {α : Type u_1} {β : Type u_2} [DecidableEq α] [DecidableEq β] [Inhabited β] (m : FMap α β) :

                                    leq_card_rng_dom: a map has at most as many values as keys.

                                    theorem GaudisCrypt.EC.FMap.endo_dom_rng {α : Type u_1} [DecidableEq α] [Inhabited α] (m : FMap α α) (h : ∃ (x : α), ¬m.dom x) :
                                    ∃ (y : α), ¬m.rng y

                                    endo_dom_rng: a map from a type to itself that misses a key misses a value.

                                    theorem GaudisCrypt.EC.FMap.mem_empty {α : Type u_1} {β : Type u_2} (x : α) :

                                    mem_empty.

                                    theorem GaudisCrypt.EC.FMap.get_setE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x y : α) (b : β) :
                                    (m.set x b).get y = if y = x then some b else m.get y

                                    get_setE.

                                    @[simp]
                                    theorem GaudisCrypt.EC.FMap.get_set_sameE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) (b : β) :
                                    (m.set x b).get x = some b

                                    get_set_sameE.

                                    theorem GaudisCrypt.EC.FMap.get_set_neqE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x y : α) (b : β) (h : y ≠ x) :
                                    (m.set x b).get y = m.get y

                                    get_set_neqE.

                                    theorem GaudisCrypt.EC.FMap.get_set_id {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) (y : β) (h : m.get x = some y) :
                                    m.set x y = m

                                    get_set_id.

                                    theorem GaudisCrypt.EC.FMap.set_setE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x y : α) (b c : β) :
                                    (m.set x b).set y c = if x = y then m.set y c else (m.set y c).set x b

                                    set_setE.

                                    theorem GaudisCrypt.EC.FMap.fdom_set {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) (b : β) :
                                    (m.set x b).fdom = insert x m.fdom

                                    fdom_set.

                                    theorem GaudisCrypt.EC.FMap.mem_set {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) (b : β) (y : α) :
                                    (m.set x b).dom y ↔ m.dom y ∨ y = x

                                    mem_set.

                                    theorem GaudisCrypt.EC.FMap.joinE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m1 m2 : FMap α β) (x : α) :
                                    (m1.add m2).get x = if m2.dom x then m2.get x else m1.get x

                                    joinE: the bindings of m1 + m2, m2's first.

                                    theorem GaudisCrypt.EC.FMap.mem_join {α : Type u_1} {β : Type u_2} [DecidableEq α] (m1 m2 : FMap α β) (x : α) :
                                    (m1.add m2).dom x ↔ m1.dom x ∨ m2.dom x

                                    mem_join.

                                    theorem GaudisCrypt.EC.FMap.remE {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x y : α) :
                                    (m.rem x).get y = if y = x then none else m.get y

                                    remE.

                                    theorem GaudisCrypt.EC.FMap.rem_id {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) (x : α) (h : ¬m.dom x) :
                                    m.rem x = m

                                    rem_id.

                                    theorem GaudisCrypt.EC.FMap.mapE {α : Type u_1} {β : Type u_2} [DecidableEq α] {γ : Type u_3} (f : α → β → γ) (m : FMap α β) (x : α) :
                                    (map f m).get x = Option.map (f x) (m.get x)

                                    mapE.

                                    theorem GaudisCrypt.EC.FMap.mem_map {α : Type u_1} {β : Type u_2} [DecidableEq α] {γ : Type u_3} (f : α → β → γ) (m : FMap α β) (x : α) :
                                    (map f m).dom x ↔ m.dom x

                                    mem_map.

                                    theorem GaudisCrypt.EC.FMap.map_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {γ : Type u_3} (f : α → β → γ) (m : FMap α β) (x : α) (b : β) :
                                    map f (m.set x b) = (map f m).set x (f x b)

                                    map_set.

                                    theorem GaudisCrypt.EC.FMap.map_comp {α : Type u_1} {β : Type u_2} [DecidableEq α] {γ : Type u_3} {δ : Type u_4} (f : α → β → γ) (g : α → γ → δ) (m : FMap α β) :
                                    map g (map f m) = map (fun (a : α) (b : β) => g a (f a b)) m

                                    map_comp.

                                    theorem GaudisCrypt.EC.FMap.map_id {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) :
                                    map (fun (x : α) (b : β) => b) m = m

                                    map_id.

                                    theorem GaudisCrypt.EC.FMap.map_empty {α : Type u_1} {β : Type u_2} [DecidableEq α] {γ : Type u_3} (f : α → β → γ) :

                                    map_empty.

                                    theorem GaudisCrypt.EC.FMap.map_rem {α : Type u_1} {β : Type u_2} [DecidableEq α] {γ : Type u_3} (f : α → β → γ) (m : FMap α β) (x : α) :
                                    map f (m.rem x) = (map f m).rem x

                                    map_rem.

                                    theorem GaudisCrypt.EC.FMap.eq_except_set {α : Type u_1} {β : Type u_2} [DecidableEq α] (X : α → Prop) {m1 m2 : FMap α β} (h : eq_except X m1 m2) (x : α) (b c : β) (hbc : ¬X x → b = c) :
                                    eq_except X (m1.set x b) (m2.set x c)

                                    eq_except_setlr-style: writing the same key on both sides keeps eq_except.

                                    theorem GaudisCrypt.EC.FMap.eq_except_setl {α : Type u_1} {β : Type u_2} [DecidableEq α] (X : α → Prop) {m1 m2 : FMap α β} (h : eq_except X m1 m2) (x : α) (hx : X x) (b : β) :
                                    eq_except X (m1.set x b) m2

                                    eq_except_setl: a write inside X on the left keeps eq_except.

                                    theorem GaudisCrypt.EC.FMap.eq_except_setr {α : Type u_1} {β : Type u_2} [DecidableEq α] (X : α → Prop) {m1 m2 : FMap α β} (h : eq_except X m1 m2) (x : α) (hx : X x) (b : β) :
                                    eq_except X m1 (m2.set x b)

                                    eq_except_setr: a write inside X on the right keeps eq_except.

                                    theorem GaudisCrypt.EC.FMap.eq_except_remr {α : Type u_1} {β : Type u_2} [DecidableEq α] (X : α → Prop) {m1 m2 : FMap α β} (h : eq_except X m1 m2) (x : α) (hx : X x) :
                                    eq_except X m1 (m2.rem x)

                                    eq_except_remr: a removal inside X on the right keeps eq_except.

                                    theorem GaudisCrypt.EC.FMap.rem_eq_of_eq_except {α : Type u_1} {β : Type u_2} [DecidableEq α] {m1 m2 : FMap α β} {x : α} (h : eq_except (fun (x_1 : α) => x_1 = x) m1 m2) (h2 : m2.get x = none) :
                                    m1.rem x = m2

                                    Equal outside x, and unbound at x on the right: the left without x is the right.

                                    theorem GaudisCrypt.EC.FMap.set_eq_of_eq_except {α : Type u_1} {β : Type u_2} [DecidableEq α] {m1 m2 : FMap α β} {x : α} {b : β} (h : eq_except (fun (x_1 : α) => x_1 = x) m1 m2) (h2 : m2.get x = some b) :
                                    m1.set x b = m2

                                    Equal outside x, and bound to b at x on the right: the left with x ↦ b is the right.

                                    theorem GaudisCrypt.EC.FMap.eq_except_refl {α : Type u_1} {β : Type u_2} [DecidableEq α] (X : α → Prop) (m : FMap α β) :
                                    eq_except X m m

                                    eq_except_refl.

                                    theorem GaudisCrypt.EC.FMap.restrP {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] (m : FMap α (β × φ)) (f : φ) (x : α) :
                                    (restr f m).get x = (m.get x).bind fun (p : β × φ) => if p.2 = f then some p.1 else none

                                    restrP.

                                    theorem GaudisCrypt.EC.FMap.dom_restr {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] [Inhabited β] [Inhabited φ] (m : FMap α (β × φ)) (f : φ) (x : α) :
                                    (restr f m).dom x ↔ m.in_dom_with x f

                                    dom_restr.

                                    theorem GaudisCrypt.EC.FMap.in_dom_with_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] [Inhabited β] [Inhabited φ] (m : FMap α (β × φ)) (x z : α) (v : β × φ) (f : φ) :
                                    (m.set x v).in_dom_with z f ↔ if z = x then v.2 = f else m.in_dom_with z f

                                    in_dom_with after a write.

                                    theorem GaudisCrypt.EC.FMap.in_dom_with_congr {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] [Inhabited β] [Inhabited φ] {m1 m2 : FMap α (β × φ)} {z : α} (h : m1.get z = m2.get z) (f : φ) :

                                    in_dom_with reads only the binding.

                                    theorem GaudisCrypt.EC.FMap.restr_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] (m : FMap α (β × φ)) (f1 f2 : φ) (x : α) (y : β) :
                                    restr f1 (m.set x (y, f2)) = if f1 = f2 then (restr f1 m).set x y else (restr f1 m).rem x

                                    restr_set.

                                    theorem GaudisCrypt.EC.FMap.restr_set_eq {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] (m : FMap α (β × φ)) (f : φ) (x : α) (y : β) :
                                    restr f (m.set x (y, f)) = (restr f m).set x y

                                    restr_set_eq.

                                    theorem GaudisCrypt.EC.FMap.restr0 {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] (f : φ) :

                                    restr0.

                                    theorem GaudisCrypt.EC.FMap.restr_rem {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] [Inhabited β] [Inhabited φ] (m : FMap α (β × φ)) (x : α) (f : φ) :
                                    restr f (m.rem x) = if m.in_dom_with x f then (restr f m).rem x else restr f m

                                    restr_rem.

                                    theorem GaudisCrypt.EC.FMap.restr_map_tag {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] (m : FMap α β) (f : φ) :
                                    restr f (map (fun (x : α) (c : β) => (c, f)) m) = m

                                    restrP at a map tagging every binding with f: the bindings themselves.

                                    theorem GaudisCrypt.EC.FMap.restr_map_tag_ne {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} [DecidableEq φ] (m : FMap α β) {f f' : φ} (h : f' ≠ f) :
                                    restr f' (map (fun (x : α) (c : β) => (c, f)) m) = empty

                                    A map tagging every binding with f has no binding tagged f' ≠ f.

                                    theorem GaudisCrypt.EC.FMap.noflags_map_tag {α : Type u_1} {β : Type u_2} [DecidableEq α] {φ : Type u_3} (m : FMap α β) (f : φ) :
                                    (map (fun (x : α) (c : β) => (c, f)) m).noflags = m

                                    EC's map_comp/map_id at noflags: tagging every binding, then dropping the tags.

                                    Facts EC's smt() finds on rng, fdom and fresh bindings #

                                    Not in EC's FMap.ec: the facts its proofs leave to smt() (with mem_set, get_setE, remE, fcardUI_indep). collision is SecureRO's op collision, generic as there.

                                    theorem GaudisCrypt.EC.FMap.rng_set_of_rng {α : Type u_1} {β : Type u_2} [DecidableEq α] {m : FMap α β} {x : α} (hx : ¬m.dom x) {h : β} (hr : m.rng h) (a : β) :
                                    (m.set x a).rng h

                                    A binding of a fresh key keeps the range.

                                    theorem GaudisCrypt.EC.FMap.eq_of_rng_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {m : FMap α β} {x : α} {h a : β} (hr : ¬m.rng h) (hs : (m.set x a).rng h) :
                                    a = h

                                    A value new in the range of m.[x <- a] is a.

                                    theorem GaudisCrypt.EC.FMap.rng_empty {α : Type u_1} {β : Type u_2} [DecidableEq α] (h : β) :

                                    empty has an empty range.

                                    theorem GaudisCrypt.EC.FMap.rng_rem_set_of_rng {α : Type u_1} {β : Type u_2} [DecidableEq α] {m : FMap α β} {x m1 : α} (hx : ¬m.dom x) {v : β} (hr : (m.rem m1).rng v) (a : β) :
                                    ((m.set x a).rem m1).rng v

                                    A binding of a fresh key keeps the range of the map without m1.

                                    theorem GaudisCrypt.EC.FMap.eq_of_rng_rem_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {m : FMap α β} {x m1 : α} {v a : β} (hr : ¬(m.rem m1).rng v) (hs : ((m.set x a).rem m1).rng v) :
                                    a = v

                                    A value new in the range of rem m.[x <- a] m1 is a.

                                    theorem GaudisCrypt.EC.FMap.fcard_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {m : FMap α β} {x : α} (hx : ¬m.dom x) (r : β) :
                                    (m.set x r).fdom.card = m.fdom.card + 1

                                    fcardUI_indep at a fresh key: card (fdom m.[x <- r]) = card (fdom m) + 1.

                                    def GaudisCrypt.EC.FMap.collision {α : Type u_1} {β : Type u_2} [DecidableEq α] (m : FMap α β) :

                                    SecureRO's op collision (m : ('a, 'b) fmap): two distinct keys with the same value.

                                    Equations
                                    Instances For
                                      theorem GaudisCrypt.EC.FMap.collision_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {m : FMap α β} {x : α} (hx : ¬m.dom x) (hc : m.collision) (r : β) :
                                      (m.set x r).collision

                                      A binding of a fresh key keeps a collision.

                                      theorem GaudisCrypt.EC.FMap.rng_of_collision_set {α : Type u_1} {β : Type u_2} [DecidableEq α] {m : FMap α β} {x : α} (hx : ¬m.dom x) (hc : ¬m.collision) {r : β} (hcs : (m.set x r).collision) :
                                      ∃ (k : α), m.dom k ∧ m.get k = some r

                                      A collision new in m.[x <- r], x fresh: r is already a value of m.

                                      empty has no collision.