Properties of the binary representation of integers #
This tactic tries to turn an (in)equality about Num
s to one about Nat
s by rewriting.
example (n : Num) (m : Num) : n ≤ n + m := by
transfer_rw
exact Nat.le_add_right _ _
Equations
- Num.transfer_rw = Lean.ParserDescr.node `Num.transfer_rw 1024 (Lean.ParserDescr.nonReservedSymbol "transfer_rw" false)
Instances For
This tactic tries to prove (in)equalities about Num
s by transferring them to the Nat
world and
then trying to call simp
.
example (n : Num) (m : Num) : n ≤ n + m := by transfer
Equations
- Num.transfer = Lean.ParserDescr.node `Num.transfer 1024 (Lean.ParserDescr.nonReservedSymbol "transfer" false)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Num.addMonoidWithOne = { natCast := Num.ofNat', toAddMonoid := Num.addMonoid, one := 1, natCast_zero := Num.ofNat'_zero, natCast_succ := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
This tactic tries to turn an (in)equality about PosNum
s to one about Nat
s by rewriting.
example (n : PosNum) (m : PosNum) : n ≤ n + m := by
transfer_rw
exact Nat.le_add_right _ _
Equations
- PosNum.transfer_rw = Lean.ParserDescr.node `PosNum.transfer_rw 1024 (Lean.ParserDescr.nonReservedSymbol "transfer_rw" false)
Instances For
This tactic tries to prove (in)equalities about PosNum
s by transferring them to the Nat
world
and then trying to call simp
.
example (n : PosNum) (m : PosNum) : n ≤ n + m := by transfer
Equations
- PosNum.transfer = Lean.ParserDescr.node `PosNum.transfer 1024 (Lean.ParserDescr.nonReservedSymbol "transfer" false)
Instances For
Equations
- PosNum.addCommSemigroup = { add := fun (x1 x2 : PosNum) => x1 + x2, add_assoc := PosNum.addCommSemigroup._proof_43, add_comm := PosNum.addCommSemigroup._proof_44 }
Equations
- One or more equations did not get rendered due to their size.
Equations
- PosNum.distrib = { mul := fun (x1 x2 : PosNum) => x1 * x2, add := fun (x1 x2 : PosNum) => x1 + x2, left_distrib := PosNum.distrib._proof_51, right_distrib := PosNum.distrib._proof_52 }
Equations
- One or more equations did not get rendered due to their size.
@[simp]
@[simp]
@[simp]
@[simp]
theorem
PosNum.one_le_cast
{α : Type u_1}
[Semiring α]
[PartialOrder α]
[IsStrictOrderedRing α]
(n : PosNum)
:
@[simp]
theorem
PosNum.cast_pos
{α : Type u_1}
[Semiring α]
[PartialOrder α]
[IsStrictOrderedRing α]
(n : PosNum)
:
@[simp]
@[simp]
theorem
PosNum.cast_lt
{α : Type u_1}
[Semiring α]
[PartialOrder α]
[IsStrictOrderedRing α]
{m n : PosNum}
:
@[simp]
theorem
PosNum.cast_le
{α : Type u_1}
[Semiring α]
[LinearOrder α]
[IsStrictOrderedRing α]
{m n : PosNum}
:
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Num.cast_lt
{α : Type u_1}
[Semiring α]
[PartialOrder α]
[IsStrictOrderedRing α]
{m n : Num}
:
@[simp]
theorem
Num.cast_le
{α : Type u_1}
[Semiring α]
[LinearOrder α]
[IsStrictOrderedRing α]
{m n : Num}
:
@[simp]
theorem
Num.cast_inj
{α : Type u_1}
[Semiring α]
[PartialOrder α]
[IsStrictOrderedRing α]
{m n : Num}
:
theorem
Num.castNum_eq_bitwise
{f : Num → Num → Num}
{g : Bool → Bool → Bool}
(p : PosNum → PosNum → Num)
(gff : g false false = false)
(f00 : f 0 0 = 0)
(f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0)
(fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0)
(fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n)
(p11 : p 1 1 = bif g true true then 1 else 0)
(p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0))
(pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0))
(pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n))
(m n : Num)
: