Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  Basic.lean   Sprache: Lean

 

module

public import Mathlib.MeasureTheory.Measure.CompleteLattice

/-!
# Testing for the `gcongr` tactic
-/


/-
Test that `gcongr` lemmas are applied in the `reducible` transparency by default.
Previously, `DFunLike.coe` would be unfolded when applying a `@[gcongr]` lemma.
-/

section transparency
open MeasureTheory

variable {α : Type*} (a : Set α) {μ : OuterMeasure α} {μ' : OuterMeasure α}

@[gcongr high] lemma mono_outerMeasure (h : μ ≤ μ') : μ a ≤ μ' a := h a
example (h : μ ≤ μ') : μ a ≤ μ' a := by gcongr

variable [MeasurableSpace α] {ν : Measure α} {ν' : Measure α}

@[gcongr] lemma mono_measure (h : ν ≤ ν') : ν a ≤ ν' a := h a
example (h : ν ≤ ν') : ν a ≤ ν' a := by gcongr

end transparency

/-
Test that a more general `@[gcongr]` lemma always applies, and the resulting reflexive goals
are closed with `rfl`.
-/

section rfl

axiom myAdd : Nat → Nat → Nat

axiom rel : Nat → Nat → Prop

local infix:50 "~" => rel

variable {a b c d : Nat}

@[gcongr] axiom myAdd_mono : a ~ c → b ~ d → myAdd a b ~ myAdd c d

axiom myAdd_rfl : a ~ a

/--
error: unsolved goals
case a
a b c d : ℕ
h : b~d
⊢ a~a

case a
a b c d : ℕ
h : b~d
⊢ c~c
-/

#guard_msgs in
example (h : b ~ d) : myAdd a (myAdd b c) ~ myAdd a (myAdd d c) := by
  gcongr

/--
error: Tactic `gcongr` failed: subgoal a~a is not allowed by the provided pattern and is not closed by `rfl`

case a
a b c d : ℕ
h : b~d
⊢ a~a
-/

#guard_msgs in
example (h : b ~ d) : myAdd a (myAdd b c) ~ myAdd a (myAdd d c) := by
  gcongr myAdd _ (myAdd ?_ _)

attribute [refl] myAdd_rfl

example (h : b ~ d) : myAdd a (myAdd b c) ~ myAdd a (myAdd d c) := by
  gcongr

example (h : b ~ d) : myAdd a (myAdd b c) ~ myAdd a (myAdd d c) := by
  gcongr myAdd _ (myAdd ?_ _)

end rfl

-- Test some different ways of using the `@[gcongr]` tag

axiom foo : Nat → Prop

axiom foo_mono_iff (a b) : a ≤ b ↔ (foo a → foo b)
attribute [local gcongr] foo_mono_iff in example (a b) (h : a ≤ b) : foo a → foo b := by gcongr

axiom foo_mono_iff_rev (a b) : (foo a → foo b) ↔ a ≤ b
attribute [local gcongr] foo_mono_iff_rev in example (a b) (h : a ≤ b) : foo a → foo b := by gcongr

axiom foo_monotone : Monotone foo
attribute [local gcongr] foo_monotone in example (a b) (h : a ≤ b) : foo a ≤ foo b := by gcongr

axiom foo_mono_rev (a b) : foo a → a ≤ b → foo b
attribute [local gcongr] foo_mono_rev in example (a b) (h : a ≤ b) : foo a → foo b := by gcongr

Messung
CHZG
9310010097

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

letze Version des Elbe Quellennavigators


letze Version des Demonstrationsprogramms Goedel
letze Version des Bille Abgleichprogramms
Version

Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=1,188,106
#Domains=862,801