Built with
doc-gen4 , running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus.
On Mac, use
Cmd instead of
Ctrl .
/-
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Jeremy Avigad, Floris van Doorn
-/
import Std.Tactic.Ext
import Std.Tactic.Lint.Basic
import Std.Logic
import Std.WF
import Mathlib.Tactic.Alias
import Mathlib.Tactic.Basic
import Mathlib.Tactic.Relation.Rfl
import Mathlib.Tactic.Relation.Symm
import Mathlib.Mathport.Attributes
import Mathlib.Mathport.Rename
import Mathlib.Tactic.Relation.Trans
#align opt_param_eq optParam_eq : ∀ (α : Sort u) (default : α ), optParam α default = α optParam_eq
/- Implication -/
@[ deprecated ] def Implies ( a b : Prop ) := a → b
/-- Implication `→` is transitive. If `P → Q` and `Q → R` then `P → R`. -/
-- FIXME This should have `@[trans]`, but the `trans` attribute PR'd in #253 rejects it.
-- Note that it is still rejected after #857.
@[ deprecated ] theorem Implies.trans : ∀ {p q r : Prop }, (p → q ) → (q → r ) → p → r Implies.trans { p q r : Prop } ( h₁ : p → q ) ( h₂ : q → r ) :
p → r := fun hp ↦ h₂ ( h₁ hp )
/- Not -/
@[ deprecated ] def NonContradictory ( a : Prop ) : Prop := ¬¬ a
#align non_contradictory_intro not_not_intro : ∀ {p : Prop }, p → ¬ ¬ p not_not_intro
/- Eq -/
alias proofIrrel : ∀ {a : Prop } (h₁ h₂ : a ), h₁ = h₂ proofIrrel ← proof_irrel : ∀ {a : Prop } (h₁ h₂ : a ), h₁ = h₂ proof_irrel
alias congrFun : ∀ {α : Sort u} {β : α → Sort v } {f g : (x : α ) → β x }, f = g → ∀ (a : α ), f a = g a congrFun ← congr_fun : ∀ {α : Sort u} {β : α → Sort v } {f g : (x : α ) → β x }, f = g → ∀ (a : α ), f a = g a congr_fun
alias congrArg : ∀ {α : Sort u} {β : Sort v} {a₁ a₂ : α } (f : α → β ), a₁ = a₂ → f a₁ = f a₂ congrArg ← congr_arg : ∀ {α : Sort u} {β : Sort v} {a₁ a₂ : α } (f : α → β ), a₁ = a₂ → f a₁ = f a₂ congr_arg
@[ deprecated ] theorem trans_rel_left : ∀ {α : Sort u} {a b c : α } (r : α → α → Prop ), r a b → b = c → r a c trans_rel_left { α : Sort u } { a b c : α }
( r : α → α → Prop ) ( h₁ : r a b ) ( h₂ : b = c ) : r a c := h₂ ▸ h₁
@[ deprecated ] theorem trans_rel_right : ∀ {α : Sort u} {a b c : α } (r : α → α → Prop ), a = b → r b c → r a c trans_rel_right { α : Sort u } { a b c : α }
( r : α → α → Prop ) ( h₁ : a = b ) ( h₂ : r b c ) : r a c := h₁ ▸ h₂
theorem not_of_eq_false { p : Prop } ( h : p = False ) : ¬ p := fun hp ↦ h ▸ hp
theorem cast_proof_irrel : ∀ {α β : Sort u_1} (h₁ h₂ : α = β ) (a : α ), cast h₁ a = cast h₂ a cast_proof_irrel ( h₁ h₂ : α = β ) ( a : α ) : cast : {α β : Sort ?u.209} → α = β → α → β cast h₁ a = cast : {α β : Sort ?u.218} → α = β → α → β cast h₂ a := rfl : ∀ {α : Sort ?u.231} {a : α }, a = a rfl
attribute [symm] Eq.symm : ∀ {α : Sort u} {a b : α }, a = b → b = a Eq.symm
/- Ne -/
theorem Ne.def : ∀ {α : Sort u} (a b : α ), (a ≠ b ) = ¬ a = b Ne.def { α : Sort u } ( a b : α ) : ( a ≠ b ) = ¬ ( a = b ) := rfl : ∀ {α : Sort ?u.268} {a : α }, a = a rfl
attribute [symm] Ne.symm : ∀ {α : Sort u} {a b : α }, a ≠ b → b ≠ a Ne.symm
/- HEq -/
alias eqRec_heq ← eq_rec_heq
-- FIXME This is still rejected after #857
-- attribute [refl] HEq.refl
attribute [symm] HEq.symm : ∀ {α β : Sort u} {a : α } {b : β }, HEq a b → HEq b a HEq.symm
attribute [trans] HEq.trans : ∀ {α β φ : Sort u} {a : α } {b : β } {c : φ }, HEq a b → HEq b c → HEq a c HEq.trans
attribute [trans] heq_of_eq_of_heq : ∀ {α β : Sort u} {a a' : α } {b : β }, a = a' → HEq a' b → HEq a b heq_of_eq_of_heq
theorem heq_of_eq_rec_left : ∀ {α : Sort u_1} {φ : α → Sort v } {a a' : α } {p₁ : φ a } {p₂ : φ a' } (e : a = a' ), e ▸ p₁ = p₂ → HEq p₁ p₂ heq_of_eq_rec_left { φ : α → Sort v } { a a' : α } { p₁ : φ a } { p₂ : φ a' } :
( e : a = a' ) → ( h₂ : Eq.rec : {α : Sort ?u.333} →
{a : α } →
{motive : (a_1 : α ) → a = a_1 → Sort ?u.334 } → motive a (_ : a = a ) → {a_1 : α } → (t : a = a_1 ) → motive a_1 t Eq.rec (motive := fun a _ ↦ φ a ) p₁ e = p₂ ) → HEq p₁ p₂
| rfl : ∀ {α : Sort ?u.555} {a : α }, a = a rfl, rfl : ∀ {α : Sort ?u.559} {a : α }, a = a rfl => HEq.rfl : ∀ {α : Sort ?u.603} {a : α }, HEq a a HEq.rfl
theorem heq_of_eq_rec_right : ∀ {α : Sort u_1} {φ : α → Sort v } {a a' : α } {p₁ : φ a } {p₂ : φ a' } (e : a' = a ), p₁ = e ▸ p₂ → HEq p₁ p₂ heq_of_eq_rec_right { φ : α → Sort v } { a a' : α } { p₁ : φ a } { p₂ : φ a' } :
( e : a' = a ) → ( h₂ : p₁ = Eq.rec : {α : Sort ?u.927} →
{a : α } →
{motive : (a_1 : α ) → a = a_1 → Sort ?u.928 } → motive a (_ : a = a ) → {a_1 : α } → (t : a = a_1 ) → motive a_1 t Eq.rec (motive := fun a _ ↦ φ a ) p₂ e ) → HEq p₁ p₂
| rfl : ∀ {α : Sort u_1} {a : α }, a = a rfl, rfl : ∀ {α : Sort ?u.1153} {a : α }, a = a rfl => HEq.rfl : ∀ {α : Sort ?u.1196} {a : α }, HEq a a HEq.rfl
theorem of_heq_true { a : Prop } ( h : HEq a True ) : a := of_eq_true ( eq_of_heq : ∀ {α : Sort ?u.1507} {a a' : α }, HEq a a' → a = a' eq_of_heq h )
theorem eq_rec_compose { α β φ : Sort u } :
∀ ( p₁ : β = φ ) ( p₂ : α = β ) ( a : α ),
( Eq.recOn : {α : Sort ?u.1540} →
{a : α } →
{motive : (a_1 : α ) → a = a_1 → Sort ?u.1541 } → {a_1 : α } → (t : a = a_1 ) → motive a (_ : a = a ) → motive a_1 t Eq.recOn p₁ ( Eq.recOn : {α : Sort ?u.1578} →
{a : α } →
{motive : (a_1 : α ) → a = a_1 → Sort ?u.1579 } → {a_1 : α } → (t : a = a_1 ) → motive a (_ : a = a ) → motive a_1 t Eq.recOn p₂ a : β ) : φ ) = Eq.recOn : {α : Sort ?u.1648} →
{a : α } →
{motive : (a_1 : α ) → a = a_1 → Sort ?u.1649 } → {a_1 : α } → (t : a = a_1 ) → motive a (_ : a = a ) → motive a_1 t Eq.recOn ( Eq.trans : ∀ {α : Sort ?u.1674} {a b c : α }, a = b → b = c → a = c Eq.trans p₂ p₁ ) a
| rfl : ∀ {α : Sort ?u.2023} {a : α }, a = a rfl, rfl : ∀ {α : Sort ?u.2027} {a : α }, a = a rfl, _ => rfl : ∀ {α : Sort ?u.2072} {a : α }, a = a rfl
/- and -/
variable { a b c d : Prop }
#align and.symm And.symm : ∀ {a b : Prop }, a ∧ b → b ∧ a And.symm
#align and.swap And.symm : ∀ {a b : Prop }, a ∧ b → b ∧ a And.symm
/- or -/
#align non_contradictory_em not_not_em
#align or.symm Or.symm : ∀ {a b : Prop }, a ∨ b → b ∨ a Or.symm
#align or.swap Or.symm : ∀ {a b : Prop }, a ∨ b → b ∨ a Or.symm
/- xor -/
def Xor' : (a b : Prop ) → ?m.2374 a b Xor' ( a b : Prop ) := ( a ∧ ¬ b ) ∨ ( b ∧ ¬ a )
#align xor Xor'
/- iff -/
#align iff.mp Iff.mp : ∀ {a b : Prop }, (a ↔ b ) → a → b Iff.mp
#align iff.elim_left Iff.mp : ∀ {a b : Prop }, (a ↔ b ) → a → b Iff.mp
#align iff.mpr Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr
#align iff.elim_right Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr
attribute [refl] Iff.refl : ∀ (a : Prop ), a ↔ a Iff.refl
attribute [trans] Iff.trans : ∀ {a b c : Prop }, (a ↔ b ) → (b ↔ c ) → (a ↔ c ) Iff.trans
attribute [symm] Iff.symm : ∀ {a b : Prop }, (a ↔ b ) → (b ↔ a ) Iff.symm
-- This is needed for `calc` to work with `iff`.
instance : Trans : {α : Sort ?u.2406} →
{β : Sort ?u.2405} →
{γ : Sort ?u.2404} →
(α → β → Sort ?u.2409 ) →
(β → γ → Sort ?u.2408 ) →
outParam (α → γ → Sort ?u.2407 ) →
Sort (max(max(max(max(max(max1?u.2409)?u.2406)?u.2405)?u.2404)?u.2408)?u.2407) Trans Iff Iff Iff where
trans := fun p q ↦ p . trans : ∀ {a b c : Prop }, (a ↔ b ) → (b ↔ c ) → (a ↔ c ) trans q
#align not_congr not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr
#align not_iff_not_of_iff not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr
#align not_non_contradictory_iff_absurd not_not_not
alias not_not_not ↔ not_of_not_not_not : ∀ {a : Prop }, ¬ ¬ ¬ a → ¬ a not_of_not_not_not _
-- FIXME
-- attribute [congr] not_congr
@[ deprecated and_comm : ∀ {a b : Prop }, a ∧ b ↔ b ∧ a and_comm] theorem and_comm' : ∀ (a b : Prop ), a ∧ b ↔ b ∧ a and_comm' ( a b ) : a ∧ b ↔ b ∧ a := and_comm : ∀ {a b : Prop }, a ∧ b ↔ b ∧ a and_comm
#align and.comm and_comm : ∀ {a b : Prop }, a ∧ b ↔ b ∧ a and_comm
#align and_comm and_comm' : ∀ (a b : Prop ), a ∧ b ↔ b ∧ a and_comm'
@[ deprecated and_assoc : ∀ {a b c : Prop }, (a ∧ b ) ∧ c ↔ a ∧ b ∧ c and_assoc] theorem and_assoc' : ∀ (a b : Prop ), (a ∧ b ) ∧ c ↔ a ∧ b ∧ c and_assoc' ( a b ) : ( a ∧ b ) ∧ c ↔ a ∧ ( b ∧ c ) := and_assoc : ∀ {a b c : Prop }, (a ∧ b ) ∧ c ↔ a ∧ b ∧ c and_assoc
#align and_assoc and_assoc'
#align and.assoc and_assoc : ∀ {a b c : Prop }, (a ∧ b ) ∧ c ↔ a ∧ b ∧ c and_assoc
#align and.left_comm and_left_comm : ∀ {a b c : Prop }, a ∧ b ∧ c ↔ b ∧ a ∧ c and_left_comm
#align and_iff_left and_iff_leftₓ : ∀ {b a : Prop }, b → (a ∧ b ↔ a ) and_iff_leftₓ -- reorder implicits
variable ( p )
-- FIXME: remove _iff and add _eq for the lean 4 core versions
theorem and_true_iff : p ∧ True ↔ p := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( and_true _ )
#align and_true and_true_iff
theorem true_and_iff : True ∧ p ↔ p := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( true_and _ )
#align true_and true_and_iff
theorem and_false_iff : p ∧ False ↔ False := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( and_false _ )
#align and_false and_false_iff
theorem false_and_iff : False ∧ p ↔ False := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( false_and _ )
#align false_and false_and_iff
#align not_and_self not_and_self_iff
#align and_not_self and_not_self_iff
theorem and_self_iff : p ∧ p ↔ p := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( and_self : ∀ (p : Prop ), (p ∧ p ) = p and_self _ )
#align and_self and_self_iff : ∀ (p : Prop ), p ∧ p ↔ p and_self_iff
#align or.imp Or.impₓ : ∀ {a c b d : Prop }, (a → c ) → (b → d ) → a ∨ b → c ∨ d Or.impₓ -- reorder implicits
#align and.elim And.elimₓ : {a b : Prop } → {α : Sort u_1} → (a → b → α ) → a ∧ b → α And.elimₓ
#align iff.elim Iff.elimₓ : {a b : Prop } → {α : Sort u_1} → ((a → b ) → (b → a ) → α ) → (a ↔ b ) → α Iff.elimₓ
#align imp_congr imp_congrₓ : ∀ {a c b d : Prop }, (a ↔ c ) → (b ↔ d ) → (a → b ↔ c → d ) imp_congrₓ
#align imp_congr_ctx imp_congr_ctxₓ : ∀ {a c b d : Prop }, (a ↔ c ) → (c → (b ↔ d ) ) → (a → b ↔ c → d ) imp_congr_ctxₓ
#align imp_congr_right imp_congr_rightₓ : ∀ {a : Sort u_1} {b c : Prop }, (a → (b ↔ c ) ) → (a → b ↔ a → c ) imp_congr_rightₓ
#align eq_true_intro eq_true
#align eq_false_intro eq_false
@[ deprecated or_comm : ∀ {a b : Prop }, a ∨ b ↔ b ∨ a or_comm] theorem or_comm' : ∀ (a b : Prop ), a ∨ b ↔ b ∨ a or_comm' ( a b ) : a ∨ b ↔ b ∨ a := or_comm : ∀ {a b : Prop }, a ∨ b ↔ b ∨ a or_comm
#align or.comm or_comm : ∀ {a b : Prop }, a ∨ b ↔ b ∨ a or_comm
#align or_comm or_comm' : ∀ (a b : Prop ), a ∨ b ↔ b ∨ a or_comm'
@[ deprecated or_assoc : ∀ {a b c : Prop }, (a ∨ b ) ∨ c ↔ a ∨ b ∨ c or_assoc] theorem or_assoc' ( a b ) : ( a ∨ b ) ∨ c ↔ a ∨ ( b ∨ c ) := or_assoc : ∀ {a b c : Prop }, (a ∨ b ) ∨ c ↔ a ∨ b ∨ c or_assoc
#align or.assoc or_assoc : ∀ {a b c : Prop }, (a ∨ b ) ∨ c ↔ a ∨ b ∨ c or_assoc
#align or_assoc or_assoc'
#align or_left_comm or_left_comm : ∀ {a b c : Prop }, a ∨ b ∨ c ↔ b ∨ a ∨ c or_left_comm
#align or.left_comm or_left_comm : ∀ {a b c : Prop }, a ∨ b ∨ c ↔ b ∨ a ∨ c or_left_comm
#align or_iff_left_of_imp or_iff_left_of_impₓ : ∀ {b a : Prop }, (b → a ) → (a ∨ b ↔ a ) or_iff_left_of_impₓ -- reorder implicits
theorem true_or_iff : True ∨ p ↔ True := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( true_or _ )
#align true_or true_or_iff
theorem or_true_iff : p ∨ True ↔ True := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( or_true _ )
#align or_true or_true_iff
theorem false_or_iff : False ∨ p ↔ p := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( false_or _ )
#align false_or false_or_iff
theorem or_false_iff : p ∨ False ↔ p := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( or_false _ )
#align or_false or_false_iff
theorem or_self_iff : p ∨ p ↔ p := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( or_self : ∀ (p : Prop ), (p ∨ p ) = p or_self _ )
#align or_self or_self_iff : ∀ (p : Prop ), p ∨ p ↔ p or_self_iff
theorem not_or_of_not : ∀ {a b : Prop }, ¬ a → ¬ b → ¬ (a ∨ b ) not_or_of_not : ¬ a → ¬ b → ¬( a ∨ b ) := fun h1 h2 ↦ not_or . 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 ⟨ h1 , h2 ⟩
#align not_or not_or_of_not : ∀ {a b : Prop }, ¬ a → ¬ b → ¬ (a ∨ b ) not_or_of_not
theorem iff_true_iff : ( a ↔ True ) ↔ a := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( iff_true _ )
#align iff_true iff_true_iff
theorem true_iff_iff : ( True ↔ a ) ↔ a := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( true_iff _ )
#align true_iff true_iff_iff
theorem iff_false_iff : ( a ↔ False ) ↔ ¬ a := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( iff_false _ )
#align iff_false iff_false_iff
theorem false_iff_iff : ( False ↔ a ) ↔ ¬ a := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( false_iff _ )
#align false_iff false_iff_iff
theorem iff_self_iff ( a : Prop ) : ( a ↔ a ) ↔ True := iff_of_eq : ∀ {a b : Prop }, a = b → (a ↔ b ) iff_of_eq ( iff_self _ )
#align iff_self iff_self_iff
#align iff_congr iff_congrₓ : ∀ {a c b d : Prop }, (a ↔ c ) → (b ↔ d ) → ((a ↔ b ) ↔ (c ↔ d ) ) iff_congrₓ -- reorder implicits
#align implies_true_iff imp_true_iff
#align false_implies_iff false_imp_iff
#align true_implies_iff true_imp_iff
#align Exists Exists -- otherwise it would get the name ExistsCat
-- TODO
-- attribute [intro] Exists.intro
/- exists unique -/
def ExistsUnique : {α : Sort ?u.3168} → (p : α → Prop ) → ?m.3173 p ExistsUnique ( p : α → Prop ) := ∃ x , p x ∧ ∀ y , p y → y = x
open Lean TSyntax.Compat in
macro "∃! " xs : explicitBinders ", " b : term : term => expandExplicitBinders `` ExistsUnique xs b
/-- Pretty-printing for `ExistsUnique`, following the same pattern as pretty printing
for `Exists`. -/
@[app_unexpander ExistsUnique ] def unexpandExistsUnique : Lean.PrettyPrinter.Unexpander : Type Lean.PrettyPrinter.Unexpander
| `($(_) fun $ x :ident ↦ ∃! $ xs :binderIdent*, $ b ) => `(∃! $ x :ident $ xs :binderIdent*, $ b )
| `($(_) fun $ x :ident ↦ $ b ) => `(∃! $ x :ident, $ b )
| `($(_) fun ($ x :ident : $ t ) ↦ $ b ) => `(∃! ($ x :ident : $ t ), $ b )
| _ => throw ()
-- @[intro] -- TODO
theorem ExistsUnique.intro : ∀ {α : Sort u_1} {p : α → Prop } (w : α ), p w → (∀ (y : α ), p y → y = w ) → ∃! x , p x ExistsUnique.intro { p : α → Prop } ( w : α )
( h₁ : p w ) ( h₂ : ∀ (y : α ), p y → y = w h₂ : ∀ y , p y → y = w ) : ∃! x , p x := ⟨ w , h₁ , h₂ : ∀ (y : α ), p y → y = w h₂ ⟩
theorem ExistsUnique.elim : ∀ {α : Sort u} {p : α → Prop } {b : Prop }, (∃! x , p x ) → (∀ (x : α ), p x → (∀ (y : α ), p y → y = x ) → b ) → b ExistsUnique.elim { α : Sort u } { p : α → Prop } { b : Prop }
( h₂ : ∃! x , p x ) ( h₁ : ∀ (x : α ), p x → (∀ (y : α ), p y → y = x ) → b h₁ : ∀ x , p x → (∀ y , p y → y = x ) → b ) : b :=
Exists.elim : ∀ {α : Sort ?u.24423} {p : α → Prop } {b : Prop }, (∃ x , p x ) → (∀ (a : α ), p a → b ) → b Exists.elim h₂ (λ w hw => h₁ : ∀ (x : α ), p x → (∀ (y : α ), p y → y = x ) → b h₁ w ( And.left : ∀ {a b : Prop }, a ∧ b → a And.left hw ) ( And.right : ∀ {a b : Prop }, a ∧ b → b And.right hw ))
theorem exists_unique_of_exists_of_unique : ∀ {α : Sort u} {p : α → Prop }, (∃ x , p x ) → (∀ (y₁ y₂ : α ), p y₁ → p y₂ → y₁ = y₂ ) → ∃! x , p x exists_unique_of_exists_of_unique { α : Sort u } { p : α → Prop }
( hex : ∃ x , p x ) ( hunique : ∀ (y₁ y₂ : α ), p y₁ → p y₂ → y₁ = y₂ hunique : ∀ y₁ y₂ , p y₁ → p y₂ → y₁ = y₂ ) : ∃! x , p x :=
Exists.elim : ∀ {α : Sort ?u.24538} {p : α → Prop } {b : Prop }, (∃ x , p x ) → (∀ (a : α ), p a → b ) → b Exists.elim hex (λ x px => ExistsUnique.intro : ∀ {α : Sort ?u.24557} {p : α → Prop } (w : α ), p w → (∀ (y : α ), p y → y = w ) → ∃! x , p x ExistsUnique.intro x px (λ y ( h : p y ) => hunique : ∀ (y₁ y₂ : α ), p y₁ → p y₂ → y₁ = y₂ hunique y x h px ))
theorem ExistsUnique.exists : ∀ {α : Sort u_1} {p : α → Prop }, (∃! x , p x ) → ∃ x , p x ExistsUnique.exists { p : α → Prop } : (∃! x , p x ) → ∃ x , p x | ⟨ x , h , _⟩ => ⟨ x , h ⟩
#align exists_of_exists_unique ExistsUnique.exists : ∀ {α : Sort u_1} {p : α → Prop }, (∃! x , p x ) → ∃ x , p x ExistsUnique.exists
#align exists_unique.exists ExistsUnique.exists : ∀ {α : Sort u_1} {p : α → Prop }, (∃! x , p x ) → ∃ x , p x ExistsUnique.exists
theorem ExistsUnique.unique : ∀ {α : Sort u} {p : α → Prop }, (∃! x , p x ) → ∀ {y₁ y₂ : α }, p y₁ → p y₂ → y₁ = y₂ ExistsUnique.unique { α : Sort u } { p : α → Prop }
( h : ∃! x , p x ) { y₁ y₂ : α } ( py₁ : p y₁ ) ( py₂ : p y₂ ) : y₁ = y₂ :=
let ⟨ _ , _, hy : ∀ (y : α ), (fun x => p x ) y → y = w✝ hy ⟩ := h ; ( hy : ∀ (y : α ), (fun x => p x ) y → y = w✝ hy _ py₁ ). trans : ∀ {α : Sort ?u.25008} {a b c : α }, a = b → b = c → a = c trans ( hy : ∀ (y : α ), (fun x => p x ) y → y = w✝ hy _ py₂ ). symm : ∀ {α : Sort ?u.25023} {a b : α }, a = b → b = a symm
#align unique_of_exists_unique ExistsUnique.unique : ∀ {α : Sort u} {p : α → Prop }, (∃! x , p x ) → ∀ {y₁ y₂ : α }, p y₁ → p y₂ → y₁ = y₂ ExistsUnique.unique
#align exists_unique.unique ExistsUnique.unique : ∀ {α : Sort u} {p : α → Prop }, (∃! x , p x ) → ∀ {y₁ y₂ : α }, p y₁ → p y₂ → y₁ = y₂ ExistsUnique.unique
/- exists, forall, exists unique congruences -/
-- TODO
-- attribute [congr] forall_congr'
-- attribute [congr] exists_congr'
#align forall_congr forall_congr' : ∀ {α : Sort u_1} {p q : α → Prop }, (∀ (a : α ), p a ↔ q a ) → ((∀ (a : α ), p a ) ↔ ∀ (a : α ), q a ) forall_congr'
#align Exists.imp Exists.imp : ∀ {α : Sort u_1} {p q : α → Prop }, (∀ (a : α ), p a → q a ) → (∃ a , p a ) → ∃ a , q a Exists.imp
#align exists_imp_exists Exists.imp : ∀ {α : Sort u_1} {p q : α → Prop }, (∀ (a : α ), p a → q a ) → (∃ a , p a ) → ∃ a , q a Exists.imp
-- @[congr]
theorem exists_unique_congr : ∀ {α : Sort u_1} {p q : α → Prop }, (∀ (a : α ), p a ↔ q a ) → ((∃! a , p a ) ↔ ∃! a , q a ) exists_unique_congr { p q : α → Prop } ( h : ∀ a , p a ↔ q a ) : (∃! a , p a ) ↔ ∃! a , q a :=
exists_congr : ∀ {α : Sort ?u.25251} {p q : α → Prop }, (∀ (a : α ), p a ↔ q a ) → ((∃ a , p a ) ↔ ∃ a , q a ) exists_congr fun _ ↦ and_congr : ∀ {a c b d : Prop }, (a ↔ c ) → (b ↔ d ) → (a ∧ b ↔ c ∧ d ) and_congr ( h _ ) $ forall_congr' : ∀ {α : Sort ?u.25284} {p q : α → Prop }, (∀ (a : α ), p a ↔ q a ) → ((∀ (a : α ), p a ) ↔ ∀ (a : α ), q a ) forall_congr' fun _ ↦ imp_congr_left : ∀ {a b c : Prop }, (a ↔ b ) → (a → c ↔ b → c ) imp_congr_left ( h _ )
/- decidable -/
#align decidable.to_bool Decidable.decide
theorem decide_True' ( h : Decidable True ) : decide True = true := by simp
#align to_bool_true_eq_tt decide_True'
theorem decide_False' ( h : Decidable False ) : decide False = false := by simp
#align to_bool_false_eq_ff decide_False'
namespace Decidable
def recOn_true [ h : Decidable p ] { h₁ : p → Sort u } { h₂ : ¬ p → Sort u }
( h₃ : p ) ( h₄ : h₁ h₃ ) : Decidable.recOn h h₂ h₁ :=
cast : {α β : Sort ?u.25569} → α = β → α → β cast ( by match h with | .isTrue _ => rfl ) h₄
#align decidable.rec_on_true Decidable.recOn_true
def recOn_false [ h : Decidable p ] { h₁ : p → Sort u } { h₂ : ¬ p → Sort u } ( h₃ : ¬ p ) ( h₄ : h₂ h₃ ) :
Decidable.recOn h h₂ h₁ :=
cast : {α β : Sort ?u.25832} → α = β → α → β cast ( by match h with | .isFalse _ => rfl ) h₄
#align decidable.rec_on_false Decidable.recOn_false
alias byCases ← by_cases
alias byContradiction ← by_contradiction
alias not_not ← not_not_iff
@[ deprecated not_or ] theorem not_or_iff_and_not ( p q ) [ Decidable p ] [ Decidable q ] :
¬( p ∨ q ) ↔ ¬ p ∧ ¬ q := not_or
end Decidable
#align decidable_of_decidable_of_iff decidable_of_decidable_of_iff
#align decidable_of_decidable_of_eq decidable_of_decidable_of_eq
#align or.by_cases Or.by_cases : {p q : Prop } → [inst : Decidable p ] → {α : Sort u} → p ∨ q → (p → α ) → (q → α ) → α Or.by_cases
alias instDecidableOr ← Or.decidable
alias instDecidableAnd ← And.decidable
alias instDecidableNot ← Not.decidable
alias instDecidableIff ← Iff.decidable
alias instDecidableTrue ← decidableTrue
alias instDecidableFalse ← decidableFalse
#align decidable.true decidableTrue
#align decidable.false decidableFalse
#align or.decidable Or.decidable
#align and.decidable And.decidable
#align not.decidable Not.decidable
#align iff.decidable Iff.decidable
instance [ Decidable p ] [ Decidable q ] : Decidable ( Xor' p q ) := inferInstanceAs : (α : Sort ?u.26471) → [i : α ] → α inferInstanceAs ( Decidable ( Or ..))
def IsDecEq { α : Sort u } ( p : α → α → Bool ) : Prop := ∀ ⦃ x y : α ⦄, p x y = true → x = y
def IsDecRefl { α : Sort u } ( p : α → α → Bool ) : Prop := ∀ x , p x x = true
def decidableEq_of_bool_pred { α : Sort u } { p : α → α → Bool } ( h₁ : IsDecEq p )
( h₂ : IsDecRefl p ) : DecidableEq : Sort ?u.27023 → Sort (max1?u.27023) DecidableEq α
| x , y =>
if hp : p x y = true then isTrue ( h₁ hp )
else isFalse (λ hxy : x = y => absurd : ∀ {a : Prop } {b : Sort ?u.27095}, a → ¬ a → b absurd ( h₂ y ) ( by rwa [ hxy ] at hp ))
#align decidable_eq_of_bool_pred decidableEq_of_bool_pred
theorem decidableEq_inl_refl { α : Sort u } [ h : DecidableEq : Sort ?u.27347 → Sort (max1?u.27347) DecidableEq α ] ( a : α ) :
h a a = isTrue ( Eq.refl : ∀ {α : Sort ?u.27360} (a : α ), a = a Eq.refl a ) :=
match h a a with
| isTrue _ => rfl : ∀ {α : Sort ?u.27387} {a : α }, a = a rfl
theorem decidableEq_inr_neg { α : Sort u } [ h : DecidableEq : Sort ?u.27472 → Sort (max1?u.27472) DecidableEq α ] { a b : α }
( n : a ≠ b ) : h a b = isFalse n :=
match h a b with
| isFalse _ => rfl : ∀ {α : Sort ?u.27517} {a : α }, a = a rfl
#align inhabited.default Inhabited.default
#align arbitrary Inhabited.default
#align nonempty_of_inhabited instNonempty
/- subsingleton -/
theorem rec_subsingleton { p : Prop } [ h : Decidable p ] { h₁ : p → Sort u } { h₂ : ¬ p → Sort u }
[ h₃ : ∀ h : p , Subsingleton ( h₁ h )] [ h₄ : ∀ h : ¬ p , Subsingleton ( h₂ h )] :
Subsingleton ( Decidable.recOn h h₂ h₁ ) :=
match h with
| isTrue h => h₃ h
| isFalse h => h₄ h
@[ deprecated ite_self ]
theorem if_t_t ( c : Prop ) [ Decidable c ] { α : Sort u } ( t : α ) : ite c t t = t := ite_self : ∀ {α : Sort ?u.27923} {c : Prop } {d : Decidable c } (a : α ), (if c then a else a ) = a ite_self _
theorem imp_of_if_pos : ∀ {c t e : Prop } [inst : Decidable c ], (if c then t else e ) → c → t imp_of_if_pos { c t e : Prop } [ Decidable c ] ( h : ite c t e ) ( hc : c ) : t :=
by a, b, c✝, d : Prop p : ?m.27950 c, t, e : Prop inst✝ : Decidable c h : if c then t else e hc : c t
have := if_pos : ∀ {c : Prop } {h : Decidable c }, c → ∀ {α : Sort ?u.27984} {t e : α }, (if c then t else e ) = t if_pos hc ▸ h a, b, c✝, d : Prop p : ?m.27950 c, t, e : Prop inst✝ : Decidable c h : if c then t else e hc : c this : t t
; a, b, c✝, d : Prop p : ?m.27950 c, t, e : Prop inst✝ : Decidable c h : if c then t else e hc : c this : t t
a, b, c✝, d : Prop p : ?m.27950 c, t, e : Prop inst✝ : Decidable c h : if c then t else e hc : c t
exact this
#align implies_of_if_pos imp_of_if_pos : ∀ {c t e : Prop } [inst : Decidable c ], (if c then t else e ) → c → t imp_of_if_pos
theorem imp_of_if_neg : ∀ {c t e : Prop } [inst : Decidable c ], (if c then t else e ) → ¬ c → e imp_of_if_neg { c t e : Prop } [ Decidable c ] ( h : ite c t e ) ( hnc : ¬ c ) : e :=
by have := if_neg : ∀ {c : Prop } {h : Decidable c }, ¬ c → ∀ {α : Sort ?u.28055} {t e : α }, (if c then t else e ) = e if_neg hnc ▸ h a, b, c✝, d : Prop p : ?m.28021 c, t, e : Prop inst✝ : Decidable c h : if c then t else e hnc : ¬ c this : e e
; a, b, c✝, d : Prop p : ?m.28021 c, t, e : Prop inst✝ : Decidable c h : if c then t else e hnc : ¬ c this : e e
exact this
#align implies_of_if_neg imp_of_if_neg : ∀ {c t e : Prop } [inst : Decidable c ], (if c then t else e ) → ¬ c → e imp_of_if_neg
theorem if_ctx_congr : ∀ {α : Sort u} {b c : Prop } [dec_b : Decidable b ] [dec_c : Decidable c ] {x y u v : α },
(b ↔ c ) → (c → x = u ) → (¬ c → y = v ) → (if b then x else y ) = if c then u else v if_ctx_congr { α : Sort u } { b c : Prop } [ dec_b : Decidable b ] [ dec_c : Decidable c ]
{ x y u v : α } ( h_c : b ↔ c ) ( h_t : c → x = u ) ( h_e : ¬ c → y = v ) : ite b x y = ite c u v :=
match dec_b , dec_c with
| isFalse _, isFalse h₂ => h_e h₂
| isTrue _, isTrue h₂ => h_t h₂
| isFalse h₁ , isTrue h₂ => absurd : ∀ {a : Prop } {b : Sort ?u.28232}, a → ¬ a → b absurd h₂ ( Iff.mp : ∀ {a b : Prop }, (a ↔ b ) → a → b Iff.mp ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h₁ )
| isTrue h₁ , isFalse h₂ => absurd : ∀ {a : Prop } {b : Sort ?u.28267}, a → ¬ a → b absurd h₁ ( Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h₂ )
theorem if_congr : ∀ {α : Sort u} {b c : Prop } [inst : Decidable b ] [inst_1 : Decidable c ] {x y u v : α },
(b ↔ c ) → x = u → y = v → (if b then x else y ) = if c then u else v if_congr { α : Sort u } { b c : Prop } [ Decidable b ] [ Decidable c ]
{ x y u v : α } ( h_c : b ↔ c ) ( h_t : x = u ) ( h_e : y = v ) : ite b x y = ite c u v :=
if_ctx_congr : ∀ {α : Sort ?u.28532} {b c : Prop } [dec_b : Decidable b ] [dec_c : Decidable c ] {x y u v : α },
(b ↔ c ) → (c → x = u ) → (¬ c → y = v ) → (if b then x else y ) = if c then u else v if_ctx_congr h_c (λ _ => h_t ) (λ _ => h_e )
theorem if_ctx_congr_prop : ∀ {b c x y u v : Prop } [dec_b : Decidable b ] [dec_c : Decidable c ],
(b ↔ c ) → (c → (x ↔ u ) ) → (¬ c → (y ↔ v ) ) → ((if b then x else y ) ↔ if c then u else v ) if_ctx_congr_prop { b c x y u v : Prop } [ dec_b : Decidable b ] [ dec_c : Decidable c ]
( h_c : b ↔ c ) ( h_t : c → ( x ↔ u )) ( h_e : ¬ c → ( y ↔ v )) : ite b x y ↔ ite c u v :=
match dec_b , dec_c with
| isFalse _, isFalse h₂ => h_e h₂
| isTrue _, isTrue h₂ => h_t h₂
| isFalse h₁ , isTrue h₂ => absurd : ∀ {a : Prop } {b : Sort ?u.28781}, a → ¬ a → b absurd h₂ ( Iff.mp : ∀ {a b : Prop }, (a ↔ b ) → a → b Iff.mp ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h₁ )
| isTrue h₁ , isFalse h₂ => absurd : ∀ {a : Prop } {b : Sort ?u.28814}, a → ¬ a → b absurd h₁ ( Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h₂ )
-- @[congr]
theorem if_congr_prop : ∀ {b c x y u v : Prop } [inst : Decidable b ] [inst_1 : Decidable c ],
(b ↔ c ) → (x ↔ u ) → (y ↔ v ) → ((if b then x else y ) ↔ if c then u else v ) if_congr_prop { b c x y u v : Prop } [ Decidable b ] [ Decidable c ] ( h_c : b ↔ c ) ( h_t : x ↔ u )
( h_e : y ↔ v ) : ite b x y ↔ ite c u v :=
if_ctx_congr_prop : ∀ {b c x y u v : Prop } [dec_b : Decidable b ] [dec_c : Decidable c ],
(b ↔ c ) → (c → (x ↔ u ) ) → (¬ c → (y ↔ v ) ) → ((if b then x else y ) ↔ if c then u else v ) if_ctx_congr_prop h_c (λ _ => h_t ) (λ _ => h_e )
theorem if_ctx_simp_congr_prop : ∀ {b c x y u v : Prop } [inst : Decidable b ] (h_c : b ↔ c ),
(c → (x ↔ u ) ) → (¬ c → (y ↔ v ) ) → ((if b then x else y ) ↔ if c then u else v ) if_ctx_simp_congr_prop { b c x y u v : Prop } [ Decidable b ] ( h_c : b ↔ c ) ( h_t : c → ( x ↔ u ))
-- FIXME: after https://github.com/leanprover/lean4/issues/1867 is fixed,
-- this should be changed back to:
-- (h_e : ¬c → (y ↔ v)) : ite b x y ↔ ite c (h := decidable_of_decidable_of_iff h_c) u v :=
( h_e : ¬ c → ( y ↔ v )) : ite b x y ↔ @ ite _ c ( decidable_of_decidable_of_iff h_c ) u v :=
if_ctx_congr_prop : ∀ {b c x y u v : Prop } [dec_b : Decidable b ] [dec_c : Decidable c ],
(b ↔ c ) → (c → (x ↔ u ) ) → (¬ c → (y ↔ v ) ) → ((if b then x else y ) ↔ if c then u else v ) if_ctx_congr_prop (dec_c := decidable_of_decidable_of_iff h_c ) h_c h_t h_e
theorem if_simp_congr_prop : ∀ {b c x y u v : Prop } [inst : Decidable b ] (h_c : b ↔ c ),
(x ↔ u ) → (y ↔ v ) → ((if b then x else y ) ↔ if c then u else v ) if_simp_congr_prop { b c x y u v : Prop } [ Decidable b ] ( h_c : b ↔ c ) ( h_t : x ↔ u )
-- FIXME: after https://github.com/leanprover/lean4/issues/1867 is fixed,
-- this should be changed back to:
-- (h_e : y ↔ v) : ite b x y ↔ (ite c (h := decidable_of_decidable_of_iff h_c) u v) :=
( h_e : y ↔ v ) : ite b x y ↔ (@ ite _ c ( decidable_of_decidable_of_iff h_c ) u v ) :=
if_ctx_simp_congr_prop : ∀ {b c x y u v : Prop } [inst : Decidable b ] (h_c : b ↔ c ),
(c → (x ↔ u ) ) → (¬ c → (y ↔ v ) ) → ((if b then x else y ) ↔ if c then u else v ) if_ctx_simp_congr_prop h_c (λ _ => h_t ) (λ _ => h_e )
-- @[congr]
theorem dif_ctx_congr : ∀ {α : Sort u} {b c : Prop } [dec_b : Decidable b ] [dec_c : Decidable c ] {x : b → α } {u : c → α } {y : ¬ b → α }
{v : ¬ c → α } (h_c : b ↔ c ), (∀ (h : c ), x (_ : b ) = u h ) → (∀ (h : ¬ c ), y (_ : ¬ b ) = v h ) → dite b x y = dite c u v dif_ctx_congr { α : Sort u } { b c : Prop } [ dec_b : Decidable b ] [ dec_c : Decidable c ]
{ x : b → α } { u : c → α } { y : ¬ b → α } { v : ¬ c → α }
( h_c : b ↔ c ) ( h_t : ∀ (h : c ), x (_ : b ) = u h h_t : ∀ h : c , x ( Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr h_c h ) = u h )
( h_e : ∀ (h : ¬ c ), y (_ : ¬ b ) = v h h_e : ∀ h : ¬ c , y ( Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h ) = v h ) :
@ dite α b dec_b x y = @ dite α c dec_c u v :=
match dec_b , dec_c with
| isFalse _, isFalse h₂ => h_e : ∀ (h : ¬ c ), y (_ : ¬ b ) = v h h_e h₂
| isTrue _, isTrue h₂ => h_t : ∀ (h : c ), x (_ : b ) = u h h_t h₂
| isFalse h₁ , isTrue h₂ => absurd : ∀ {a : Prop } {b : Sort ?u.29639}, a → ¬ a → b absurd h₂ ( Iff.mp : ∀ {a b : Prop }, (a ↔ b ) → a → b Iff.mp ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h₁ )
| isTrue h₁ , isFalse h₂ => absurd : ∀ {a : Prop } {b : Sort ?u.29672}, a → ¬ a → b absurd h₁ ( Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h₂ )
theorem dif_ctx_simp_congr : ∀ {α : Sort u} {b c : Prop } [inst : Decidable b ] {x : b → α } {u : c → α } {y : ¬ b → α } {v : ¬ c → α } (h_c : b ↔ c ),
(∀ (h : c ), x (_ : b ) = u h ) → (∀ (h : ¬ c ), y (_ : ¬ b ) = v h ) → dite b x y = dite c u v dif_ctx_simp_congr { α : Sort u } { b c : Prop } [ Decidable b ]
{ x : b → α } { u : c → α } { y : ¬ b → α } { v : ¬ c → α }
( h_c : b ↔ c ) ( h_t : ∀ (h : c ), x (_ : b ) = u h h_t : ∀ h : c , x ( Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr h_c h ) = u h )
( h_e : ∀ (h : ¬ c ), y (_ : ¬ b ) = v h h_e : ∀ h : ¬ c , y ( Iff.mpr : ∀ {a b : Prop }, (a ↔ b ) → b → a Iff.mpr ( not_congr : ∀ {a b : Prop }, (a ↔ b ) → (¬ a ↔ ¬ b ) not_congr h_c ) h ) = v h ) :
-- FIXME: after https://github.com/leanprover/lean4/issues/1867 is fixed,
-- this should be changed back to:
-- dite b x y = dite c (h := decidable_of_decidable_of_iff h_c) u v :=
dite b x y = @ dite _ c ( decidable_of_decidable_of_iff h_c ) u v :=
dif_ctx_congr : ∀ {α : Sort ?u.29991} {b c : Prop } [dec_b : Decidable b ] [dec_c : Decidable c ] {x : b → α } {u : c → α } {y : ¬ b → α }
{v : ¬ c → α } (h_c : b ↔ c ), (∀ (h : c ), x (_ : b ) = u h ) → (∀ (h : ¬ c ), y (_ : ¬ b ) = v h ) → dite b x y = dite c u v dif_ctx_congr (dec_c := decidable_of_decidable_of_iff h_c ) h_c h_t : ∀ (h : c ), x (_ : b ) = u h h_t h_e : ∀ (h : ¬ c ), y (_ : ¬ b ) = v h h_e
def AsTrue ( c : Prop ) [ Decidable c ] : Prop := if c then True else False
def AsFalse ( c : Prop ) [ Decidable c ] : Prop := if c then False else True
theorem AsTrue.get { c : Prop } [ h₁ : Decidable c ] ( _ : AsTrue c ) : c :=
match h₁ with
| isTrue h_c => h_c
#align of_as_true AsTrue.get
#align ulift ULift
#align ulift.up ULift.up
#align ulift.down ULift.down
#align plift PLift
#align plift.up PLift.up
#align plift.down PLift.down
/- Equalities for rewriting let-expressions -/
theorem let_value_eq : ∀ {α : Sort u} {β : Sort v} {a₁ a₂ : α } (b : α → β ),
a₁ = a₂ →
(let x := a₁ ;
b x ) = let x := a₂ ;
b x let_value_eq { α : Sort u } { β : Sort v } { a₁ a₂ : α } ( b : α → β )
( h : a₁ = a₂ ) : ( let x : α := a₁ ; b x ) = ( let x : α := a₂ ; b x ) := congrArg : ∀ {α : Sort ?u.30363} {β : Sort ?u.30362} {a₁ a₂ : α } (f : α → β ), a₁ = a₂ → f a₁ = f a₂ congrArg b h
theorem let_value_heq : ∀ {α : Sort v} {β : α → Sort u } {a₁ a₂ : α } (b : (x : α ) → β x ),
a₁ = a₂ →
HEq
(let x := a₁ ;
b x )
(let x := a₂ ;
b x ) let_value_heq { α : Sort v } { β : α → Sort u } { a₁ a₂ : α } ( b : ∀ x : α , β x )
( h : a₁ = a₂ ) : HEq : {α : Sort ?u.30416} → α → {β : Sort ?u.30416} → β → Prop HEq ( let x : α := a₁ ; b x ) ( let x : α := a₂ ; b x ) := by a, b✝, c, d : Prop p : ?m.30394 α : Sort vβ : α → Sort ua₁, a₂ : α b : (x : α ) → β x h : a₁ = a₂ HEq
(let x := a₁ ;
b x )
(let x := a₂ ;
b x )cases h a, b✝, c, d : Prop p : ?m.30394 α : Sort vβ : α → Sort ua₁ : α b : (x : α ) → β x refl HEq
(let x := a₁ ;
b x )
(let x := a₁ ;
b x ); a, b✝, c, d : Prop p : ?m.30394 α : Sort vβ : α → Sort ua₁ : α b : (x : α ) → β x refl HEq
(let x := a₁ ;
b x )
(let x := a₁ ;
b x ) a, b✝, c, d : Prop p : ?m.30394 α : Sort vβ : α → Sort ua₁, a₂ : α b : (x : α ) → β x h : a₁ = a₂ HEq
(let x := a₁ ;
b x )
(let x := a₂ ;
b x )rfl
#align let_value_heq let_value_heq : ∀ {α : Sort v} {β : α → Sort u } {a₁ a₂ : α } (b : (x : α ) → β x ),
a₁ = a₂ →
HEq
(let x := a₁ ;
b x )
(let x := a₂ ;
b x ) let_value_heq -- FIXME: mathport thinks this is a dubious translation
theorem let_body_eq : ∀ {α : Sort v} {β : α → Sort u } (a : α ) {b₁ b₂ : (x : α ) → β x },
(∀ (x : α ), b₁ x = b₂ x ) →
(let x := a ;
b₁ x ) = let x := a ;
b₂ x let_body_eq { α : Sort v } { β : α → Sort u } ( a : α ) { b₁ b₂ : ∀ x : α , β x }
( h : ∀ (x : α ), b₁ x = b₂ x h : ∀ x , b₁ x = b₂ x ) : ( let x : α := a ; b₁ x ) = ( let x : α := a ; b₂ x ) := by a✝, b, c, d : Prop p : ?m.30550 α : Sort vβ : α → Sort ua : α b₁, b₂ : (x : α ) → β x h : ∀ (x : α ), b₁ x = b₂ x (let x := a ;
b₁ x ) = let x := a ;
b₂ x exact h : ∀ (x : α ), b₁ x = b₂ x h _ ▸ rfl : ∀ {α : Sort ?u.30599} {a : α }, a = a rfl
#align let_value_eq let_value_eq : ∀ {α : Sort u} {β : Sort v} {a₁ a₂ : α } (b : α → β ),
a₁ = a₂ →
(let x := a₁ ;
b x ) = let x := a₂ ;
b x let_value_eq -- FIXME: mathport thinks this is a dubious translation
theorem let_eq : ∀ {α : Sort v} {β : Sort u} {a₁ a₂ : α } {b₁ b₂ : α → β },
a₁ = a₂ →
(∀ (x : α ), b₁ x = b₂ x ) →
(let x := a₁ ;
b₁ x ) = let x := a₂ ;
b₂ x let_eq { α : Sort v } { β : Sort u } { a₁ a₂ : α } { b₁ b₂ : α → β }
( h₁ : a₁ = a₂ ) ( h₂ : ∀ (x : α ), b₁ x = b₂ x h₂ : ∀ x , b₁ x = b₂ x ) :
( let x : α := a₁ ; b₁ x ) = ( let x : α := a₂ ; b₂ x ) := by a, b, c, d : Prop p : ?m.30637 α : Sort vβ : Sort ua₁, a₂ : α b₁, b₂ : α → β h₁ : a₁ = a₂ h₂ : ∀ (x : α ), b₁ x = b₂ x (let x := a₁ ;
b₁ x ) = let x := a₂ ;
b₂ x simp [ h₁ , h₂ : ∀ (x : α ), b₁ x = b₂ x h₂ ]
#align let_eq let_eq : ∀ {α : Sort v} {β : Sort u} {a₁ a₂ : α } {b₁ b₂ : α → β },
a₁ = a₂ →
(∀ (x : α ), b₁ x = b₂ x ) →
(let x := a₁ ;
b₁ x ) = let x := a₂ ;
b₂ x let_eq -- FIXME: mathport thinks this is a dubious translation
section Relation
variable { α : Sort u } { β : Sort v } ( r : β → β → Prop )
/-- Local notation for an arbitrary binary relation `r`. -/
local infix :50 " ≺ " => r
/-- A reflexive relation relates every element to itself. -/
def Reflexive := ∀ x , x ≺ x
/-- A relation is symmetric if `x ≺ y` implies `y ≺ x`. -/
def Symmetric := ∀ ⦃ x y ⦄, x ≺ y → y ≺ x
/-- A relation is transitive if `x ≺ y` and `y ≺ z` together imply `x ≺ z`. -/
def Transitive := ∀ ⦃ x y z ⦄, x ≺ y → y ≺ z → x ≺ z
lemma Equivalence.reflexive { r : β → β → Prop } ( h : Equivalence r ) : Reflexive r := h . refl
lemma Equivalence.symmetric { r : β → β → Prop } ( h : Equivalence r ) : Symmetric r := λ _ _ => h . symm
lemma Equivalence.transitive { r : β → β → Prop }( h : Equivalence r ) : Transitive r :=
λ _ _ _ => h . trans : ∀ {α : Sort ?u.33229} {r : α → α → Prop }, Equivalence r → ∀ {x y z : α }, r x y → r y z → r x z trans
/-- A relation is total if for all `x` and `y`, either `x ≺ y` or `y ≺ x`. -/
def Total := ∀ x y , x ≺ y ∨ y ≺ x
#align mk_equivalence Equivalence.mk : ∀ {α : Sort u} {r : α → α → Prop },
(∀ (x : α ), r x x ) → (∀ {x y : α }, r x y → r y x ) → (∀ {x y z : α }, r x y → r y z → r x z ) → Equivalence r Equivalence.mk
/-- Irreflexive means "not reflexive". -/
def Irreflexive := ∀ x , ¬ x ≺ x
/-- A relation is antisymmetric if `x ≺ y` and `y ≺ x` together imply that `x = y`. -/
def AntiSymmetric := ∀ ⦃ x y ⦄, x ≺ y → y