statement stringlengths 1 2.88k | proof stringlengths 0 13.9k | type stringclasses 10
values | symbolic_name stringlengths 1 131 | library stringclasses 417
values | filename stringlengths 17 80 | imports listlengths 0 16 | deps listlengths 0 64 | docstring stringlengths 0 10.2k | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
repeat_until : tactic unit → tactic unit → tactic unit | repeat_until_or_at_most 100000 | def | tactic.interactive.repeat_until | tactic.monotonicity | src/tactic/monotonicity/interactive.lean | [
"control.traversable.derive",
"control.traversable.lemmas",
"data.dlist",
"tactic.monotonicity.basic"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
rep_arity : Type
| one | exactly (n : ℕ) | many | inductive | tactic.interactive.rep_arity | tactic.monotonicity | src/tactic/monotonicity/interactive.lean | [
"control.traversable.derive",
"control.traversable.lemmas",
"data.dlist",
"tactic.monotonicity.basic"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | ||
repeat_or_not : rep_arity → tactic unit → option (tactic unit) → tactic unit | | rep_arity.one tac none := tac
| rep_arity.many tac none := repeat tac
| (rep_arity.exactly n) tac none := iterate_exactly' n tac
| rep_arity.one tac (some until) := tac >> until
| rep_arity.many tac (some until) := repeat_until tac until
| (rep_arity.exactly n) tac (some until) := iterate_exactly n tac >> unti... | def | tactic.interactive.repeat_or_not | tactic.monotonicity | src/tactic/monotonicity/interactive.lean | [
"control.traversable.derive",
"control.traversable.lemmas",
"data.dlist",
"tactic.monotonicity.basic"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
assert_or_rule : lean.parser (pexpr ⊕ pexpr) | (tk ":=" *> inl <$> texpr <|> (tk ":" *> inr <$> texpr)) | def | tactic.interactive.assert_or_rule | tactic.monotonicity | src/tactic/monotonicity/interactive.lean | [
"control.traversable.derive",
"control.traversable.lemmas",
"data.dlist",
"tactic.monotonicity.basic"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
arity : lean.parser rep_arity | tk "*" *> pure rep_arity.many <|>
rep_arity.exactly <$> (tk "^" *> small_nat) <|>
pure rep_arity.one | def | tactic.interactive.arity | tactic.monotonicity | src/tactic/monotonicity/interactive.lean | [
"control.traversable.derive",
"control.traversable.lemmas",
"data.dlist",
"tactic.monotonicity.basic"
] | [
"arity"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
ac_mono (rep : parse arity) :
parse assert_or_rule? →
opt_param mono_cfg { mono_cfg . } →
tactic unit | | none opt := focus1 $ repeat_or_not rep (ac_mono_aux opt) none
| (some (inl h)) opt :=
do focus1 $ repeat_or_not rep (ac_mono_aux opt) (some $ done <|> to_expr h >>= ac_refine)
| (some (inr t)) opt :=
do h ← i_to_expr t >>= assert `h,
tactic.swap,
focus1 $ repeat_or_not rep (ac_mono_aux opt) (some $ done <|> a... | def | tactic.interactive.ac_mono | tactic.monotonicity | src/tactic/monotonicity/interactive.lean | [
"control.traversable.derive",
"control.traversable.lemmas",
"data.dlist",
"tactic.monotonicity.basic"
] | [
"arity"
] | `ac_mono` reduces the `f x ⊑ f y`, for some relation `⊑` and a
monotonic function `f` to `x ≺ y`.
`ac_mono*` unwraps monotonic functions until it can't.
`ac_mono^k`, for some literal number `k` applies monotonicity `k`
times.
`ac_mono := h`, with `h` a hypothesis, unwraps monotonic functions and
uses `h` to solve th... | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
cfg extends rewrite_cfg | (try_simp : bool := ff)
(discharger : tactic unit := skip)
-- Warning: rewrite_search can't produce tactic scripts when the simplifier is used.
(simplifier : expr → tactic (expr × expr) := λ e, failed) | structure | tactic.nth_rewrite.cfg | tactic.nth_rewrite | src/tactic/nth_rewrite/basic.lean | [
"meta.expr_lens"
] | [] | Configuration options for nth_rewrite. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
tracked_rewrite | (exp : expr)
(proof : tactic expr)
-- If `addr` is not provided by the underlying implementation of `nth_rewrite` (i.e. kabstract)
-- `rewrite_search` will not be able to produce tactic scripts.
(addr : option (list expr_lens.dir)) | structure | tactic.nth_rewrite.tracked_rewrite | tactic.nth_rewrite | src/tactic/nth_rewrite/basic.lean | [
"meta.expr_lens"
] | [
"exp",
"expr_lens.dir"
] | A data structure to track rewrites of subexpressions.
The field `exp` contains the new expression,
while `proof` contains a proof that `exp` is equivalent to the expression that was rewritten. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
eval (rw : tracked_rewrite) : tactic (expr × expr) | do prf ← rw.proof,
return (rw.exp, prf) | def | tactic.nth_rewrite.tracked_rewrite.eval | tactic.nth_rewrite | src/tactic/nth_rewrite/basic.lean | [
"meta.expr_lens"
] | [] | Postprocess a tracked rewrite into a pair
of a rewritten expression and a proof witness of the rewrite. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
rewrite_without_new_mvars
(r : expr) (e : expr) (cfg : nth_rewrite.cfg := {}) : tactic (expr × expr) | lock_tactic_state $ -- This makes sure that we forget everything in between rewrites;
-- otherwise we don't correctly find everything!
do (new_t, prf, metas) ← rewrite_core r e { cfg.to_rewrite_cfg with md := semireducible },
try_apply_opt_auto_param cfg.to_apply_cfg metas,
set_goals metas,
... | def | tactic.nth_rewrite.congr.rewrite_without_new_mvars | tactic.nth_rewrite | src/tactic/nth_rewrite/congr.lean | [
"tactic.core",
"tactic.nth_rewrite.basic"
] | [] | Helper function which just tries to rewrite `e` using the equality `r` without assigning any
metavariables in the tactic state, and without creating any metavariables which cannot be
discharged by `cfg.discharger` in the process. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
rewrite_is_of_entire : expr → bool | | `(@eq.rec _ %%term %%C %%p _ _) :=
match C with
| `(λ p, _ = p) := tt
| _ := ff
end
| _ := ff | def | tactic.nth_rewrite.congr.rewrite_is_of_entire | tactic.nth_rewrite | src/tactic/nth_rewrite/congr.lean | [
"tactic.core",
"tactic.nth_rewrite.basic"
] | [] | Returns true if the argument is a proof that the entire expression was rewritten.
This is a bit of a hack: we manually inspect the proof that `rewrite_core` produced, and deduce from
that whether or not the entire expression was rewritten. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
rewrite_at_lens
(cfg : nth_rewrite.cfg) (r : expr × bool) (l : expr_lens) (e : expr) :
tactic (list tracked_rewrite) | do
(v, pr) ← rewrite_without_new_mvars r.1 e {cfg with symm := r.2},
-- Now we determine whether the rewrite transforms the entire expression or not:
if ¬(rewrite_is_of_entire pr) then return []
else do
let w := l.fill v,
qr ← l.congr pr,
s ← try_core (cfg.simplifier w),
(w, qr) ← match s with
... | def | tactic.nth_rewrite.congr.rewrite_at_lens | tactic.nth_rewrite | src/tactic/nth_rewrite/congr.lean | [
"tactic.core",
"tactic.nth_rewrite.basic"
] | [
"expr_lens"
] | Function which tries to perform the rewrite associated to the equality `r : expr × bool` (the
bool indicates whether we should flip the equality first), at the position pointed to by
`l : expr_lens`, by rewriting `e : expr`. If this succeeds, `rewrite_at_lens` computes (by unwinding
`l`) a proof that the entire express... | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
all_rewrites (e : expr) (r : expr × bool) (cfg : nth_rewrite.cfg := {}) :
tactic (list tracked_rewrite) | e.app_map (rewrite_at_lens cfg r) | def | tactic.nth_rewrite.congr.all_rewrites | tactic.nth_rewrite | src/tactic/nth_rewrite/congr.lean | [
"tactic.core",
"tactic.nth_rewrite.basic"
] | [] | List of all rewrites of an expression `e` by `r : expr × bool`.
Here `r.1` is the substituting expression and `r.2` flags the direction of the rewrite. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
target_or_hyp_type : option expr → tactic expr | | none := target
| (some h) := infer_type h | def | tactic.target_or_hyp_type | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [] | Returns the target of the goal when passed `none`,
otherwise, return the type of `h` in `some h`. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
replace_in_state : option expr → expr → expr → tactic unit | | none := tactic.replace_target
| (some h) := λ e p, tactic.replace_hyp h e p >> skip | def | tactic.replace_in_state | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [] | Replace the target, or a hypothesis, depending on whether `none` or `some h` is given as the
first argument. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
unpack_rule (p : rw_rule) : tactic (expr × bool) | do r ← to_expr p.rule tt ff,
return (r, p.symm) | def | tactic.unpack_rule | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [] | Preprocess a rewrite rule for use in `get_nth_rewrite`. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
get_nth_rewrite (n : ℕ) (q : rw_rules_t) (e : expr) : tactic tracked_rewrite | do rewrites ← q.rules.mmap $ λ r, unpack_rule r >>= all_rewrites e,
rewrites.join.nth n <|> fail "failed: not enough rewrites found" | def | tactic.get_nth_rewrite | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [] | Get the `n`th rewrite of rewrite rules `q` in expression `e`,
or fail if there are not enough such rewrites. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
get_nth_rewrite_with_zoom
(n : ℕ) (q : rw_rules_t) (path : list expr_lens.dir) (h : option expr) : tactic tracked_rewrite | do e ← target_or_hyp_type h,
(ln, new_e) ← expr_lens.entire.zoom path e,
rw ← get_nth_rewrite n q new_e,
return ⟨ln.fill rw.exp, rw.proof >>= ln.congr, rw.addr.map $ λ l, path ++ l⟩ | def | tactic.get_nth_rewrite_with_zoom | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [
"expr_lens.dir",
"path"
] | Rewrite the `n`th occurrence of the rewrite rules `q` of (optionally after zooming into) a
hypothesis or target `h` which is an application of a relation. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
nth_rewrite_core (path : list expr_lens.dir) (n : parse small_nat) (q : parse rw_rules)
(l : parse location) : tactic unit | do let fn := λ h, get_nth_rewrite_with_zoom n q path h
>>= λ rw, (rw.proof >>= replace_in_state h rw.exp),
match l with
| loc.wildcard := l.try_apply (fn ∘ some) (fn none)
| _ := l.apply (fn ∘ some) (fn none)
end,
tactic.try (tactic.reflexivity reducible),
(returnopt... | def | tactic.nth_rewrite_core | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [
"expr_lens.dir",
"path"
] | Rewrite the `n`th occurrence of the rewrite rules `q` (optionally on a side)
at all the locations `loc`. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
nth_rewrite
(n : parse small_nat) (q : parse rw_rules) (l : parse location) : tactic unit | nth_rewrite_core [] n q l | def | tactic.interactive.nth_rewrite | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [] | `nth_rewrite n rules` performs only the `n`th possible rewrite using the `rules`.
The tactics `nth_rewrite_lhs` and `nth_rewrite_rhs` are variants
that operate on the left and right hand sides of an equation or iff.
Note: `n` is zero-based, so `nth_rewrite 0 h`
will rewrite along `h` at the first possible location.
I... | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
nth_rewrite_lhs (n : parse small_nat) (q : parse rw_rules) (l : parse location) :
tactic unit | nth_rewrite_core [dir.F, dir.A] n q l | def | tactic.interactive.nth_rewrite_lhs | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
nth_rewrite_rhs (n : parse small_nat) (q : parse rw_rules) (l : parse location) :
tactic unit | nth_rewrite_core [dir.A] n q l | def | tactic.interactive.nth_rewrite_rhs | tactic.nth_rewrite | src/tactic/nth_rewrite/default.lean | [
"tactic.nth_rewrite.congr"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
clause | (list term) × (list term) | def | omega.clause | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | (([t₁,...tₘ],[s₁,...,sₙ]) : clause) encodes the constraints
0 = ⟦t₁⟧ ∧ ... ∧ 0 = ⟦tₘ⟧ ∧ 0 ≤ ⟦s₁⟧ ∧ ... ∧ 0 ≤ ⟦sₙ⟧, where
⟦t⟧ is the value of (t : term). | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
holds (v : nat → int) : clause → Prop | | (eqs,les) :=
( (∀ t : term, t ∈ eqs → 0 = term.val v t)
∧ (∀ t : term, t ∈ les → 0 ≤ term.val v t) ) | def | omega.clause.holds | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | holds v c := clause c holds under valuation v | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
sat (c : clause) : Prop | ∃ v : nat → int, holds v c | def | omega.clause.sat | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | sat c := there exists a valuation v under which c holds | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
unsat (c : clause) : Prop | ¬ c.sat | def | omega.clause.unsat | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | unsat c := there is no valuation v under which c holds | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
append (c1 c2 : clause) : clause | (c1.fst ++ c2.fst, c1.snd ++ c2.snd) | def | omega.clause.append | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | append two clauses by elementwise appending | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
holds_append {v : nat → int} {c1 c2 : clause} :
holds v c1 → holds v c2 → holds v (append c1 c2) | begin
intros h1 h2,
cases c1 with eqs1 les1,
cases c2 with eqs2 les2,
cases h1, cases h2,
constructor; rw list.forall_mem_append;
constructor; assumption,
end | lemma | omega.clause.holds_append | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [
"list.forall_mem_append"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
clauses.sat (cs : list clause) : Prop | ∃ c ∈ cs, clause.sat c | def | omega.clauses.sat | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | There exists a satisfiable clause c in argument | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
clauses.unsat (cs : list clause) : Prop | ¬ clauses.sat cs | def | omega.clauses.unsat | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | There is no satisfiable clause c in argument | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
clauses.unsat_nil : clauses.unsat [] | begin intro h1, rcases h1 with ⟨c,h1,h2⟩, cases h1 end | lemma | omega.clauses.unsat_nil | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
clauses.unsat_cons (c : clause) (cs : list clause) :
clause.unsat c → clauses.unsat cs →
clauses.unsat (c::cs) | h1 h2 h3 | begin
unfold clauses.sat at h3,
rw list.exists_mem_cons_iff at h3,
cases h3; contradiction,
end | lemma | omega.clauses.unsat_cons | tactic.omega | src/tactic/omega/clause.lean | [
"data.list.basic",
"tactic.omega.term"
] | [
"list.exists_mem_cons_iff"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between (v : nat → int) (as : list int) (l : nat) : nat → int | | 0 := 0
| (o+1) := (val_between o) + (get (l+o) as * v (l+o)) | def | omega.coeffs.val_between | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | `val_between v as l o` is the value (under valuation `v`) of the term
obtained taking the term represented by `(0, as)` and dropping all
subterms that include variables outside the range `[l,l+o)` | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
val_between_nil {l : nat} :
∀ m, val_between v [] l m = 0 | | 0 := by simp only [val_between]
| (m+1) :=
by simp only [val_between_nil m, omega.coeffs.val_between,
get_nil, zero_add, zero_mul, int.default_eq_zero] | lemma | omega.coeffs.val_between_nil | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"int.default_eq_zero",
"omega.coeffs.val_between",
"zero_mul"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val (v : nat → int) (as : list int) : int | val_between v as 0 as.length | def | omega.coeffs.val | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | Evaluation of the nonconstant component of a normalized linear arithmetic term. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
val_nil : val v [] = 0 | rfl | lemma | omega.coeffs.val_nil | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_eq_of_le {as : list int} {l : nat} :
∀ m, as.length ≤ l + m →
val_between v as l m = val_between v as l (as.length - l) | | 0 h1 := by { rw add_zero at h1, rw tsub_eq_zero_iff_le.mpr h1 }
| (m+1) h1 :=
begin
rw le_iff_eq_or_lt at h1, cases h1,
{ rw [h1, add_comm l, add_tsub_cancel_right] },
have h2 : list.length as ≤ l + m,
{ rw ← nat.lt_succ_iff, apply h1 },
simpa [ get_eq_default_of_le _ h2, zero_mul, add_zero,
... | lemma | omega.coeffs.val_between_eq_of_le | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"add_tsub_cancel_right",
"le_iff_eq_or_lt",
"nat.lt_succ_iff",
"zero_mul"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_eq_of_le {as : list int} {k : nat} :
as.length ≤ k → val v as = val_between v as 0 k | begin
intro h1, unfold val,
rw [val_between_eq_of_le k _], refl,
rw zero_add, exact h1
end | lemma | omega.coeffs.val_eq_of_le | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_eq_val_between
{v w : nat → int} {as bs : list int} {l : nat} :
∀ {m}, (∀ x, l ≤ x → x < l + m → v x = w x) →
(∀ x, l ≤ x → x < l + m → get x as = get x bs) →
val_between v as l m = val_between w bs l m | | 0 h1 h2 := rfl
| (m+1) h1 h2 :=
begin
unfold val_between,
have h3 : l + m < l + (m + 1),
{ rw ← add_assoc, apply lt_add_one },
apply fun_mono_2,
apply val_between_eq_val_between; intros x h4 h5,
{ apply h1 _ h4 (lt_trans h5 h3) },
{ apply h2 _ h4 (lt_trans h5 h3) },
rw [h1 _ _ h3, h2... | lemma | omega.coeffs.val_between_eq_val_between | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"lt_add_one"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_set {a : int} {l n : nat} :
∀ {m}, l ≤ n → n < l + m → val_between v ([] {n ↦ a}) l m = a * v n | | 0 h1 h2 :=
begin exfalso, apply lt_irrefl l (lt_of_le_of_lt h1 h2) end
| (m+1) h1 h2 :=
begin
rw [← add_assoc, nat.lt_succ_iff, le_iff_eq_or_lt] at h2,
cases h2; unfold val_between,
{ have h3 : val_between v ([] {l + m ↦ a}) l m = 0,
{ apply @eq.trans _ _ (val_between v [] l m),
{ apply ... | lemma | omega.coeffs.val_between_set | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"int.default_eq_zero",
"le_iff_eq_or_lt",
"list.func.get_set",
"nat.lt_succ_iff",
"zero_mul"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_set {m : nat} {a : int} :
val v ([] {m ↦ a}) = a * v m | begin
apply val_between_set (zero_le _),
rw [length_set, zero_add],
exact lt_max_of_lt_right (lt_add_one _),
end | lemma | omega.coeffs.val_set | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"lt_add_one",
"lt_max_of_lt_right"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_neg {as : list int} {l : nat} :
∀ {o}, val_between v (neg as) l o = -(val_between v as l o) | | 0 := rfl
| (o+1) :=
begin
unfold val_between,
rw [neg_add, neg_mul_eq_neg_mul],
apply fun_mono_2,
apply val_between_neg,
apply fun_mono_2 _ rfl,
apply get_neg
end | lemma | omega.coeffs.val_between_neg | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"neg_mul_eq_neg_mul"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_neg {as : list int} :
val v (neg as) = -(val v as) | by simpa only [val, length_neg] using val_between_neg | lemma | omega.coeffs.val_neg | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_add {is js : list int} {l : nat} :
∀ m, val_between v (add is js) l m =
(val_between v is l m) + (val_between v js l m) | | 0 := rfl
| (m+1) :=
by { simp only [val_between, val_between_add m,
list.func.get, get_add], ring } | lemma | omega.coeffs.val_between_add | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"list.func.get",
"ring"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_add {is js : list int} :
val v (add is js) = (val v is) + (val v js) | begin
unfold val,
rw val_between_add, apply fun_mono_2;
apply val_between_eq_of_le;
rw [zero_add, length_add],
apply le_max_left, apply le_max_right
end | lemma | omega.coeffs.val_add | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_sub {is js : list int} {l : nat} :
∀ m, val_between v (sub is js) l m =
(val_between v is l m) - (val_between v js l m) | | 0 := rfl
| (m+1) :=
by { simp only [val_between, val_between_sub m,
list.func.get, get_sub], ring } | lemma | omega.coeffs.val_between_sub | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"list.func.get",
"ring"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_sub {is js : list int} :
val v (sub is js) = (val v is) - (val v js) | begin
unfold val,
rw val_between_sub,
apply fun_mono_2;
apply val_between_eq_of_le;
rw [zero_add, length_sub],
apply le_max_left,
apply le_max_right
end | lemma | omega.coeffs.val_sub | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_except (k : nat) (v : nat → int) (as) | val_between v as 0 k + val_between v as (k+1) (as.length - (k+1)) | def | omega.coeffs.val_except | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | `val_except k v as` is the value (under valuation `v`) of the term
obtained taking the term represented by `(0, as)` and dropping the
subterm that includes the `k`th variable. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
val_except_eq_val_except
{k : nat} {is js : list int} {v w : nat → int} :
(∀ x ≠ k, v x = w x) → (∀ x ≠ k, get x is = get x js) →
val_except k v is = val_except k w js | begin
intros h1 h2, unfold val_except,
apply fun_mono_2,
{ apply val_between_eq_val_between;
intros x h3 h4;
[ {apply h1}, {apply h2} ];
apply ne_of_lt;
rw zero_add at h4;
apply h4 },
{ repeat { rw ← val_between_eq_of_le
((max is.length js.length) - (k+1)) },
{ apply val_between_eq... | lemma | omega.coeffs.val_except_eq_val_except | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"le_add_tsub",
"nat.lt_iff_add_one_le"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_except_update_set
{n : nat} {as : list int} {i j : int} :
val_except n (v⟨n ↦ i⟩) (as {n ↦ j}) = val_except n v as | by apply val_except_eq_val_except update_eq_of_ne (get_set_eq_of_ne _) | lemma | omega.coeffs.val_except_update_set | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_add_val_between {as : list int} {l m : nat} :
∀ {n}, val_between v as l m + val_between v as (l+m) n =
val_between v as l (m+n) | | 0 := by simp only [val_between, add_zero]
| (n+1) :=
begin
rw ← add_assoc,
unfold val_between,
rw add_assoc,
rw ← @val_between_add_val_between n,
ring,
end | lemma | omega.coeffs.val_between_add_val_between | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"ring"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_except_add_eq (n : nat) {as : list int} :
(val_except n v as) + ((get n as) * (v n)) = val v as | begin
unfold val_except, unfold val,
cases le_total (n + 1) as.length with h1 h1,
{ have h4 := @val_between_add_val_between v as 0 (n+1) (as.length - (n+1)),
have h5 : n + 1 + (as.length - (n + 1)) = as.length,
{ rw [add_comm, tsub_add_cancel_of_le h1] },
rw h5 at h4, apply eq.trans _ h4,
simp on... | lemma | omega.coeffs.val_except_add_eq | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"ring",
"tsub_add_cancel_of_le"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_map_mul {i : int} {as: list int} {l : nat} :
∀ {m}, val_between v (list.map ((*) i) as) l m = i * val_between v as l m | | 0 := by simp only [val_between, mul_zero, list.map]
| (m+1) :=
begin
unfold val_between,
rw [@val_between_map_mul m, mul_add],
apply fun_mono_2 rfl,
by_cases h1 : l + m < as.length,
{ rw [get_map h1, mul_assoc] },
rw not_lt at h1,
rw [get_eq_default_of_le, get_eq_default_of_le];
... | lemma | omega.coeffs.val_between_map_mul | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"mul_assoc",
"mul_zero"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
forall_val_dvd_of_forall_mem_dvd {i : int} {as : list int} :
(∀ x ∈ as, i ∣ x) → (∀ n, i ∣ get n as) | h1 n | by { apply forall_val_of_forall_mem _ h1,
apply dvd_zero } | lemma | omega.coeffs.forall_val_dvd_of_forall_mem_dvd | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"dvd_zero"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
dvd_val_between {i} {as: list int} {l : nat} :
∀ {m}, (∀ x ∈ as, i ∣ x) → (i ∣ val_between v as l m) | | 0 h1 := dvd_zero _
| (m+1) h1 :=
begin
unfold val_between,
apply dvd_add,
apply dvd_val_between h1,
apply dvd_mul_of_dvd_left,
by_cases h2 : get (l+m) as = 0,
{ rw h2, apply dvd_zero },
apply h1, apply mem_get_of_ne_zero h2
end | lemma | omega.coeffs.dvd_val_between | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"dvd_add",
"dvd_mul_of_dvd_left",
"dvd_zero"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
dvd_val {as : list int} {i : int} :
(∀ x ∈ as, i ∣ x) → (i ∣ val v as) | by apply dvd_val_between | lemma | omega.coeffs.dvd_val | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_map_div
{as: list int} {i : int} {l : nat} (h1 : ∀ x ∈ as, i ∣ x) :
∀ {m}, val_between v (list.map (λ x, x / i) as) l m = (val_between v as l m) / i | | 0 := by simp only [int.zero_div, val_between, list.map]
| (m+1) :=
begin
unfold val_between,
rw [@val_between_map_div m, int.add_div_of_dvd_right],
apply fun_mono_2 rfl,
{ apply calc get (l + m) (list.map (λ (x : ℤ), x / i) as) * v (l + m)
= ((get (l + m) as) / i) * v (l + m) :
... | lemma | omega.coeffs.val_between_map_div | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"dvd_mul_of_dvd_left",
"int.add_div_of_dvd_right",
"int.mul_div_assoc",
"int.zero_div",
"mul_comm"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_map_div {as : list int} {i : int} :
(∀ x ∈ as, i ∣ x) → val v (list.map (λ x, x / i) as) = (val v as) / i | by {intro h1, simpa only [val, list.length_map] using val_between_map_div h1} | lemma | omega.coeffs.val_map_div | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_between_eq_zero {is: list int} {l : nat} :
∀ {m}, (∀ x : int, x ∈ is → x = 0) → val_between v is l m = 0 | | 0 h1 := rfl
| (m+1) h1 :=
begin
have h2 := @forall_val_of_forall_mem _ _ is (λ x, x = 0) rfl h1,
simpa only [val_between, h2 (l+m), zero_mul, add_zero]
using @val_between_eq_zero m h1,
end | lemma | omega.coeffs.val_between_eq_zero | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [
"zero_mul"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
val_eq_zero {is : list int} :
(∀ x : int, x ∈ is → x = 0) → val v is = 0 | by apply val_between_eq_zero | lemma | omega.coeffs.val_eq_zero | tactic.omega | src/tactic/omega/coeffs.lean | [
"data.list.func",
"tactic.ring",
"tactic.omega.misc"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
symdiv (i j : int) : int | if (2 * (i % j)) < j
then i / j
else (i / j) + 1 | def | omega.symdiv | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
symmod (i j : int) : int | if (2 * (i % j)) < j
then i % j
else (i % j) - j | def | omega.symmod | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
symmod_add_one_self {i : int} :
0 < i → symmod i (i+1) = -1 | begin
intro h1,
unfold symmod,
rw [int.mod_eq_of_lt (le_of_lt h1) (lt_add_one _), if_neg],
simp only [add_comm, add_neg_cancel_left,
neg_add_rev, sub_eq_add_neg],
have h2 : 2 * i = (1 + 1) * i := rfl,
simpa only [h2, add_mul, one_mul,
add_lt_add_iff_left, not_lt] using h1
end | lemma | omega.symmod_add_one_self | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [
"int.mod_eq_of_lt",
"lt_add_one",
"one_mul"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
mul_symdiv_eq {i j : int} :
j * (symdiv i j) = i - (symmod i j) | begin
unfold symdiv, unfold symmod,
by_cases h1 : (2 * (i % j)) < j,
{ repeat {rw if_pos h1},
rw [int.mod_def, sub_sub_cancel] },
{ repeat {rw if_neg h1},
rw [int.mod_def, sub_sub, sub_sub_cancel,
mul_add, mul_one] }
end | lemma | omega.mul_symdiv_eq | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [
"int.mod_def",
"mul_one"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
symmod_eq {i j : int} :
symmod i j = i - j * (symdiv i j) | by rw [mul_symdiv_eq, sub_sub_cancel] | lemma | omega.symmod_eq | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
sgm (v : nat → int) (b : int) (as : list int) (n : nat) | let a_n : int := get n as in
let m : int := a_n + 1 in
((symmod b m) + (coeffs.val v (as.map (λ x, symmod x m)))) / m | def | omega.sgm | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | (sgm v b as n) is the new value assigned to the nth variable
after a single step of equality elimination using valuation v,
term ⟨b, as⟩, and variable index n. If v satisfies the initial
constraint set, then (v ⟨n ↦ sgm v b as n⟩) satisfies the new
constraint set after equality elimination. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
rhs : nat → int → list int → term | | n b as :=
let m := get n as + 1 in
⟨(symmod b m), (as.map (λ x, symmod x m)) {n ↦ -m}⟩ | def | omega.rhs | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
rhs_correct_aux {v : nat → int} {m : int} {as : list int} :
∀ {k}, ∃ d, (m * d +
coeffs.val_between v (as.map (λ (x : ℤ), symmod x m)) 0 k =
coeffs.val_between v as 0 k) | | 0 :=
begin
existsi (0 : int),
simp only [add_zero, mul_zero, coeffs.val_between]
end
| (k+1) :=
begin
simp only [zero_add, coeffs.val_between, list.map],
cases @rhs_correct_aux k with d h1, rw ← h1,
by_cases hk : k < as.length,
{ rw [get_map hk, symmod_eq, sub_mul],
existsi (d + (s... | lemma | omega.rhs_correct_aux | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [
"mul_zero",
"ring"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
rhs_correct {v : nat → int}
{b : int} {as : list int} (n : nat) :
0 < get n as →
0 = term.val v (b,as) →
v n = term.val (v ⟨n ↦ sgm v b as n⟩) (rhs n b as) | begin
intros h0 h1,
let a_n := get n as,
let m := a_n + 1,
have h3 : m ≠ 0,
{ apply ne_of_gt, apply lt_trans h0, simp [a_n, m] },
have h2 : m * (sgm v b as n) = (symmod b m) +
coeffs.val v (as.map (λ x, symmod x m)),
{ simp only [sgm, mul_comm m],
rw [int.div_mul_cancel],
have h4 : ∃ c, m * c ... | lemma | omega.rhs_correct | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [
"by_contra",
"dvd_mul_right",
"dvd_zero",
"int.div_mul_cancel",
"mul_comm",
"ring"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
sym_sym (m b : int) : int | symdiv b m + symmod b m | def | omega.sym_sym | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
coeffs_reduce : nat → int → list int → term | | n b as :=
let a := get n as in
let m := a + 1 in
(sym_sym m b, (as.map (sym_sym m)) {n ↦ -a}) | def | omega.coeffs_reduce | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
coeffs_reduce_correct
{v : nat → int} {b : int} {as : list int} {n : nat} :
0 < get n as →
0 = term.val v (b,as) →
0 = term.val (v ⟨n ↦ sgm v b as n⟩) (coeffs_reduce n b as) | begin
intros h1 h2,
let a_n := get n as,
let m := a_n + 1,
have h3 : m ≠ 0,
{ apply ne_of_gt,
apply lt_trans h1,
simp only [m, lt_add_iff_pos_right] },
have h4 : 0 = (term.val (v⟨n↦sgm v b as n⟩) (coeffs_reduce n b as)) * m :=
calc 0
= term.val v (b,as) : h2
... = b + coeffs.val_except n ... | lemma | omega.coeffs_reduce_correct | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [
"function.funext_iff",
"int.mul_div_cancel",
"int.zero_div",
"mul_comm",
"one_mul",
"ring"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
cancel (m : nat) (t1 t2 : term) : term | term.add (t1.mul (-(get m (t2.snd)))) t2 | def | omega.cancel | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
subst (n : nat) (t1 t2 : term) : term | term.add (t1.mul (get n t2.snd)) (t2.fst, t2.snd {n ↦ 0}) | def | omega.subst | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
subst_correct {v : nat → int} {b : int}
{as : list int} {t : term} {n : nat} :
0 < get n as → 0 = term.val v (b,as) →
term.val v t = term.val (v ⟨n ↦ sgm v b as n⟩) (subst n (rhs n b as) t) | begin
intros h1 h2,
simp only [subst, term.val, term.val_add, term.val_mul],
rw ← rhs_correct _ h1 h2,
cases t with b' as',
simp only [term.val],
have h3 : coeffs.val (v ⟨n ↦ sgm v b as n⟩) (as' {n ↦ 0}) =
coeffs.val_except n v as',
{ rw [← coeffs.val_except_add_eq n, get_set,
zero_mul, add_zero... | lemma | omega.subst_correct | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [
"ring",
"zero_mul"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
ee : Type
| drop : ee
| nondiv : int → ee
| factor : int → ee
| neg : ee
| reduce : nat → ee
| cancel : nat → ee | inductive | omega.ee | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | The type of equality elimination rules. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
repr : ee → string | | drop := "↓"
| (nondiv i) := i.repr ++ "∤"
| (factor i) := "/" ++ i.repr
| neg := "-"
| (reduce n) := "≻" ++ n.repr
| (cancel n) := "+" ++ n.repr | def | omega.ee.repr | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
has_repr : has_repr ee | ⟨repr⟩ | instance | omega.ee.has_repr | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
has_to_format : has_to_format ee | ⟨λ x, x.repr⟩ | instance | omega.ee.has_to_format | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
eq_elim : list ee → clause → clause | | [] ([], les) := ([],les)
| [] ((_::_), les) := ([],[])
| (_::_) ([], les) := ([],[])
| (ee.drop::es) ((eq::eqs), les) := eq_elim es (eqs, les)
| (ee.neg::es) ((eq::eqs), les) := eq_elim es ((eq.neg::eqs), les)
| (ee.nondiv i::es) ((b,as)::eqs, les) :=
if ¬(i ∣ b) ∧ (∀ x ∈ as, i ∣ x)
then ([],[⟨-1... | def | omega.eq_elim | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | Apply a given sequence of equality elimination steps to a clause. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
sat_empty : clause.sat ([],[]) | ⟨λ _,0, ⟨dec_trivial, dec_trivial⟩⟩ | lemma | omega.sat_empty | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
sat_eq_elim :
∀ {es : list ee} {c : clause}, c.sat → (eq_elim es c).sat | | [] ([], les) h := h
| (e::_) ([], les) h :=
by {cases e; simp only [eq_elim]; apply sat_empty}
| [] ((_::_), les) h := sat_empty
| (ee.drop::es) ((eq::eqs), les) h1 :=
begin
apply (@sat_eq_elim es _ _),
rcases h1 with ⟨v,h1,h2⟩,
refine ⟨v, list.forall_mem_of_forall_mem_cons h1, h2⟩
end
| (ee.neg... | lemma | omega.sat_eq_elim | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [
"dvd_add_left",
"dvd_zero",
"int.zero_div",
"list.forall_mem_cons",
"list.forall_mem_of_forall_mem_cons",
"list.mem_map",
"mul_zero"
] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
unsat_of_unsat_eq_elim (ee : list ee) (c : clause) :
(eq_elim ee c).unsat → c.unsat | by {intros h1 h2, apply h1, apply sat_eq_elim h2} | lemma | omega.unsat_of_unsat_eq_elim | tactic.omega | src/tactic/omega/eq_elim.lean | [
"tactic.omega.clause"
] | [] | If the result of equality elimination is unsatisfiable, the original clause is unsatisfiable. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
ee_state | (eqs : list term)
(les : list term)
(ees : list ee) | structure | omega.ee_state | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | The state of equality elimination proof search. `eqs` is the list of
equality constraints, and each `t ∈ eqs` represents the constraint `0 = t`.
Similarly, `les` is the list of inequality constraints, and each `t ∈ eqs`
represents the constraint `0 < t`. `ees` is the sequence of equality
elimination ste... | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
eqelim | state_t ee_state tactic | def | omega.eqelim | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
abort {α : Type} : eqelim α | ⟨λ x, failed⟩ | def | omega.abort | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
mk_eqelim_state
(eqs les : list term) : tactic ee_state | return (ee_state.mk eqs les []) | def | omega.mk_eqelim_state | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
get_eqs : eqelim (list term) | ee_state.eqs <$> get | def | omega.get_eqs | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Get the current list of equality constraints. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
get_les : eqelim (list term) | ee_state.les <$> get | def | omega.get_les | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Get the current list of inequality constraints. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
get_ees : eqelim (list ee) | ee_state.ees <$> get | def | omega.get_ees | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Get the current sequence of equality elimiation steps. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
set_eqs (eqs : list term) : eqelim unit | modify $ λ s, {eqs := eqs, ..s} | def | omega.set_eqs | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Update the list of equality constraints. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
set_les (les : list term) : eqelim unit | modify $ λ s, {les := les, ..s} | def | omega.set_les | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Update the list of inequality constraints. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
set_ees (es : list ee) : eqelim unit | modify $ λ s, {ees := es, ..s} | def | omega.set_ees | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Update the sequence of equality elimiation steps. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
add_ee (e : ee) : eqelim unit | do
es ← get_ees, set_ees (es ++ [e]) | def | omega.add_ee | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Add a new step to the sequence of equality elimination steps. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
head_eq : eqelim term | do eqs ← get_eqs,
match eqs with
| [] := abort
| (eq::eqs') := set_eqs eqs' >> pure eq
end | def | omega.head_eq | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | Return the first equality constraint in the current list of
equality constraints. The returned constraint is 'popped' and
no longer available in the state. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
run {α : Type} (eqs les : list term) (r : eqelim α) : tactic α | prod.fst <$> (mk_eqelim_state eqs les >>= r.run) | def | omega.run | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
ee_commit (t1 : eqelim α) (t2 : eqelim β)
(t3 : α → eqelim β) : eqelim β | do x ← ((t1 >>= return ∘ some) <|> return none),
match x with
| none := t2
| (some a) := t3 a
end | def | omega.ee_commit | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | If `t1` succeeds and returns a value, 'commit' to that choice and
run `t3` with the returned value as argument. Do not backtrack
to try `t2` even if `t3` fails. If `t1` fails outright, run `t2`. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
of_tactic {α : Type} : tactic α → eqelim α | state_t.lift | def | omega.of_tactic | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 | |
gcd : list int → nat | | [] := 0
| (i::is) := nat.gcd i.nat_abs (gcd is) | def | omega.gcd | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | GCD of all elements of the list. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
get_gcd (t : term) : eqelim int | pure ↑(gcd t.snd) | def | omega.get_gcd | tactic.omega | src/tactic/omega/find_ees.lean | [
"tactic.omega.eq_elim"
] | [] | GCD of all coefficients in a term. | https://github.com/leanprover-community/mathlib | 65a1391a0106c9204fe45bc73a039f056558cb83 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.